Listicle6 min readยท

Top 5 Ways to Reduce AI Agent Hallucination Without Switching Models

Most teams reach for a bigger model the moment an agent starts making things up. It rarely helps.

Most teams reach for a bigger model the moment an agent starts making things up. It rarely helps. Hallucination is usually a retrieval and grounding problem, not a reasoning one, the agent answers confidently because nothing pulled the right facts into its context window. The fix lives in how your content is stored, queried, and governed, not in the model card. Here are five ways to cut hallucination without touching your model, ranked by how much reliability they buy you for the effort, and where Sanity Context fits as the grounding layer underneath.

Several of the patterns below rely on structured retrieval against a typed schema rather than free-text search. Sanity Context, Sanity's agent-facing product, exposes exactly that via Context MCP: GROQ queries, schema reads, and reference traversal without extra plumbing.

1. Ground answers in hybrid retrieval, not vector search alone

The single biggest lever is what your agent retrieves before it generates. Pure vector search finds things that are semantically close but misses exact matches, product SKUs, error codes, version numbers, that a keyword search would nail. Pure keyword search does the opposite. Hybrid retrieval blends both, and that blend is where most hallucination disappears, because the agent stops guessing when the right passage is sitting in its context. Sanity Context runs this natively inside the Content Lake: a single GROQ query can combine `text::semanticSimilarity()` for meaning with a BM25-style `match()` for exact terms, then reconcile the two with `score()` and `boost()`. There's no separate retrieval service to stand up, no two result sets to merge in application code. One query, one ranked result, one source of truth. That tight loop matters: the fewer hops between the agent and the content, the fewer places for relevance to degrade and for the model to fall back on its training priors.

2. Keep your embeddings as fresh as your content

An agent grounded in last week's index is an agent that hallucinates politely, it cites something, but the something is stale. In a typical bolt-on stack, content lives in one system and embeddings in another, so every edit kicks off a re-embedding job, a sync, and a window where the two disagree. That drift is invisible until a customer asks about a price you changed yesterday and the agent quotes the old one. With Sanity Context, dataset embeddings are tied to the content itself, so when an editor updates a document the embeddings propagate within minutes, there's no separate vector pipeline to babysit and no nightly batch to fall behind. The reliability win here is subtle but real: you remove an entire class of 'the answer was technically retrieved correctly, it was just out of date' failures. For teams whose content changes daily, pricing, policies, release notes, this closes the gap between what's true and what the agent can see.

3. Turn unstructured docs into agent-readable content

A lot of hallucination traces back to what never got indexed in the first place. The real answer lived in a PDF, a support database, or a marketing site that the retrieval layer couldn't read cleanly, so the agent improvised. Dumping raw documents into a vector store helps a little, but you inherit their messiness, broken tables, orphaned headings, no notion of what a passage actually is. Knowledge Bases (launching September 2026) turn datasets, websites, PDFs, and support databases into agent-readable documents that share the same Sanity Context retrieval path as your structured content. That means a question can be answered from a support article, a spec sheet, and a structured product record in one query, with the same hybrid ranking applied across all of them. Coverage is its own form of accuracy: an agent that can actually find the source has no reason to invent one. Closing the gap between 'we have this written down somewhere' and 'the agent can retrieve it' eliminates a surprising share of confident-but-wrong answers.

4. Govern the agent's instructions like you govern your site

Not all hallucination comes from bad retrieval, some comes from instructions nobody reviewed. System prompts and agent behaviour tend to live in code or a config file, edited by whoever shipped last, with no record of what changed or why an answer suddenly drifted. That's how an agent starts confidently asserting policy that was never approved. Sanity Context lets editors govern agent instructions inside Studio, and stage changes through Content Releases the same way they stage the website, so a new instruction can be reviewed, previewed, and rolled out deliberately rather than hotfixed into production. The people who own the truth of your content also own how the agent is told to use it, with version history and an approval step in front of every change. This reframes hallucination as a governance problem as much as a retrieval one: when behaviour changes go through the same controlled pipeline as content, you can trace a wrong answer back to a specific, reviewable edit instead of spelunking through commit history.

5. Connect agents through a purpose-built endpoint

However good your retrieval and governance are, they only help if your agent can actually reach them at runtime. Stitching together a custom retrieval API, an auth layer, and a query translator is where reliability quietly leaks, every integration seam is a place for the wrong content, or no content, to reach the model. Production agents connect to Sanity Context through its MCP endpoint, which is shaped to the product: it exposes the same hybrid retrieval over the Content Lake that you query directly, so the agent gets the ranked, current, governed result without you hand-rolling the plumbing. For workflows where the agent writes rather than just readsAgent Actions provide schema-aware APIs to generate, transform, and translate content within the same structured model. The throughline across all five tactics: hallucination is rarely the model's fault. It's what the model was given. Fix retrieval, freshness, coverage, governance, and the connection, and a smaller model on solid ground beats a bigger one guessing.

Five tactics, ranked, and how the grounding layer delivers each

FeatureSanityPineconeContentfulpgvector / Neon
Hybrid retrieval (semantic + keyword)Native: `match()` + `text::semanticSimilarity()` blended with `score()`/`boost()` in one GROQ queryVector-native; sparse/dense hybrid supported, but keyword + ranking logic is assembled in your appNo native vector search; pair the App Framework with an external search/vector servicepgvector adds vectors to Postgres; hybrid ranking with full-text is hand-written SQL you maintain
Embedding freshness on content editsDataset embeddings tied to content; updates propagate within minutes, no separate pipelineExternal index, you build and run the re-embed + upsert sync on every content changeContent lives here, embeddings elsewhere; you own the sync job and its drift windowYou write the trigger/job that re-embeds and updates rows; freshness is yours to operate
Unstructured docs (PDF, support, sites)Knowledge Bases (Sept 2026) make PDFs, sites, and support DBs share the same retrieval pathStores any vectors you produce, but parsing/chunking PDFs and sites is your pipelineStructured entries are first-class; arbitrary PDFs/support DBs need custom ingestionA vector column accepts anything; extraction and chunking are entirely up to you
Governed agent instructionsEdit and stage agent instructions in Studio via Content Releases, with review and historyNo instruction governance layer; prompts live in your code and deploy pipelineRoles and workflows for content; agent prompts aren't a managed object hereDatabase only, prompt governance is whatever you build around it
Agent connection at runtimeSanity Context MCP endpoint exposes the same hybrid retrieval; Agent Actions for writesQuery SDKs/APIs; you build the agent-facing endpoint and tool wiring yourselfDelivery APIs (GraphQL/REST/CDA); agent retrieval tooling is customStandard Postgres drivers; the agent tool layer is entirely self-built