Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sovereign Query Contract (SQC)

Ask your data anything — without giving it to the AI.

Every "chat with your data" product works by shipping your data to a model — or to a vector database in someone else's cloud. SQC inverts the arrows: the model only ever writes the question; your data stays on your node and answers it. The model never sees a record — not your data, and not even the answer.

This repository is the open contract + reference tooling for that pattern:

  • The contract — how a model is told your data's shape, the structured query it writes, and the cited answer a node returns. → SPEC.md
  • A reference client — pure glue, no engine: your question → your model writes the query → your node answers, cited. → client/
  • An MCP connector — so any MCP-capable agent (Claude, and others) can query a node natively. → mcp/

This repository contains no data engine — only the interface. Bring any compliant node behind it. Validiti ships a sealed reference node; the contract is open so anyone can implement one or connect to one.

The one idea

  1. Your model is handed the shape of your data — field names, never records.
  2. It writes a structured query.
  3. Your node runs the query and returns a cited answer — to you.
  4. The model never receives your data. Swap models freely; your data never moves.
  you ──question──▶ your model ──query──▶ your node ──answer──▶ you
                        ▲                     │
                        └──── shape only ─────┘        (records never cross to the model)

Why it exists

The wall on "AI over your data" is that a model can only reason over what fits in its context — so everyone retrieves a sample and hopes the answer was in it, and to do even that they hand the model the data. SQC removes both problems: the model needs only the shape to write a query, and the node reaches all of your data to answer it. You get the best model on earth as your interface and full sovereignty — which nobody else offers together.

Quickstart (Python)

from sovereign_query import SovereignQuery

# You bring the model. SQC never calls one for you — your key, your model, your choice.
def my_llm(prompt: str) -> str:
    ...  # return the model's reply (a JSON query)

sq = SovereignQuery(node_url="https://your-node.example", api_key="…")
answer = sq.ask("which supplier is dragging our margins?", llm=my_llm)
print(answer["answer"])          # the cited result — computed on the node
print(answer["sources"])         # every figure tied to a record

The client passes your model only the data's shape and your question. Read client/python/sovereign_query.py — it is short on purpose, so the sovereignty boundary is something you can verify, not just trust.

What's here

Path What
SPEC.md The Sovereign Query Contract, v0.1
schema/ JSON Schemas: the data shape, the query, the answer
client/ Reference clients (Python, JS) — glue only
mcp/ Tool definitions to expose a node to MCP agents
prompts/ The prompt that turns a question + shape into a query
examples/ A worked example you can run against a demo node

Where this is going

The same boundary — the model writes the question, your data answers it, nothing crosses — extends past a single query into memory. A node can remember every question asked and every cited answer returned, so an assistant built on SQC can recall what you concluded, and the records it rested on, for as long as you keep working — with that history on your node, never in a model's cloud.

That opens a door the cloud can't: assistants with persistent, sovereign, cited memory for the people and businesses whose data can't leave. If you build assistant experiences, the intent here is to make you more valuable, not to compete with you — you own the model, the personality, and the product; the node is the memory and the proof underneath. Any model. Your brand. The data never moves.

A direction, not a promise: it isn't part of v0.1. It's here so builders can see where the contract is headed — because sovereignty and memory belong together.

Status

Developer preview. The contract is v0.1 and may change before v1.0. Contributions of clients, adapters, and connectors are welcome — see CONTRIBUTING.md. Security posture and boundaries: SECURITY.md.

License

MIT for everything in this repository. (The interface is open; data engines behind it may be licensed however their authors choose.)

About

Ask your data anything — without giving it to the AI. The open contract + reference tooling for sovereign, model-agnostic queries.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages