The idea is sound and unusually pragmatic — index the schema in memory, search it lexically by default, and let embeddings be an extra rather than a prerequisite — which is why it fits a 200-table database without standing up a vector store. Before you build on it, note the first line of the README: this copy is kept for reference and the maintained version lives with SignalPilot Labs.
A schema search engine for large relational databases: it indexes tables, columns, indices, foreign keys and constraints in memory, then answers questions like "where are user refunds stored?" with the matching tables and their relationships. This repository is reference only — development has moved to the SignalPilot Labs repository.
- `schema_search(query, hops, limit)` — a natural-language query returning tables with full schema and scores
- Four search strategies: `bm25`, `fuzzy`, `semantic` and `hybrid`, chosen per query or in config
- Foreign-key expansion via `hops` — 0 for direct matches only, 1 or 2 to pull in related tables
- Results as markdown or JSON, including primary keys, column types, constraints and matched chunks
- Optional CrossEncoder reranking, switched on by setting `reranker.model`
- A base install with no PyTorch — semantic search is an opt-in extra
Install with the extras you need: `pip install "schema-search[postgres,mcp]"` for Postgres plus the server, adding `semantic` for embeddings and `llm` for LLM-generated schema summaries. Also supports MySQL, Snowflake, BigQuery and Databricks. It takes a SQLAlchemy connection string as its first argument, so the server holds live database credentials. An LLM API key is needed only if you set `chunking.strategy` to `llm`. Cache lands in `/tmp/.schema_search_cache`. MIT licensed.
One command plus a key — pip install "schema-search[postgres,mcp]", then supply credentials
