schemabrain index
Reflects every user-visible table from the source database into the local SQLite store. Optionally enriches column descriptions via Claude Haiku 4.5 and computes local sentence embeddings so the MCP retriever can do semantic search.
Source
One of these is required:
The URL must use the
postgresql+psycopg:// scheme.
Storage and embedding
Enrichment
Cost guards
Dry-run preview
The
--dry-run estimate ignores --enable-sonnet tier routing and reports Haiku pricing only.Output
What gets stored
For each table:- Full structural reflection (columns, types, nullability, defaults, primary keys, foreign keys).
- One LLM-written column description per column, when enrichment is enabled (~$0.0003/col on Haiku 4.5).
- One local sentence embedding per description (
BAAI/bge-small-en-v1.5, ~67MB ONNX, ~10ms/col warm), when embedding is enabled. - Heuristic PII tags per column, when classification is enabled.
serve, entities, metrics, joins, inspect, check, audit, and dashboard all operate against the SQLite file index writes.
Examples
Standard run
Cost-free dry run
Preview the cost of catching up after a long pause
CI smoke without LLM
Cryptic schema, accept higher cost
Exit codes
Related
schemabrain init
Wizard that runs
index plus everything else.schemabrain check
Detect drift after a schema migration.
schemabrain eval
Score retrieval quality against a golden set.
schemabrain inspect
Browse the store without re-indexing.