Skip to content
shamiksaharcciit-ossPublic

About

Vanna answers questions with your database. querygate makes sure a human said yes first — and can prove it

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

querygate

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)
  1. Clarify before generating — catches ambiguous intent ("recent" — by which date?).
  2. Approve before executing — a human sees the SQL before it touches the database. Mandatory by default; relaxable only by explicit config.

What ships in the box

  • 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, AuditSink protocols. 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.

Status

0.1.0.dev — scaffold. See the roadmap in docs/charter.md.

License

Apache-2.0

About

Vanna answers questions with your database. querygate makes sure a human said yes first — and can prove it

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages