Add and edit with AI

Once a diagram exists, you can use Mermaid AI to make changes to it in plain language without rewriting syntax manually.

Mermaid has three ways to work with AI — each designed for a different moment in the editing process. Use the one that fits where you are.

Mermaid AI chat

The AI chat panel lives at the bottom left of the screen. Open it to generate a new diagram from scratch, make broad structural changes, or have a back-and-forth conversation about what you’re building.

Open Mermaid AI:

  1. Click Mermaid AI at the bottom left of the screen.
  2. Describe the diagram you want or the change you need.
  3. Mermaid AI generates the diagram and shows you a diff before applying anything.

Good for:

  • Starting a new diagram from a prompt or uploaded file
  • Changing diagram type, direction, or overall structure
  • Making changes that touch the whole diagram rather than a specific section

For full prompt guidance, examples by diagram type, and file upload instructions, see Generate a diagram with AI →

Vibe diagramming

Vibe diagramming is inline AI — it lives inside the Visual Editor so you never have to leave the canvas to make changes. Select any node or group of nodes, describe what you want to change, and Mermaid updates just that section. The rest of the diagram stays exactly as it is.

Use vibe diagramming:

  1. Open your diagram in the Visual Editor.
  2. Select the node or nodes you want to change.
  3. An inline prompt appears — describe the change.
  4. Mermaid AI updates only the selected section.

Good for:

  • Diagrams that are mostly right but need targeted edits
  • Adding steps, reframing logic, or renaming nodes for a different audience
  • Staying in flow without context switching to the chat panel

Vibe diagramming isn’t just for starting from scratch. That flowchart that’s 80% there? Select the nodes that need work, describe the change, done.

Voice diagramming (beta)

Speak your diagram instead of typing it. Voice diagramming sits right next to the Mermaid AI button at the bottom left — click it, describe your diagram out loud, and Mermaid transcribes and renders it in real time.

Good for:

  • Thinking out loud while building
  • Sketching something quickly without touching a keyboard
  • Roughing out a structure before refining in the editor

Review before applying

All three AI modes show you a diff of proposed changes before applying them. Review what’s changing, then click Apply to confirm or Discard to try a different approach. Mermaid AI never changes a diagram without showing you first.

Fix a broken diagram

If a diagram has syntax errors and won’t render, open Mermaid AI and click Fix with AI. It identifies the issue, proposes a fix, and shows the diff before applying. Faster than hunting through the code yourself.

Switch to the text editor

Everything Mermaid AI generates is standard Mermaid syntax — switch to the text editor at any point to make precise adjustments. The AI panel and text editor stay in sync.

What’s next?