Developer commands
Four lower-traffic subcommands that don’t share a daily-use story but earn their place:schemabrain eval— score the retriever against a golden set.schemabrain mine-queries— harvest observed SQL frompg_stat_statements.schemabrain fixture-path— print the absolute path to a bundled fixture.schemabrain import dbt— import semantic definitions from a dbt manifest.
eval
Score a retriever implementation against a golden set; prints recall@1 / @3 / @10.Authoring a golden set
Each row in the JSON file is a{query, expected_table} pair. The eval prints how often the retriever’s top-K results contained the expected table:
- recall@1 — was it the top result?
- recall@3 — was it in the top 3?
- recall@10 — was it in the top 10?
eval against the bundled starter, then write a domain-specific golden set targeting your real questions.
mine-queries
Harvest observed SQL frompg_stat_statements into the local store. Populates the get_example_queries MCP tool’s response.
Prerequisites
Requires thepg_stat_statements extension on the source database:
pg_stat_statements view (superusers always have it; non-super roles need pg_read_all_stats).
If the extension or grant is missing, mine-queries exits cleanly with an actionable message — no row is written, the store stays intact, and get_example_queries keeps returning status: empty with a recovery hint pointing to Manual flow — Mine observed queries.
The joins suggest command also reads pg_stat_statements evidence — running mine-queries first improves canonical-join ranking.
fixture-path
Print the absolute path to a bundled fixture. Paste-clean for shell substitution.
Useful for:
- Seeding a demo Postgres against the bundled e-commerce schema.
- Loading the starter golden set into a custom
evaldriver. - CI smoke tests that operate against a known shape.
import dbt
Import entities (and optionally metrics) from a dbtmanifest.json. Read-only against dbt — no export path.
dbt-driven curation via init
schemabrain init auto-detects a dbt manifest from $DBT_PROJECT_DIR (or by walking up from cwd for dbt_project.yml) and routes the entity + metric curation stages through this importer instead of the LLM. See schemabrain init.
Related
schemabrain index
Index first, then
eval / mine-queries.schemabrain joins suggest
Consumes
mine-queries output for canonical-join ranking.MCP tool — get_example_queries
The agent-facing surface
mine-queries populates.schemabrain init
Auto-detects dbt and routes curation through this importer.