Give Agents a Query Interface, Not a Knowledge Base
query-layer pattern over RAG or context stuffing maps directly to how system-bus functions should access structured data
Sean Grove, co-founder at Hasura, has been building toward a specific thesis: the default way people give LLMs access to data — RAG pipelines, context stuffing, vector similarity search — is the wrong abstraction. What agents actually need is a query interface with deterministic results, not a probabilistic knowledge layer that hallucinates facts buried in embeddings.
This is the idea behind PromptQL and Hasura DDN. Instead of asking the LLM to “know” your data, you give it a structured query mechanism. The LLM translates natural language intent into a query, the query executes deterministically against your actual data, and the results come back clean. The hallucination surface collapses. The LLM is now a compiler, not an oracle.
The architectural shift matters. RAG and context windows put the LLM in charge of remembering facts — which it does unreliably. A query layer keeps facts in the source of truth where they belong and lets the LLM do what it’s actually good at: understanding intent and generating structured output. This isn’t a subtle optimization, it’s a different model for how agents interact with data. Sean has been pushing this in the GraphQL community for years — the insight that a well-typed, self-describing API schema is inherently agent-friendly predates LLMs by a decade.
For systems like joelclaw, this maps to a real question: when a system-bus function needs data, should it embed that data in the prompt, or should it query it via a typed interface? The answer Sean’s work points toward is obvious once you’ve seen the failure mode of the former at scale.
Key Ideas
- LLMs as compilers, not knowledge stores — translate intent → structured query → reliable results, rather than hoping the model “remembers” your data correctly
- PromptQL — Hasura’s natural language query layer for LLMs, built on top of Hasura DDN’s federated data graph
- GraphQL schemas as agent APIs — strongly typed, self-describing, and introspectable; exactly what agents need to understand what data is available without hallucinating field names
- Determinism at the data access layer — queries either succeed or fail with an error, no in-between “confident-but-wrong” response that RAG frequently produces
- Separating the reasoning problem from the retrieval problem — LLMs are good at the former, terrible at the latter; the query layer is the seam between them
- Federation matters — Hasura DDN federates multiple data sources behind one query interface, which is exactly what agents need when the data lives across Redis, Postgres, APIs, etc.