AI
UML Diagram Generator
Brought to you by the folks at

How to generate an AI UML Diagram

Step-by-step guide on generating a UML Diagram

  1. Determine the type of UML diagram you'd like and specify that in the prompt. For example, start the prompt with "Generate a sequence diagram". UML diagram types include:
    1. Class Diagram (supported by Eraser)
    2. Use Case Diagram (supported by Eraser)
    3. Sequence Diagram (supported by Eraser)
    4. State Diagram (supported by Eraser)
    5. Activity Diagram
    6. Component Diagram
    7. Deployment Diagram
    8. Object Diagram
    9. Package Diagram
    10. Communication Diagram
    11. Interaction Overview Diagram
    12. Timing Diagram
  2. Describe the content of the diagram. A simple one-liner can work too but the best prompts are usually at least 3-4 sentences long. Here are some helpful prompting frameworks for each UML diagram type:
    1. Class Diagram: First, write out the entities (i.e. tables). For the entities, you may want to specify attributes (i.e. columns) and their data types. You can also specify primary and foreign keys. Then, write out the relationship between tables including the relationship cardinality.(e.g. "the user entity and the document entity have a one-to-many relationship via the userId attribute")
    2. Use Case Diagram: Make sure to describe users (e.g. student, teachers) and use cases (e.g. submit homework, view grades). Include the visual requirements of a use case diagram to the prompt: "A use case diagram consists of users and use cases. Users are rectangle shapes and use cases are oval shapes. Connections between users use cases show what users have what use cases, don't add any other connections. Put use cases in a group called use cases. Don't put users in a group and don't group use cases by users. Mention "Use Case Diagram" in the title."
    3. Sequence Diagram: Write a prompt describing a user flow or a data flow as a sequence of events. Structuring the prompt as a numbered list maps well to a sequence diagram.
    4. State Diagram: Make sure to describe states (e.g. logged in, logged out) and transitions (e.g. submit credentials, session expiry). Include the visual requirements of a state diagram to the prompt: "States are circle shapes. And connections represent the transition between states. Use icons as appropriate."
  3. Generate a diagram with the completed prompt.
  4. Edit the diagram with follow-up prompts (this step requires signing in to Eraser).
  5. Manually adjust the layout using GUI controls (this step requires signing into Eraser).

Tips on generating a UML diagram

  • Instead of writing a prompt from scratch, consider pasting excerpts from existing existing documentation, product code, system output, project description, or uploading image files.
  • Working with an LLM to create a fleshed out diagram prompt can be effective. Specify to the LLM the type of UML diagram and system or flow that you're trying to visualize, and ask it to create a list out what should be shown on the diagram.

Example diagrams

Trusted by leading architecture teams globally

FAQs

How do I get started?
Try one of our presets. Select an option under "Load a preset" and click "Generate Diagram". You can also browse our use case video library for more inspiration.
Can I edit my diagram?
Yes, the diagrams can be edited in Eraser, a docs and diagram tools built for engineering teams. Click on "Save and Edit Diagram". In Eraser, the diagrams can be edited using Eraser's diagram-as-code syntax.
Who made this and what is Eraser?
DiagramGPT was created by the team at Eraser, leveraging OpenAI's GPT-4. Eraser (eraser.io) is a whiteboard for engineering teams. You can edit your DiagramGPT generated diagrams using Eraser.
How can I share feedback?
We'd love to hear from you. Reach out to us at hello@tryeraser.com, on Twitter (@eraserlabs), or join our Slack community.
What types of diagrams can it draw?
4 types are currently available – flow charts, entity relationship diagrams, cloud architecture diagrams, and sequence diagrams.
Is there an API?
Yes, you can read our API documentation here. Due to LLM costs, the API is only available to Professional Plan teams.
Will my data be used for LLM training?
No. OpenAI nor Eraser will use your data to train AI models. Eraser may analyze your usage to improve and enhance our AI feature.
What's next?
It only gets better from here. We're working to improve accuracy and layout customization. If there's something you'd really like to see, drop us a note at hello@tryeraser.com.