Logo de mnemiq

mnemiq

Organisation
agenticfabriq

Open-source text-to-SQL engine you tune and measure on your own database

Éditeuragenticfabriq
Dépôtmnemiq
LanguePython
Forks
8
Étoiles
43
Outils disponibles
0
Type de transportstdio
Catégories
LicenceApache-2.0
Liens
  • Connectez des outils à vos workflows IA

    mnemiq propose des fonctionnalités MCP utilisables par les clients et agents IA compatibles.

  • 0 outils disponibles

    Parcourez les actions invocables ci-dessous, avec leurs noms et descriptions lorsque le serveur les fournit.

  • Configuration prête à copier

    Utilisez les exemples de configuration pour configurer ce serveur dans votre client MCP préféré.

  • Indicateurs de popularité open source

    43 étoiles et 8 forks sur le dépôt associé.

mnemiq

Text-to-SQL you can tune to your database. /NEM-ik/ — the "m" is silent, as in mnemonic.

An open-source engine that answers natural-language questions over your database, built so that every stage between the question and the SQL is a setting you can read, change, and measure.

The mnemiq workbench answering two questions and declining a third. Each answer shows the SQL
that produced it, the tables it read, and how many candidate queries agreed. The declined question
asks for ticket revenue; the engine states that the tables hold concert years and stadium capacity
but no ticket price, tickets sold, or revenue column.

Two answers and a refusal. The third question asks for revenue the database does not hold, and the engine says so — naming the columns it would have needed — instead of returning a number that looks right. That distinction is the whole design.

Read more · Product page · Launch article · Technical report (PDF, DOI 10.5281/zenodo.22806094) · Paper (PDF) · beacon — the grader and results tracker

Why mnemiq exists

Every text-to-SQL product has an accuracy number. Almost none of them were measured on a database that looks like yours.

A system can do well on a benchmark and then struggle on your warehouse because the schema is larger, the naming is different, the business definitions live in people's heads, or the configuration that suited the benchmark simply doesn't suit your data. When it underperforms, a closed system gives you no way to find out why, and nothing to change.

So the question worth asking isn't how accurate is it. It's:

How well will this work on my database — and what can I change if it doesn't?

mnemiq is built to make both halves answerable. It is Apache-2.0, runs inside your own environment on models you choose, and exposes the major parts of the pipeline as settings rather than internals. No accuracy number applies to your database until you have run it on your database; mnemiq is the engine and the evaluation harness for doing that.

How it works

mnemiq separates writing SQL from deciding to run it. A model proposes a query. A deterministic layer then rules on it before anything touches the database. The query has to be read-only, may only reference objects the caller is allowed to see, has to compile in the source's own SQL dialect, and has to survive an EXPLAIN. Fail any of those and you get a refusal with a stated reason rather than a plausible number.

Two properties fall out of that ordering. Permissions apply before schema retrieval, so the model is never shown a table the caller may not see — naming it is useless rather than refused. And every answer carries a trace: the SQL that ran, the tables it touched, the enrichment version behind it.

The nine stages of a mnemiq answer: knowledge sources, enrichment, the semantic contract,
retrieval, generation, the decider, execution, verification, and the answer with its trace.
Deterministic stages run first and last; the model proposes only in the middle.

Read the diagram left to right, top to bottom. The stages in red are the ones that can stop an answer: the decider refuses or repairs, execution runs under policy, and verification can defer. The model appears once, at stage 05, and everything around it is deterministic.

The pipeline is settings, not internals

The parts people usually can't reach are the parts mnemiq puts in your hands:

  • Which model writes the SQL — hosted or local, one candidate or several.
  • How much schema context is retrieved, and how it is ranked.
  • How much semantic enrichment is built, and whether a human certifies it.
  • How aggressively the system refuses — the verifier and its threshold.
  • What the decider enforces, including row and column policy applied to the query tree rather than requested of the model.

Each of those is a dial with a cost on the other side, which is why they are dials and not defaults. More context is not free. More compute is not automatically better. The right setting depends on your data, and the point of the harness is that you can find out rather than guess.

The semantic layer has tiers

Before any question is asked, mnemiq can inspect the database and build context around the schema:

  • Tier 0 — tables and columns only.
  • Tier 1 — adds structural information: primary and foreign keys, profiling, value distributions.
  • Tier 2 — adds meaning an LLM proposes: table and column descriptions, grain, glossary terms, coded-value meanings.

Enrichment is a multiplier on meaning that isn't already in the schema. Where column names already say what they hold, richer cards add length without adding signal. Where three columns are all called revenue by three different teams, the meaning is in a person, not the schema — and that is exactly what a certified definition captures. For production use, definitions can be reviewed and certified by a named owner, and the operator's dictionary overrides everything the model proposed.

Codes are grounded or left bare, never guessed. E11 or NC-17 take their meaning from the data itself, from a standard code system (TTL/SKOS/OWL), or from a hand-written dictionary, with the source recorded. No evidence, no meaning. See docs/grounding.md.

Measure it on your own database

The evaluation harness is part of the engine, not a separate research project. It runs a question set against a configuration, grades results by the data returned rather than by string-matching the SQL, and reports right, refused, and wrong as three separate numbers — because a system can buy accuracy by answering less often, and a single figure hides that.

A useful first pass, on your data:

  • Take one meaningful slice of your schema, not the whole warehouse.
  • Write 20–30 questions people actually ask, and tag each one: answerable from column names, needs a definition, should be refused.
  • Run it with enrichment on and off, a local model and a hosted one, the verifier at two thresholds.
  • Read the result by tag. The tags are the diagnosis: if the definition-band questions fail while the schema-band questions pass, you have a glossary problem and documentation will pay for itself. If both already pass, you were about to spend a quarter on something worth very little.

The same harness runs the public benchmarks (BIRD mini-dev, Spider 1.0, Spider 2.0-lite) and the warehouse comparison scripts under scripts/, so the setup you use on your data is the setup the published numbers came from.

Grading itself lives in beacon, a separate Apache-2.0 repository: the grader that decides what counts as correct, and the tracker that holds every run behind the published figures. Keeping it out of the engine is deliberate — a system should not mark its own homework, and the same grader scores mnemiq, Snowflake Cortex Analyst and Databricks Genie in the comparison. Per-question results are published there, so a number in the launch article can be traced to the SQL and the rows that produced it.

Quickstart

Runs on a clean clone with no database of your own and no Docker. The seed step writes a small SQLite database plus its source manifest and access policy under demo/.

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  (~30 s on the demo's 4 tables)
uv run mnemiq build       # index it for retrieval          (~2 s)
uv run mnemiq ask "how many customers are there by country?" --roles analyst

uv sync pulls about 230 MB of dependencies on a first run — DuckDB, PyArrow and the OpenAI client are the bulk of it — so give it a minute on a normal connection. It is near-instant on any subsequent checkout, since uv caches wheels globally.

mnemiq enrich is the only slow step: it profiles every column and makes one LLM pass over the schema, so expect roughly 30 seconds for the demo's four tables and longer in proportion to your own. It prints nothing until each table completes — it is working, not hung. The result is cached, so you pay it once per schema rather than per question.

Two more worth trying, because they show the parts that aren't the model:

uv run mnemiq ask "how many enterprise customers are there?" --roles analyst
uv run mnemiq ask "what was our total revenue last quarter?"   --roles analyst

The first joins through a lookup table to resolve a coded column — segment_cd holds A/B/C and nothing in the name says "enterprise". The second is refused: the demo schema has no price or revenue column, and the engine says so instead of returning a number.

Access is fail-closed. A role is required — pass --roles analyst, or export MNEMIQ_ROLES=analyst alongside the other settings above. Without a role the engine grants nothing and defers, which is the correct behaviour and the first thing people mistake for a bug. No policy, no grants, no snapshot — no data.

Which LLM endpoints work

Any OpenAI-compatible /v1 endpoint. mnemiq talks to MNEMIQ_LLM_BASE_URL through the standard OpenAI client, so vLLM, Ollama, llama.cpp's server, LM Studio, vendor gateways and the hosted APIs all work — set the base URL, a key (any non-empty string for local servers that ignore it) and a model name. Nothing about the engine assumes a hosted provider, which is what "runs inside your perimeter" means in practice: point it at a local server and no schema, no question and no row ever leaves your network. Embeddings follow the same setting, or their own via MNEMIQ_EMBED_*.

Use it from a browser (workbench)

cd workbench && pnpm install && pnpm build
uv run mnemiq serve --http     # http://127.0.0.1:8080

One process serves both the workbench and the HTTP API — POST /v1/ask (JSON), POST /v1/chat (SSE, AG-UI event vocabulary), GET /v1/schema. Every answer shows the SQL that produced it and the tables it read; a question the data cannot support comes back as a stated reason, not a guess — that is the interface pictured at the top of this file. See workbench/README.md.

Use it from an AI agent (MCP)

uv run mnemiq serve exposes two read-only, access-scoped tools over stdio — db_read(question) (answer + SQL + trace) and get_schema(). Point any MCP client at it:

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

MCP initialization and tool discovery work before database setup is complete. The runtime is loaded on the first tool call; configure the source and LLM, then run mnemiq enrich and mnemiq build before querying. Missing setup is returned as a tool error while the MCP connection stays open. With a uv sync installation, launch from the repository using uv run mnemiq serve so the command uses the project's environment.

Sources

Postgres, SQLite, DuckDB, Oracle, Snowflake and Databricks, with DuckDB as the universal executor. The semantic model (mnemiq-contract) is open, and dbt-semantic-interfaces import/export ships with it.

Deploying against Oracle

The Oracle read plane refuses writes, but that refusal is partly a property of your deployment rather than of the engine: a SELECT can reach an AUTONOMOUS_TRANSACTION function through a view, and restricting the caller does not close it, because a view resolves its references with the view owner's rights. Pointing the read plane at a database that is open read-only does close it, measured, and mnemiq reports at boot whether you are in that deployment or resting on the engine's gate alone. See docs/oracle-deployment.md before connecting a production source.

What's commercial

The engine is Apache-2.0 and always will be — enrichment included. Nothing here is a time-limited or feature-gated build, and no capability is stubbed out pending a licence key.

Specifically open, because these are the parts people assume are held back: the enrichment pipeline including the LLM pass and coded-value grounding (src/mnemiq/enrichment/), the verifier and its judge (src/mnemiq/verify/), the access checks (src/mnemiq/authz/, src/mnemiq/sql/), the result grader (src/mnemiq/eval/grade.py), and the benchmark harness that produced the published numbers (scripts/).

Commercial are two things that sit around the engine rather than inside it: Verity, a managed grading and drift service, and the Agentic Fabriq control plane — identity, vaulted credentials, per-group grants and audit across many sources. Both talk to the engine through the open contract (mnemiq-contract), so a self-hosted deployment is not a degraded one; it is the same read path without a managed service in front of it.

Read the code rather than taking this on trust — that is the point of shipping it.

Known weaknesses

Filed as open issues rather than left to be discovered, because they are readable in the source either way. Contributions and arguments welcome.

All four this list opened with are now closed. The default mode is judged (#3) — that issue read Settings.verify, which governs the eval door and not Runtime.ask, and concluded a fresh install ran unverified. It did not: the product path resolves each mode's own verify level, and the deterministic sanity layer has always run in all three. What was missing was the LLM judge, which now runs in thinking as well as deep. An unreachable judge withholds the answer instead of passing it (#2), lineage stopped reporting unconfirmed-function-identity on ordinary queries (#5), and the CLI honours MNEMIQ_ROLES like every other surface (#4).

Related enterprise implementation

Enterprise Data Agent Governance is an independently maintained, enterprise-focused governance framework built on Mnemiq. It explores identity, authorization, safe query handling, verification, refusal behavior, evaluation, and auditability for teams deploying governed AI data agents.

Explore Enterprise Data Agent Governance →

Contributing

Issues and pull requests are welcome. Fork, branch, and open a PR against main.

uv sync --extra dev --extra ontology --extra oracle
uv run pytest -m "not integration and not live_llm"
git config core.hooksPath .githooks     # optional: runs the same checks before each commit

What repo-guard checks, and what a green tick means. It blocks credential shapes and hardcoded /Users/<name> machine paths — both run in CI on every push and pull request, and both are what your PR has to pass. It also blocks a private list of proprietary names, and that one runs only on the maintainer's machine: enforcing it in CI would publish the list it protects, since a flagged word in a public log tells every reader that word is on the blocklist. Your clone has no such list and does not need one — you cannot leak names you have never seen.

The hook reads that setting from .env, so copy .env.example before installing it: the copy ships REPO_GUARD_NAME_PATTERNS=off, which is how you say this machine holds no list, and the hook then runs the two checks that matter to you. With no .env at all it stops and asks, rather than guess whether a missing list means "contributor" or "maintainer whose config broke".

Status

v0.1: the full read path — enrichment, retrieval, the decider, execution, trace — evaluated on ACME, BIRD mini-dev, Spider 1.0 and Spider 2.0-lite, with a local-model program alongside. Tiered modes (instant / thinking / deep), row- and column-level security, the governed write path, cross-source federation and multi-replica deployment are built and wired behind the same interfaces. Next: additional source adapters, the self-maintaining loops, and hardening the write plane against a production source.

Utilisez le serveur MCP mnemiq avec plusieurs modèles IA

TypingMind connecte les outils MCP au niveau de l’espace de travail. Une fois mnemiq connecté, vous pouvez donc l’utiliser avec différents modèles IA dans TypingMind sans avoir à le configurer séparément pour chaque modèle. Cette intégration MCP s’exécute localement sur votre appareil via le connecteur MCP de TypingMind.

Guide de configuration du connecteur local

Choisissez cette méthode si le serveur MCP doit accéder à des fichiers locaux, à des applications ou à des ressources privées sur votre ordinateur.

1

Ouvrir les paramètres MCP

Dans TypingMind, accédez à « Paramètres », puis à « Paramètres avancés » et à « Model Context Protocol », et choisissez « Configurer connecteur ».

  1. Ouvrez TypingMind dans votre navigateur.
  2. Cliquez sur l’icône Paramètres.
  3. Accédez aux paramètres avancés.
  4. Ouvrez la section Model Context Protocol.
  5. Cliquez sur « Configurer connecteur » et choisissez « Cet appareil ».
Écran de configuration du connecteur MCP de TypingMind avec l’option « Cet appareil » sélectionnée
2

Exécuter la commande du connecteur

Choisissez « Cet appareil », copiez la commande depuis TypingMind et exécutez-la dans Terminal. Laissez le processus en cours d’exécution pendant que vous utilisez MCP.

  1. Copiez la commande de configuration affichée par TypingMind.
  2. Ouvrez Terminal sur macOS ou Windows Terminal sur Windows.
  3. Collez et exécutez la commande.
  4. Autorisez l’installation du paquet si Terminal vous demande de confirmer.
  5. Gardez la fenêtre de Terminal ouverte et le processus en cours d’exécution pendant que vous utilisez les outils MCP.
3

Ajoutez mnemiq en tant que serveur

Lorsque l’état du connecteur affiche « Prêt », cliquez sur « Éditer serveurs » et collez la configuration du serveur MCP.

  1. Attendez que l’état du connecteur affiche « Prêt ».
  2. Cliquez sur « Éditer serveurs ».
  3. Collez la configuration du serveur MCP mnemiq.
  4. Enregistrez la liste des serveurs.
  5. Actualisez pour vérifier que le connecteur est toujours prêt.
Paramètres MCP de TypingMind affichant un serveur actif et le bouton « Éditer serveurs »
{
  "mcpServers": {
    "mnemiq": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Utiliser la connexion avec différents modèles

Enregistrez la liste des serveurs, ouvrez « Plugins », activez les outils MCP de mnemiq, puis sélectionnez un modèle IA compatible dans TypingMind et utilisez les outils dans une discussion ou attribuez-les à un agent IA.

  1. Ouvrez la page Plugins dans TypingMind.
  2. Activez les outils MCP de mnemiq.
  3. Démarrez une discussion et choisissez le modèle IA que vous souhaitez utiliser.
  4. Utilisez les outils MCP dans le chat ou attribuez-les à un agent IA.
  5. Passez à un autre modèle IA selon vos besoins sans rétablir la connexion MCP.
Discussion TypingMind utilisant des outils MCP activés avec un modèle d’IA sélectionné
Pouvez-vous utiliser mnemiq pour m’aider dans cette tâche ?
mnemiq
Bien sûr. J’ai tout lu.
Voici ce que j’ai trouvé avec mnemiq.

Foire aux questions

À quoi sert le serveur MCP mnemiq ?

mnemiq est un serveur MCP qui permet aux applications IA compatibles d’accéder à des outils et à des informations contextuelles externes. Dans TypingMind, il vous suffit d’ajouter ce serveur MCP une seule fois pour rendre ses outils disponibles dans votre espace de travail IA.

Puis-je utiliser le serveur MCP mnemiq avec plusieurs modèles IA dans TypingMind ?

Oui. TypingMind connecte les outils MCP au niveau de l’espace de travail. Vous pouvez donc utiliser mnemiq avec différents modèles IA comme Claude, ChatGPT, Gemini ou d’autres modèles configurés dans TypingMind, sans avoir à configurer le serveur MCP séparément pour chaque modèle.

Pourquoi utiliser le connecteur MCP mnemiq avec TypingMind ?

TypingMind est l’une des meilleures interfaces de chat avec les LLM, car elle réunit plusieurs modèles IA, prompts, plugins, agents IA, clés API et outils MCP dans un seul espace de travail. Une fois mnemiq connecté, vous pouvez utiliser ses outils MCP avec vos modèles préférés tout en gardant vos discussions bien organisées dans TypingMind.

Comment connecter le serveur MCP mnemiq à TypingMind ?

mnemiq fonctionne via le connecteur MCP local de TypingMind. C’est l’option idéale lorsque le serveur MCP doit accéder à des fichiers locaux, des applications de bureau, des outils en ligne de commande ou des ressources privées sur votre ordinateur.

Quels outils le serveur MCP mnemiq propose-t-il dans TypingMind ?

mnemiq propose des fonctionnalités MCP que vous pouvez activer depuis la page Plugins de TypingMind et utiliser dans les discussions ou attribuer à des agents IA.

Dois-je partager mes clés API avec TypingMind pour utiliser le serveur MCP mnemiq ?

Non. TypingMind privilégie le fonctionnement local et vous permet de garder le contrôle de vos fournisseurs de modèles, clés API, prompts et paramètres MCP. Si mnemiq nécessite une authentification, ajoutez les en-têtes, les paramètres OAuth ou la configuration locale requis pour ce serveur MCP lors de la création de la connexion.

Serveurs MCP similaires

Tout voir

Créez votre propre espace IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇