schema_searchLABSCO SUMMARY
Start at the new repository; read this one for how it works.
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.
What it is
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.
What you get
schema_search(query, hops, limit)— a natural-language query returning tables with full schema and scores- Four search strategies:
bm25,fuzzy,semanticandhybrid, 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
Requirements
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.
Setup effort
One command plus credentials — pip install "schema-search[postgres,mcp]", then supply credentials
USE CASES
Finding which tables hold a concept nobody documented
Ask in plain language and get the matching tables plus the ones a foreign key away.
Giving an assistant only the schema it needs
Return the top few tables with full column detail instead of pasting a 200-table schema into context.
Tracing what a table connects to
Raise hops to expand along foreign keys and see the surrounding relationships.
1 tool
Listed in project docs. Your client may show a different list.
BEFORE YOU INSTALL
What to know first
Tools you get
1 tool named in the project's documentation.
Where it runs
Both documented setups run the server on your machine.
INSTALLATION
Connect your client
Server setup
pip install "schema-search[postgres,mcp]"MCP Clients
Any MCP client — uvx
{
"mcpServers": {
"schema-search": {
"command": "uvx",
"args": [
"schema-search[postgres,mcp]",
"postgresql://<YOUR_DB_USER>:<YOUR_DB_PASSWORD>@localhost/<YOUR_DB_NAME>"
]
}
}
}postgresql://<YOUR_DB_USER>:<YOUR_DB_PASSWORD>@localhost/<YOUR_DB_NAME> is your own SQLAlchemy connection string. Three more positional arguments may follow it, in this order: a path to your config.yml, an LLM API key, and an LLM base URL — the last two only if you set chunking.strategy to llm.
Any MCP client — pip
{
"mcpServers": {
"schema-search": {
"command": "<YOUR_PATH_TO_SCHEMA_SEARCH>",
"args": [
"postgresql://<YOUR_DB_USER>:<YOUR_DB_PASSWORD>@localhost/<YOUR_DB_NAME>"
]
}
}
}postgresql://<YOUR_DB_USER>:<YOUR_DB_PASSWORD>@localhost/<YOUR_DB_NAME> is your own SQLAlchemy connection string. Three more positional arguments may follow it, in this order: a path to your config.yml, an LLM API key, and an LLM base URL — the last two only if you set chunking.strategy to llm. Point command at the schema-search executable pip installed (for conda: <env>/bin/schema-search).