Open source · Apache-2.0

mnemiq: text-to-SQL you can tune to your database.

mnemiq is an open-source text-to-SQL engine for enterprise data agents. A language model proposes SQL; deterministic checks on shape, access, dialect and query plan decide whether it runs. You configure it and measure it on your own database, because text-to-SQL accuracy does not transfer across databases.

/NEM-ik/ — the “m” is silent, as in mnemonic

How it works

The model proposes. Deterministic code decides.

mnemiq separates writing SQL from deciding to run it. The model appears once, at stage 05. Everything before and after it is deterministic, and every answer carries a trace. Permissions apply before schema retrieval, so the model is never shown a table the caller may not see.

  1. 01

    Knowledge sources

    The database, plus any dictionary, glossary or code system you hand it.

  2. 02

    Enrichment

    Profiles every column and builds descriptions, grain and coded-value meanings. Cached per schema.

  3. 03

    Semantic contract

    Definitions a named owner can certify. The operator’s dictionary overrides anything the model proposed.

  4. 04

    Retrieval

    Only the schema the caller may see is retrieved, so a forbidden table is never named.

  5. 05 · the only model stage

    Generation

    A language model proposes SQL. One candidate or several, hosted or local.

  6. 06

    Decider

    Read-only? Allowed objects only? Compiles in the source dialect? Survives EXPLAIN? Fail any, get a refusal with a reason.

  7. 07

    Execution

    Runs under row and column policy applied to the query tree, not requested of the model.

  8. 08

    Verification

    A judge can defer an answer it cannot support. Threshold is a setting.

  9. 09

    Answer with trace

    The SQL that ran, the tables it touched, the enrichment version behind it.

The parts people usually cannot reach are settings here: which model writes the SQL, how much schema context is retrieved, how much semantic enrichment is built and whether a human certifies it, how aggressively the system refuses, and what the decider enforces. Each is a dial with a cost on the other side, which is why they are dials and not defaults.

Sources

Six databases. One executor.

DuckDB is the universal executor. The semantic model is open, and dbt-semantic-interfaces import and export ship with it. Any OpenAI-compatible endpoint serves the model, so a local server keeps every schema, question and row inside your network.

  • PostgreSQL
  • SQLite
  • DuckDB
  • Oracle
  • Snowflake
  • Databricks
Published comparison · September 2026

The numbers, with the rule beside them.

Each product ran on its own platform with its own semantic tooling, on the same questions, with the same external grader and three runs per cell where possible. Every cell reads exact match / got-the-facts: exact match requires the same rows and columns as the reference; got-the-facts counts an answer that contains the reference result. The two rules can rank systems in different orders, which is why both are shown.

SystemBIRD mini-devSpider 1.0Spider 2.0-lite
mnemiq
tier 2 enrichment, hosted frontier model
52.2 / 64.968.4 / 79.536.6 / 59.8
Databricks Genie
37.4 / 53.163.6 / 77.527.3 / 45.5
Snowflake Cortex Analyst
33.3 / 48.956.4 / 77.117.4 / 24.2

These are first-party results published by the developer of one of the systems compared. The vendor models are undisclosed, and none of these benchmarks tells you what will happen on your warehouse. The grader, the tracker and the per-question results are open in Beacon; the methodology is in the launch article.

Quickstart

Runs on a clean clone.

No database of your own and no Docker needed: the seed step writes a small SQLite database plus its source manifest and access policy. Access is fail-closed, so a role is required. Without one the engine grants nothing and defers.

uv sync
uv run python scripts/seed_demo.py

export MNEMIQ_LLM_BASE_URL=...  MNEMIQ_LLM_API_KEY=...  MNEMIQ_LLM_MODEL=...
export MNEMIQ_SOURCES_PATH=demo/sources.json
export MNEMIQ_AUTHZ_PATH=demo/authz.json
export MNEMIQ_STORE_PATH=demo/store.duckdb

uv run mnemiq enrich      # profile + describe the schema
uv run mnemiq build       # index it for retrieval
uv run mnemiq ask "how many customers are there by country?" --roles analyst
From an AI agent · MCP

Two read-only tools.

mnemiq serve exposes db_read(question), which returns the answer with its SQL and trace, and get_schema(). Both are access-scoped. Point any MCP client at it:

{ "mcpServers": { "mnemiq": { "command": "mnemiq", "args": ["serve"] } } }

One process also serves a workbench and an HTTP API (POST /v1/ask, POST /v1/chat, GET /v1/schema). Every answer shows the SQL that produced it and the tables it read.

Questions

Common questions about mnemiq.

mnemiq is an open-source (Apache-2.0) text-to-SQL engine for enterprise data agents. A language model proposes SQL; deterministic checks on shape, access, dialect and query plan decide whether it runs. It is built to be configured and measured on your own database.

Canonical URL: https://www.agenticfabriq.com/mnemiq · Maintained by Agentic Fabriq