AI
ERD Generator
Brought to you by the folks at

How to generate an AI ERD (Entity Relationship Diagram)

Step-by-step guide on generating an ERD

  1. Write a prompt describing the data model in detail. A simple one-liner (e.g. "draw a data model of a Twitter clone") can work too but the best prompts are usually at least 3-4 sentences long. Applying the below framework generally yields good results:
    1. 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.
    2. 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. Generate a diagram with the completed prompt.
  3. Edit the diagram with follow-up prompts (this step requires signing in to Eraser).

Tips on generating an ERD

  • If available, instead of writing a prompt from scratch, consider pasting excerpts from existing code (e.g. SQL schema, ORM schema), call transcripts, requirements docs, or image files.
  • Iterating with an LLM to create a fleshed out diagram prompt can be effective. Ask it to list out entities including attributes and constraints. Then ask it to list out relationships between entities including cardinality.

Example diagrams

ERDs vs. database diagrams

  • ERDs are often database diagrams, representing the data model or data schema that is stored in a RDBMS (relational database management system).

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.