AI diagram generator

AI entity relationship diagram generator.

Point it at the schema you already have. The relationships are declared, so the diagram is a rendering rather than an interpretation.

Download for macOS
v0.1.33 · .dmg · Apple Silicon & Intel
Signed & notarized by Apple · opens without a Gatekeeper warning
sha256 698955a0187bc039f4c74f5d05a9f10fbb27376a45788a0a241d1326b73873c7
Download for Windows instead
$curl -fsSL https://lucidtrain.com/install.sh | sh

What an ER diagram shows

Entities, their attributes, and the relationships between them with cardinality. It describes the shape of the data independently of how it is stored, which is why it survives a migration between databases while a table diagram does not. The most useful thing it does is make an accidental many-to-many or a missing constraint visible.

How Lucid Train draws one

Describe what you want, or point it at a repository. The agent emits a semantic graph of nodes and edges with no coordinates, and the ELK layout engine computes positions and orthogonal routing. That separation is the reason the output cannot come back with boxes overlapping or arrows crossing through cards, which is the characteristic failure when a language model is asked to place things on a canvas itself. It also means editing is editing the graph: change a component and the layout re-solves rather than drifting out of alignment.

Read from the schema, not inferred

Where a foreign key exists, the relationship and its direction are facts rather than guesses; where a unique constraint sits on that key, the cardinality is a fact too. From a Prisma schema or ORM models it is better still, because relations are declared as relations. That is the difference between a diagram you can rely on and one you have to check.

Join tables should not be entities

A table whose primary key is composed entirely of foreign keys is a join table, and drawing it as an entity produces a diagram that matches your storage and not your model. Recognising it and drawing a single many-to-many relationship instead keeps the picture at the level people actually reason about.

Local, offline, your models

It runs as a desktop application. Against a local Ollama model the whole thing works offline with no API key and no telemetry, which is the practical difference from every browser-based diagram tool: your architecture never leaves the machine.

Cardinality notation

NotationMeaning
One to oneEach row on one side matches at most one on the other
One to manyThe standard foreign key relationship
Many to manyRealised through a join table, drawn as one relationship
MandatoryThe foreign key is NOT NULL
OptionalThe foreign key is nullable
IdentifyingThe child's primary key includes the parent's key
Self-referencingA hierarchy, such as manager or parent category

Try it

shell
$ Read the SQL schema in this directory and draw an entity relationship diagram. Show cardinality and mark join tables as many-to-many.
FAQ

Questions

Can it generate an ER diagram from an existing database?

From a schema dump, yes. It does not connect to a running database, so exporting the schema is the first step, and that also means it works against databases you have no credentials for.

Which sources work?

SQL DDL, migration files, Prisma schemas, Django models, SQLAlchemy, TypeORM and Drizzle. ORM definitions usually give a better diagram because they declare intent that a bare foreign key does not.

Crow's foot or Chen notation?

Crow's foot, since it is what almost every engineering team uses. Chen notation is more common in academic material and is rarely what a working team wants in a repository.

Can it design a schema rather than document one?

Yes, describe the domain and it proposes entities and relationships. It is a starting point for a discussion about the model, not a substitute for having one.

Related