Pro and Pro Max

AI assistant

Click AI in the editor’s top bar to create a diagram from a description, or to change the open one by saying what you want. Each diagram you create or change uses 2 AI credits; a fix of an answer Mermaid couldn’t read is free. Pro includes 100 AI credits a month and Pro Max 300, shared by every AI feature (see AI credits).

New diagram

Describe a system or a process in words, and the assistant writes the Mermaid for it, with real components and icons from the editor’s libraries.

  1. Open the editor, with any diagram of the project you want the new one in.
  2. Click AI in the top bar.
  3. Choose New diagram.
  4. Describe it in 3 to 2,000 characters: the parts, how they connect, and any boundaries to show, such as “A serverless order pipeline on AWS: API Gateway, Lambda, SQS and DynamoDB, with CloudWatch monitoring”.
  5. Click Create diagram, or press Ctrl + Enter. The button says Drawing… while the AI works.
  6. The new diagram opens in the editor. It’s saved in the current project with a title the AI chose, and the panel says what it drew.

What the assistant does with your description:

  • Picks the diagram type: a flowchart for architectures, pipelines and processes, a sequence diagram for interactions over time, a state diagram for lifecycles, an ER diagram for data models, a class diagram for code structure, and a Gantt chart for schedules. Name a type to choose it yourself.
  • Uses real icons: components are drawn as rich nodes. Name the cloud provider (AWS, Google Cloud or Azure) to get its service icons.
  • Keeps it readable: short titles, one idea per box, groups only for real boundaries such as an account, a network or a team, and usually fewer than 30 boxes.

The panel’s third choice, Animated explainer, draws a topic and explains it in captioned steps: see Animated explainers.

Guide: Draw and change Mermaid diagrams with the AI assistant.

AI › New diagram: describe the system and choose Create diagram. It opens as a new diagram.

Change this diagram

Say what to change in the open diagram, and the assistant edits its code the way you would by hand.

  1. Open the diagram in the editor.
  2. Click AI in the top bar. Change diagram is already chosen when the diagram has content; it’s turned off for an empty one.
  3. Say what to change, such as “Add a Redis cache between the API and the database”, “Group the services into a VPC” or “Make the queue a dead-letter queue and add a retry arrow”.
  4. Click Change diagram, or press Ctrl + Enter.
  5. The code and the canvas update, and the panel says what changed, with “Press Ctrl+Z to undo.”
  • The rest stays as it was: node ids, labels, comments, styles and the order of lines. Positions you set in Manual mode, an animated explainer’s story and a walkthrough are kept too: they aren’t sent to the AI, and are put back afterwards.
  • New boxes follow the diagram’s conventions, rich nodes or plain, and its direction.
  • Undo: it’s a normal edit, so Ctrl + Z undoes it. For a diagram saved to your account, the version before the change is also kept in Version history (see Version history).
  • If a change can’t be made in that diagram type, the assistant does the closest reasonable thing and says so.
  • Ask for one change at a time: small changes are easier to check, and each can be undone on its own.
AI › Change diagram: say what to change. The code and the canvas update, and Ctrl+Z undoes it.

Good to know

  • Plans: Pro and Pro Max. Signed out, the panel offers Sign in; on Free it says what’s included, with See Pro. Each request uses 2 credits, and the panel shows the price and your balance under the prompt.
  • Answers Mermaid can’t read: every answer is checked before it reaches the canvas. If Mermaid can’t read it, the app sends the error back to the AI once, and that fix is free. If the fixed answer still can’t be read, it goes into the editor anyway and the status bar shows the error, so you can correct it or undo it and ask in other words.
  • Short bursts are limited: after many requests in a few seconds, the panel says “Too many requests. Wait a minute and try again.”
  • If it doesn’t work: “The AI is busy right now” means try again in a minute; “The AI declined this request” means describe it differently; “The answer was too large to finish” means ask for less at once. Credits for a request that fails on our side are given back.
  • Not enough credits: the button is turned off, and Buy credits appears (see Buying more).
  • Check before you share: AI can make mistakes. Read the diagram against what you know of the system.
  • Your data: your request and the open diagram’s code are sent to Anthropic, our AI provider, to write the answer. They aren’t used to train models.

To edit on the canvas without AI, see Edit Mermaid diagrams by dragging, typing, or asking.

On Free, the AI panel says what each AI diagram uses and which plans include it, with See Pro.