Vanna answers questions with your database. querygate makes sure a human said yes first — and can prove it.
The moat: airgapped · evaluated · audited · human-gated.
Text-to-SQL engines (Vanna, WrenAI, DB-GPT) generate SQL well. None of them answer the questions an enterprise deployment actually asks:
- Who approved this query before it ran?
- What did the model try before it got it right?
- How do we pause for a human — and resume cleanly when they answer an hour later?
- Can this run fully airgapped?
querygate is that missing layer. It is not another engine — it orchestrates one (Vanna by default, swappable by config) inside a checkpointed LangGraph flow with two human gates:
rewrite → ambiguity check ⟲ → schema retrieval → SQL generation → validation ⟲
(clarify interrupt) (retry loop)
→ human approval → execute
(approve interrupt)
- Clarify before generating — catches ambiguous intent ("recent" — by which date?).
- Approve before executing — a human sees the SQL before it touches the database. Mandatory by default; relaxable only by explicit config.
- The graph (
core/graph.py) — checkpointed, interrupt-driven, resumable across slow human responses. The retry loop is invisible to the UI; only real interrupts surface. - Pluggable everything (
core/deps.py) —SchemaProvider,GenerationModel,DBConnector,AuditSinkprotocols. A deployment is one YAML file, zero code. - Audit trail — every generation attempt (not just the final one), every clarification, every approval decision, as JSONL. Approved pairs are training-ready for a future self-learning loop by design.
- Safety preflight — refuses to start against a database role without
default_transaction_read_only=on,statement_timeout, and an idle timeout. Row limits enforced on execution. - Offline eval harness — frozen gold sets, execution-accuracy scoring (result-set comparison), optional LLM-jury rubric tier that supplements — never replaces — it.
- Airgap-first — local models via Ollama, pgvector on your existing Postgres,
no runtime downloads, no external calls. See
docs/airgap-deployment.md.
0.1.0.dev — scaffold. See the roadmap in docs/charter.md.
Apache-2.0