{"id":50082582,"url":"https://github.com/arun-kc/schemabrain","last_synced_at":"2026-05-22T16:04:14.406Z","repository":{"id":357185348,"uuid":"1234793482","full_name":"Arun-kc/schemabrain","owner":"Arun-kc","description":"SQL-boundary safety layer for AI agents that touch real databases. Schema intelligence today; validate-before-execute + sub-query refusal in v2.","archived":false,"fork":false,"pushed_at":"2026-05-19T08:54:10.000Z","size":2889,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-19T08:56:13.424Z","etag":null,"topics":["agentic-ai","ai-agents","ai-security","claude","database-security","llm","mcp","model-context-protocol","postgres","prompt-injection","python","semantic-search","sql-injection"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/schemabrain/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Arun-kc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-10T16:44:00.000Z","updated_at":"2026-05-19T07:35:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Arun-kc/schemabrain","commit_stats":null,"previous_names":["arun-kc/schemabrain"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Arun-kc/schemabrain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arun-kc%2Fschemabrain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arun-kc%2Fschemabrain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arun-kc%2Fschemabrain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arun-kc%2Fschemabrain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arun-kc","download_url":"https://codeload.github.com/Arun-kc/schemabrain/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arun-kc%2Fschemabrain/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33352449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"online","status_checked_at":"2026-05-22T02:00:06.671Z","response_time":265,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-ai","ai-agents","ai-security","claude","database-security","llm","mcp","model-context-protocol","postgres","prompt-injection","python","semantic-search","sql-injection"],"created_at":"2026-05-22T16:04:12.669Z","updated_at":"2026-05-22T16:04:14.397Z","avatar_url":"https://github.com/Arun-kc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs/assets/readme-hero-dark.svg\"\u003e\n    \u003cimg src=\"docs/assets/readme-hero-light.svg\" alt=\"schemabrain — the safety and schema intelligence layer for AI systems that interact with databases\" width=\"100%\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eschemabrain\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Arun-kc/schemabrain/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/Arun-kc/schemabrain/ci.yml?style=flat-square\u0026label=CI\u0026labelColor=0A0A0A\u0026color=3ECF8E\" alt=\"CI\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/schemabrain/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/schemabrain?style=flat-square\u0026label=pypi\u0026labelColor=0A0A0A\u0026color=3ECF8E\" alt=\"PyPI version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/schemabrain/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/dm/schemabrain?style=flat-square\u0026label=downloads\u0026labelColor=0A0A0A\u0026color=3ECF8E\" alt=\"PyPI downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.python.org/\"\u003e\u003cimg src=\"https://img.shields.io/badge/python-3.11%20%7C%203.12-0A0A0A?style=flat-square\u0026labelColor=0A0A0A\" alt=\"Python 3.11 | 3.12\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-0A0A0A?style=flat-square\u0026labelColor=0A0A0A\" alt=\"License: MIT\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://modelcontextprotocol.io\"\u003e\u003cimg src=\"https://img.shields.io/badge/MCP-compatible-3ECF8E?style=flat-square\u0026labelColor=0A0A0A\" alt=\"MCP compatible\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003e **The agent never writes SQL. Schema Brain does, from definitions you control.**\n\nA pluggable semantic + SQL firewall for AI agents on Postgres. Your agent only ever sees twelve read-only MCP tools — entity lookup, validated metrics, canonical-join resolution, PII-aware refusal — and Schema Brain compiles and runs the parameterized SQL on its side. Every call lands in a tamper-evident audit log.\n\n- **One command from `pip install` to wired agent** — bare `schemabrain init` walks the 7-stage activation wizard end-to-end. Auto-detects a dbt project and routes through the importer when one is present.\n- **Validated metrics, not invented SQL** — entities, metrics, and canonical joins compile to parameterized SQL the agent never sees.\n- **Pluggable into any agent loop** — Claude Desktop, Claude Code, Cursor, or your own Anthropic / OpenAI / LangGraph loop over MCP stdio. 230-LOC drop-in proof at [`examples/anthropic_demo.py`](examples/anthropic_demo.py).\n- **Watch what the agent does** — `schemabrain tail` streams every tool call live; every call lands in an append-only `mcp_audit` table with a sha256 chain.\n\n```bash\npip install schemabrain\nschemabrain init\n# then ask your MCP host: \"list the entities Schema Brain knows about\"\n```\n\n**Cost.** ~$0.01 to index 7 tables · ~$0.03 for 87 columns · **$0** to re-index unchanged schemas. Bounded by per-stage cost caps; runs on Claude Haiku 4.5.\n\n**Status: 0.3.0 (alpha).** Postgres + SQLite supported today. Snowflake / BigQuery / MySQL on the roadmap. The longer-term position is the SQL-boundary safety layer for AI agents — see [Where it's going](#where-its-going).\n\n---\n\n## Contents\n\n- [Quickstart](#quickstart) — 3 steps from `pip install` to a working agent\n- [The firewall](#the-firewall) — what Schema Brain enforces at the SQL boundary\n- [Sample session](#sample-session) — real Claude Desktop interaction against the bundled fixture\n- [Where it's going](#where-its-going) — honest disclaimer about what's not built yet\n- [Roadmap](#roadmap) — shipped + in progress + planned\n- [Troubleshooting](#troubleshooting) — the five most common first-run failures\n- [Documentation](#documentation) — deeper guides\n\n**Read next based on what you need:**\n\n| Goal | Where to go |\n|---|---|\n| Try it on the bundled fixture | [Quickstart](#quickstart) |\n| Understand the firewall properties | [The firewall](#the-firewall) |\n| Plug into your own agent loop | [`docs/setup.md`](docs/setup.md#path-2--anthropic-sdk-demo-no-claude-desktop-required) |\n| Build a semantic layer | [`docs/semantic-layer.md`](docs/semantic-layer.md) |\n| Run in production (audit, drift, Docker) | [`docs/operations.md`](docs/operations.md) |\n| Observe the agent (tail, audit log, OTel) | [`docs/observability.md`](docs/observability.md) |\n| Compare with Vanna / Atlan / dbt-mcp / WrenAI | [`docs/landscape.md`](docs/landscape.md) |\n\n---\n\n## Quickstart\n\nThree steps from `pip install` to a working Claude Desktop integration. ~45s once Docker and the embedding model are cached; budget a couple of minutes on a true first run while the `postgres:16-alpine` image and the ~67 MB ONNX embedding model download.\n\n### 1. Install\n\n```bash\npip install schemabrain\nschemabrain --version\n```\n\nSource install (`git clone` + `uv sync --extra dev`) is documented in [`docs/setup.md`](docs/setup.md#0-activation-wizard-recommended).\n\n### 2. Run the activation wizard\n\n```bash\nschemabrain init\n```\n\n`init` is a seven-stage wizard that takes you from \"I have a Postgres database\" to \"Claude Desktop can answer questions about it\" in one command. On first run it prompts for what it needs:\n\n- **A Postgres URL** — paste your own connection string, or press **Enter** to spin up a local demo Postgres container with the bundled e-commerce fixture (Docker is invoked automatically; idempotent on re-runs).\n- **An `ANTHROPIC_API_KEY`** — optional. Skip and the wizard still wires Claude Desktop; entity curation can run later.\n\n```\nSchema Brain init — activation wizard\n\n  [1/7] Source check       ✓ source reachable + read-only\n  [2/7] Index schema       ✓ 7 tables, 30 columns indexed\n  [3/7] Curate entities    ✓ 6 entities suggested + applied (cost: $0.01)\n  [4/7] Curate metrics     ✓ 10 metrics suggested + applied (cost: $0.03)\n  [5/7] Curate joins       ✓ 5 canonical joins created (FK-mined, no LLM)\n  [6/7] Wire host          ✓ wrote schemabrain entry to claude_desktop_config.json\n  [7/7] Next               ✓ restart your MCP host, then ask: \"list the entities Schema Brain knows about\"\n```\n\nFull wizard reference (stages explained, flags, dbt auto-detection, `--print-only` for non-Claude-Desktop hosts, `--no-entities` / `--no-metrics` / `--no-joins` opt-outs, cost-cap pauses): [`docs/setup.md`](docs/setup.md#0-activation-wizard-recommended).\n\n### 3. Restart Claude Desktop and ask\n\n1. Quit Claude Desktop fully — **Cmd+Q**, not just close the window. The MCP config is only read on cold start.\n2. Relaunch.\n3. New conversation:\n\n   \u003e list the entities Schema Brain knows about\n\nIf Claude calls `list_entities` and reports `user`, `order`, etc., you're done. If not, see [Troubleshooting](#troubleshooting).\n\nAfter the wizard, `schemabrain inspect` shows what the agent has and `schemabrain tail` streams every tool call live — see [`docs/operations.md`](docs/operations.md).\n\n---\n\n## The firewall\n\n\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs/assets/schemabrain-architecture-dark.gif\"\u003e\n    \u003cimg src=\"docs/assets/schemabrain-architecture-light.gif\" alt=\"schemabrain architecture: agent talks to schemabrain over MCP stdio; schemabrain emits parameterized SQL to Postgres; the schemabrain boundary is the trust boundary. Mint pulse animates from agent through MCP tools, semantic layer, SQL emitter, and audit log to Postgres.\" width=\"900\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\nFour properties Schema Brain enforces at the SQL boundary today — plus one that keeps them portable:\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\" valign=\"top\"\u003e\n\n### 1. Agent never writes raw SQL\n\nEntities, metrics, and canonical joins compile to parameterized SQL Schema Brain runs on its side. The agent sees rows + the SQL that was run — never arbitrary statements at your database.\n\n[Build your semantic layer →](docs/semantic-layer.md)\n\n\u003c/td\u003e\n\u003ctd width=\"50%\" valign=\"top\"\u003e\n\n### 2. Read-only enforced at the source\n\nStage 1 of `schemabrain init` opens the source with `default_transaction_read_only=on` and verifies the session honors it. A Postgres that won't enforce read-only is refused at activation, not at runtime.\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\" valign=\"top\"\u003e\n\n### 3. PII-aware refusal at the tool boundary\n\nAny `get_metric` touching a blocked PII category returns a `refused` envelope. The compiled SQL never runs; the refusal lands in `mcp_audit` as `status='refused'`, `refusal_reason='pii_blocked'`.\n\n```bash\nschemabrain serve --pii-block contact,health\n```\n\nTwelve categories from GDPR, CCPA/CPRA, HIPAA, PCI DSS, ISO 27018 — tagged per-column at index time.\n\n[PII classification →](docs/observability.md#pii-classification-alpha)\n\n\u003c/td\u003e\n\u003ctd width=\"50%\" valign=\"top\"\u003e\n\n### 4. Tamper-evident audit log\n\nEvery tool call under `schemabrain serve` writes one row to an append-only `mcp_audit` table with a per-row sha256 chain. Rewrite past rows and the chain breaks; `audit verify` catches it.\n\n```bash\nschemabrain audit verify   # exit 0 = chain clean\n```\n\n[Tamper-evident audit log →](docs/observability.md#audit-log-alpha)\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\nAnd one property that keeps those four portable:\n\n**5. Pluggable into any agent loop.** The same MCP stdio surface Claude Desktop sees is exposed to any host that speaks MCP — your own Anthropic, OpenAI, or LangGraph loop included. [`examples/anthropic_demo.py`](examples/anthropic_demo.py) is a 230-LOC drop-in that wires Claude Haiku 4.5 to `schemabrain serve` and prints exactly which tools the agent chose to call:\n\n```bash\nexport ANTHROPIC_API_KEY=sk-ant-...\npython examples/anthropic_demo.py \\\n    --url-env DATABASE_URL \\\n    --store-path ./schemabrain.db \\\n    --question \"Which tables describe customer orders?\"\n```\n\n~$0.005–0.02 per run on Haiku 4.5, bounded by `--max-turns`. ([Anthropic SDK walkthrough](docs/setup.md#path-2--anthropic-sdk-demo-no-claude-desktop-required))\n\n---\n\n## Sample session\n\nReal Claude Desktop session against the bundled e-commerce fixture (7 tables, 30 columns, indexed for ~$0.01):\n\n\u003e **You:** Using Schema Brain, write me a SQL query to compute each customer's total spend by product category.\n\u003e\n\u003e **Claude:** *(calls `describe_table` on users, products, orders, order_items, product_categories — in parallel)*\n\u003e\n\u003e Here's the query. Schema is fully verified via Schema Brain.\n\u003e\n\u003e ```sql\n\u003e SELECT u.id AS customer_id, u.full_name, c.name AS category_name,\n\u003e        SUM(oi.quantity * oi.unit_price_cents) / 100.0 AS total_spend\n\u003e FROM   public.users u\n\u003e JOIN   public.orders o              ON o.user_id     = u.id\n\u003e JOIN   public.order_items oi        ON oi.order_id   = o.id\n\u003e JOIN   public.products p            ON p.id          = oi.product_id\n\u003e JOIN   public.product_categories pc ON pc.product_id = p.id\n\u003e JOIN   public.categories c          ON c.id          = pc.category_id\n\u003e GROUP BY u.id, u.full_name, c.name;\n\u003e ```\n\u003e\n\u003e Things you should know:\n\u003e - **Facts (from the schema):** Prices live on `order_items.unit_price_cents`, not `orders`. `product_categories` is a many-to-many composite-PK join table.\n\u003e - **Assumptions:** No status filter applied — `status` is free TEXT with default `'pending'`. `categories.parent_id` exists (nested categories) but I'm grouping by leaf — say if you want a recursive CTE for roll-up.\n\u003e - **Caveat:** A product in N categories has its spend counted N times (per category). Per-customer cross-category sums will exceed actual spend if products are multi-category in your data.\n\nThe caveats are the differentiator. None of them — M:N double-counting, recursive-CTE awareness, free-text-status flag — is hardcoded; they fall out of letting Claude reason over the indexed descriptions. Most LLM-over-database tools confidently invent a `payments` table or shoehorn the answer into `orders.total_cents`. Schema Brain doesn't.\n\n**Cost.** ~$0.0003/column with Claude Haiku 4.5. The bundled 7-table fixture indexes for **~$0.01 in ~40s**. The Pagila DVD-rental sample (87 columns after partition deduplication) indexes for **$0.0299 in 105s**. Re-indexing an unchanged schema is **$0** — content-addressable fingerprinting skips the LLM call entirely.\n\nTo verify Claude's SQL is mechanically correct (and that flagged caveats are the actual data behavior), see [Validating SQL Claude generates](docs/setup.md#validating-sql-claude-generates).\n\n---\n\n## Where it's going\n\nSchema Brain is being built as the **SQL-boundary safety layer for AI agents** — the layer that parses what your agent is about to ask the database and refuses (or rewrites) before it runs.\n\nThat layer needs a semantic substrate underneath it. You can't refuse \"this query touches PII\" without knowing which columns are PII. You can't rewrite \"join through this junction\" without canonical-join definitions. You can't validate a metric without knowing its grain.\n\nSo the engineering order is **schema intelligence → semantic substrate → safety primitives.** The first two are shipped (v0.5 + v1); the third — `validate_query` for agent-emitted SQL and `execute` with hard caps — is the next major milestone. Today the product gives you PII-aware refusal at the `get_metric` boundary plus tamper-evident audit, both running against parameterized SQL the agent never sees. If you need parse-before-execute over arbitrary agent-emitted SQL, track the roadmap.\n\n---\n\n## Roadmap\n\n\u003e The `v0.5` / `v1` / `v2` / `v3` labels are **roadmap milestone names**, not package versions. The package follows strict semver — `1.0.0` is reserved for an API that's been battle-tested by external users without a forced break. See [ADR-0003](docs/adr/0003-versioning-policy.md).\n\n**v0.5 — schema intelligence (shipped):**\n- Agent-UX charter v1.0 retrofit on existing tools + CI enforcement ✓\n- Dev-UX foundations: rich progress UI, guided errors, `--dry-run` ✓\n- Query log mining via `pg_stat_statements` (`schemabrain mine-queries`) ✓\n- 5 physical-schema MCP tools including `get_example_queries` ✓\n\n**v1 — semantic substrate (shipped):**\n- Entities, metrics, canonical joins as first-class persisted definitions ✓\n- LLM-suggested entity / metric / join definitions from FK graph + column descriptions ✓\n- 5 semantic-layer MCP tools (`find_relevant_entities`, `list_entities`, `describe_entity`, `resolve_join`, `get_metric`) ✓\n- Composite-expression measures — `SUM(unit_price * quantity)` over the same anchor table ✓\n- Multi-hop canonical-join chains — BFS over the join graph with `via=` disambiguation ✓\n- Drift detection (`schemabrain check`) ✓\n- PII-aware refusal at the `get_metric` boundary ✓\n- Tamper-evident audit log with sha256 chain ✓\n\n**v1.x — engine breadth (in progress):**\n- One additional engine: Snowflake / BigQuery / MySQL\n- BIRD Mini-Dev automated eval harness\n- Pre-built multi-platform Docker image on a public registry\n\n**v2 — SQL-boundary safety wedge:**\n- `validate_query` — agent-emitted SQL parsed and judged against policy before execution\n- `execute` with hard caps — read-only role enforced at the database layer, statement timeouts, row caps, per-call cost guards\n- Sub-query refusal with recovery — parse the SQL, identify the unsafe fragment, refuse just that fragment with a suggested rewrite\n\n**v3 — multi-engine + control plane (commercial, gated on hosted demand):**\n- Remaining engines (BigQuery / Snowflake / Redshift breadth)\n- Learning loop from telemetry and reformulation patterns\n- Hosted control plane with fleet-wide adversarial-signature aggregation\n\n---\n\n## Troubleshooting\n\nThe five most common first-run failures. Full troubleshooter in [`docs/setup.md`](docs/setup.md#troubleshooting).\n\n- **`pip install schemabrain` gave me an older version.** Check `schemabrain --version`. If it's not 0.3.0 your pip cache is stale — run `pip install --upgrade schemabrain`.\n- **`init` reports `source unreachable`.** Postgres may not be ready on first run — wait a few seconds and re-run. For your own database, verify host, port, and credentials. Connection URLs in any form are accepted (`postgresql://`, `postgres://`, `postgresql+psycopg://`).\n- **The first `init` or `schemabrain index` hangs for ~60 seconds.** Normal. The first index downloads the ONNX embedding model (~67 MB) and makes one LLM call per column. Subsequent runs are fast.\n- **`init` fails at stage 6 \"wire host\".** Claude Desktop must be installed first — Schema Brain writes into its config file, which doesn't exist until Claude Desktop has launched at least once.\n- **Claude Desktop doesn't show Schema Brain after restart.** Cmd+Q is required (close-window doesn't trigger a re-read of MCP config). Run `schemabrain doctor` to verify the config landed. If `doctor` says everything's good but Claude Desktop still doesn't see the tool, check `~/Library/Logs/Claude/mcp*.log`.\n\n---\n\n## Documentation\n\n| Doc | What's inside |\n|---|---|\n| [`docs/setup.md`](docs/setup.md) | Activation wizard, Claude Desktop / Code / Cursor wiring, Anthropic SDK demo, troubleshooting, validating Claude's SQL |\n| [`docs/semantic-layer.md`](docs/semantic-layer.md) | Building entities, metrics (incl. composite expressions), canonical joins (incl. multi-hop), dbt import |\n| [`docs/operations.md`](docs/operations.md) | `inspect`, `check` (drift), `index --dry-run`, Docker compose |\n| [`docs/observability.md`](docs/observability.md) | `tail`, audit log, OTel export, PII classification |\n| [`docs/mcp-tools.md`](docs/mcp-tools.md) | Full reference for all 12 MCP tools |\n| [`docs/architecture.md`](docs/architecture.md) | Pipeline, retrieval contract, cache logic, cost model, eval |\n| [`docs/landscape.md`](docs/landscape.md) | Comparison vs Vanna / Atlan / dbt-mcp / WrenAI; \"is this a semantic layer?\" |\n| [`docs/threat-model.md`](docs/threat-model.md) | Security model + boundaries |\n| [`docs/adr/`](docs/adr/) | Architecture decision records (audit/PII taxonomy, store protocol, versioning policy, observability bus) |\n| [`examples/`](examples/) | Copy-paste-ready MCP configs, headless agent loop, end-to-end ecommerce walkthrough |\n\n---\n\n## FAQ\n\n**Does my data leave my machine?**\nOnly LLM-enriched column descriptions and the redacted sample values that feed them. Three regex passes (email, US SSN, credit-card-shaped digit runs) run on every sample before it leaves the profiler module — see [`schemabrain/profiler/stats.py`](schemabrain/profiler/stats.py). The Anthropic API call sends column metadata + redacted samples + sibling-column context — no raw rows. Embeddings are generated locally via `fastembed` (BAAI/bge-small-en-v1.5, ONNX, ~67 MB).\n\n**What databases work today?**\nPostgres 16+ (primary target) and SQLite (for development and demos). Adding Snowflake / BigQuery / MySQL is mostly a new `DataSource` implementation plus a profiler tweak — on the v1.x roadmap.\n\n**Why MCP and not a REST API?**\nThe consumer is an agent, not a service. MCP standardizes tool registration, schema description, and request/response transport. Agents discover Schema Brain natively and get its tool surface — no API wrapper, no SDK to maintain per language.\n\nMore questions answered in [`docs/landscape.md`](docs/landscape.md) (is this a semantic layer like Cube?) and [`docs/setup.md`](docs/setup.md#troubleshooting) (why local embeddings, more troubleshooting).\n\n---\n\n## Contributors\n\n\u003ca href=\"https://github.com/Arun-kc/schemabrain/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=Arun-kc/schemabrain\" alt=\"Contributors to schemabrain\" /\u003e\n\u003c/a\u003e\n\n---\n\n## Contributing \u0026 License\n\nPRs welcome. The bar is high — see [`CONTRIBUTING.md`](CONTRIBUTING.md) for the test-first / 99%-coverage / conventional-commits / architecture-invariants checklist. CI enforces all of it.\n\nBugs and feature requests use the structured templates in `.github/ISSUE_TEMPLATE/`. Issues without a reproduction (bugs) or a clear underlying problem (features) get closed with a request to re-open with the right info.\n\n[MIT](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farun-kc%2Fschemabrain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farun-kc%2Fschemabrain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farun-kc%2Fschemabrain/lists"}