Skip to main content

Developer commands

Four lower-traffic subcommands that don’t share a daily-use story but earn their place:

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?
For onboarding a new schema, run eval against the bundled starter, then write a domain-specific golden set targeting your real questions.

mine-queries

Harvest observed SQL from pg_stat_statements into the local store. Populates the get_example_queries MCP tool’s response.

Prerequisites

Requires the pg_stat_statements extension on the source database:
The mining role needs read access to the 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 eval driver.
  • CI smoke tests that operate against a known shape.

import dbt

Import entities (and optionally metrics) from a dbt manifest.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.

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.