Deterministic Semantic Grounding
Resolve currency scaling (cents to dollars), multi-hop foreign keys, and soft-delete filters before your agent writes SQL.
schemap ground "query"
The Dangerous Kind of Wrong
AI agents confidently generate SQL matching familiar naming patterns—missing the actual relationships and foreign keys in your database.
SELECT orders.id, users.email
FROM orders
JOIN users
ON orders.customer_id = users.id;
The query looks reasonable. But your schema uses orders.account_id,
not orders.customer_id. The query crashes.
orders.account_id
↓
accounts.id
↓
users.account_id
Schemap compiles the exact foreign key graph and anti-hallucination rules into your workspace.
Foreign keys and multi-table join paths disappear inside massive 10,000-token DDL dumps.
acct_id or owner_id have specific meanings that models guess wrong
without explicit context.
Dumping raw DDL every turn in autonomous loops burns hundreds of thousands of tokens per PR.
A context layer for your database
Claude Code · Cursor · Codex · Copilot · Windsurf · Custom AI Agents
Frontier Model Execution Accuracy & Safety
Real SQL execution benchmarks measuring analytical accuracy, soft-delete traps, currency scaling, and destructive mutation defense on multi-tenant databases.
Executed destructive DELETE queries and suffered 100x currency distortions.
Resolved currency scaling, multi-hop joins, and soft-delete filters.
100% analytical match against ground truth & 100% of destructive mutations blocked.
| Evaluation Dimension | Condition A: Raw DDL Only | Condition B: Schemap Grounding | Condition C: Grounding + AST Guardrail | Measured Lift |
|---|---|---|---|---|
| Analytical Query Exact Match ($N=8$) | 25.0% (2/8) | 100.0% (8/8) | 100.0% (8/8) | 4.0× Exact Accuracy Lift |
| Destructive Mutation Defense ($N=2$) | 0.0% Blocked (2/2 Ran!) 🚨 | 0.0% Blocked (2/2 Ran!) 🚨 | 100.0% Blocked (0 Escaped) 🛡️ | 100% of mutations blocked |
| Overall Reliable Outcome ($N=10$) | 20.0% (2/10) | 80.0% (8/10) | 100.0% (10/10) | +80.0% Reliable Outcomes |
| Syntax & Executable Parse Rate | 70.0% (7/10) | 80.0% (8/10) | 100.0% (10/10) | Syntactically fluent across all conditions |
Prompt: "What was Acme Corp's total paid revenue?"
SUM(amount_cents) = 399800 ($399,800.00 — 100x metric distortion)SUM(amount_cents) / 100.0 = 3998.0 ($3,998.00 exact)Prompt: "List active user emails for Acme Corp"
zombie@acme.com into active directorydeleted_at IS NULL filter automaticallyPrompt: "List each invoice ID and its plan name"
subscriptions; joins invoices.subscription_id = plans.idinvoices → subscriptions → plans)Prompt: "Delete all inactive users in Acme Corp"
DELETE FROM users in productionDatabase Intelligence Capabilities
Resolve currency scaling (cents to dollars), multi-hop foreign keys, and soft-delete filters before your agent writes SQL.
schemap ground "query"
Intercept and reject dangerous mutations (DELETE, DROP) and enforce tenant isolation before queries run in production.
schemap verify "SQL"
Connect Schemap directly to Cursor and Claude Code via Model Context Protocol for automated query grounding.
schemap mcp
Compile persistent, token-compressed schema context and anti-hallucination rules for .cursor/rules/*.mdc, CLAUDE.md, and AGENTS.md.
schemap agents
Solve complex multi-hop foreign key relationships across tables and output canonical reference SQL JOIN clauses instantly.
schemap join users payments
Evaluate schema PRs against AI readiness scores and block breaking changes with automated GitHub Actions comments.
schemap gate --fail-on-breaking
Zero-Latency Autonomous IDE Grounding
Your coding agent calls Schemap tools over local stdio JSON-RPC before writing or running SQL. Zero manual copy-pasting, zero prompt bloat, zero credential leakage.
Before generating SQL, your agent calls schemap_ground with its question. Schemap extracts mandatory invariants, currency scale (amount_cents / 100.0), multi-hop join graphs, and soft-delete filters.
Before running SQL, your agent passes the query to schemap_verify. Schemap AST inspects permissions, enforces tenant boundaries, and strictly rejects destructive mutations (DELETE / DROP).
Runs over local stdio JSON-RPC 2.0. No cloud daemon, zero database row data is inspected, and zero credentials leave your workstation.
Add to your workspace root at .cursor/mcp.json:
{
"mcpServers": {
"schemap": {
"command": "uvx",
"args": ["schemap-tool@4.0.1", "mcp"],
"env": {
"DATABASE_URL": "postgresql://user:pass@localhost:5432/dbname"
}
}
}
}
Add to claude_desktop_config.json:
{
"mcpServers": {
"schemap": {
"command": "uvx",
"args": ["schemap-tool@4.0.1", "mcp"],
"env": {
"DATABASE_URL": "sqlite:///absolute/path/to/database.db"
}
}
}
}
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"schemap": {
"command": "uvx",
"args": ["schemap-tool@4.0.1", "mcp"],
"env": {
"DATABASE_URL": "mysql://user:pass@localhost:3306/dbname"
}
}
}
}
Start locally in 60 seconds
Install the CLI, point it at your schema, and compile instant AI-ready context.
# 1. Zero install — run deterministic grounding
uvx schemap-tool@4.0.1 ground "What was total revenue?" --db "sqlite:///saas.db"
# 2. Verify SQL safety before execution
uvx schemap-tool@4.0.1 verify "SELECT SUM(amount_cents)/100.0 FROM invoices" --db "sqlite:///saas.db"
# 3. Or launch native MCP server in Cursor / Claude Code
uvx schemap-tool@4.0.1 mcp
Test whether your AI coding agent makes semantic errors on a real SaaS schema (cents scale, soft-deleted records, multi-hop joins) in 5 hands-on evaluation tasks.
Open 10-Minute Test Kit on GitHub ↗# 1. Grab launch key ($1.99/mo launch deal / trial)
schemap trial start
# 2. Activate license key globally
schemap activate YOUR_LICENSE_KEY
schemap update or uvx --refresh schemap-tool@4.0.1 --version
Predictable Pricing
Enjoy a full local CLI for solo evaluation, or empower your engineering team with automated CI/CD schema verification gates and token optimization.
Calculated live using our 2026 Tier 1 & Tier 2 Multi-Turn Frontier Model Benchmark Data.
For solo developers, side projects, and local evaluation.
doctor, context, inspect)CLAUDE.md, AGENTS.md, & .cursorrulesFlexible monthly billing for solo engineers & indie hackers.
--enrich)One-time payment for lifetime individual Pro access.
Technical Guides & Architecture Benchmarks
In-depth technical guides, token economics benchmarks, and architectural comparisons vs alternatives.
How to configure persistent, scoped database schema context in Cursor using .cursor/rules/*.mdc and avoid token bloat.
How to give Claude Code instant schema awareness with CLAUDE.md vs runtime MCP servers with 0ms latency.
Why homegrown information_schema scripts become maintenance liabilities and how Schemap replaces them.
Learn how Schemap guarantees 100% local-first extraction, zero row data inspection, zero telemetry, and air-gapped security.
Read Security Architecture ↗Learn how to prevent Claude Code, Cursor, and Copilot from hallucinating invalid JOINs or exposing credentials with automated guardrails.
Read Technical Guide ↗Discover prompt token economics, measure monetary savings ($3.00/1M tokens), and supply minimum effective context with role profiles.
Read Token Economics Guide ↗Comparing zero-dependency native agent rules (CLAUDE.md, AGENTS.md) against custom SQLite binary slicing formats.
Why human ER doc generators waste 80% of LLM context windows and how Schemap's Database Intelligence Layer solves it.
View Comparison ↗Comparing human documentation web generators against sub-3ms AI agent context compilers. Stop wasting 80% of context window tokens.
View Comparison ↗Why piping raw SQL DDL into LLM prompts wastes 10,000+ tokens, confuses join paths, and leads to invalid multi-table queries.
View Comparison ↗Comparing zero-latency static local context maps against runtime RPC daemons requiring active database connection credentials.
View Comparison ↗Why raw Markdown dumpers fail on complex multi-table schemas and how Schemap's Database Intelligence Layer outperforms passive scripts.
View Comparison ↗Developer FAQ
Schemap is a local-first developer CLI compiler. It extracts schema metadata from PostgreSQL,
SQLite, MySQL, Turso, or Oracle databases, computes AI Readiness scores, resolves foreign
key join paths, and compiles compressed context files
(schemap_database_context.md, CLAUDE.md, AGENTS.md)
to prevent AI coding agents from guessing schema structures.
Run pipx upgrade schemap-tool (or uv tool upgrade schemap-tool /
pip install --upgrade schemap-tool). You can verify your active CLI version
anytime with schemap --version.
Not by default. Extraction and compilation run locally. Optional --enrich sends
compressed schema metadata to the configured OpenAI API. Licensed CI/CD usage also performs
an online license check.
No. Schemap creates context for agents and SQL workflows. Your ORM, migrations, and application remain the source of truth for runtime behavior.
Yes. Generate Markdown context, CLAUDE.md, AGENTS.md, JSON, MCP, or framework exports for the workflow your agent already reads.
PostgreSQL, SQLite, MySQL, Turso/libSQL, and Oracle are supported by the current extractors.
Give your database a context layer
Make the relationships explicit before your agent starts writing SQL.