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.
schemabrain index --url-env DATABASE_URL --store-path ./schemabrain.db
Idempotent. Running against an unchanged schema is a no-op (~0.1s, zero LLM calls, zero embedder calls). Schema-changed tables are re-enriched and re-embedded selectively.
Skip generating local sentence embeddings. Saves ~10ms per column at index time, but find_relevant_entities falls back to keyword/substring matching. Implied when --no-enrich is set.
Skip the LLM column-description step. Useful for cost-free dry runs and CI.
--enable-sonnet
(off — Haiku only)
Route cryptic column names (e.g. acct_dim_v3) to Claude Sonnet 4.6 instead of Haiku 4.5. ~5x more expensive per affected column; better descriptions.
--no-pii-classify
(off — classifier enabled)
Skip the heuristic PII classifier and wipe existing PII tags for tables touched this run. With classification off, audit rows record pii_categories='' and --pii-block enforcement has nothing to act on.
--no-pii-classify emits a stderr warning on every run. It is a privacy-paranoid setting, not a performance setting — the classifier is heuristic, local, and fast.
Count tables and columns, compute the diff against the cached store, and estimate LLM cost from a measured per-column average (~$0.0003/col on Haiku 4.5). No DB writes, no LLM calls, no embeddings. ANTHROPIC_API_KEY is NOT required.
--since DURATION_OR_TIMESTAMP
Only meaningful with --dry-run. Adds a freshness audit line: count of cached columns whose owning table was last indexed before this point, plus the estimated cost to refresh them. Accepts 30s / 5m / 2h / 14d or an ISO 8601 timestamp with timezone.
The --dry-run estimate ignores --enable-sonnet tier routing and reports Haiku pricing only.
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.
The store is the input every other command reads from. serve, entities, metrics, joins, inspect, check, audit, and dashboard all operate against the SQLite file index writes.