Agent Architecture7 min readยท

How to Replace Your Help-Center Search With an Agent

Your help center has a search box, and it is failing the people who use it. A customer types "refund after trial ended" and gets back a keyword match for a billing FAQ that does not mention trials at all.

Your help center has a search box, and it is failing the people who use it. A customer types "refund after trial ended" and gets back a keyword match for a billing FAQ that does not mention trials at all. They rephrase twice, find nothing useful, and open a ticket. Multiply that by every near-miss query and you have a search experience that quietly trains users to skip search entirely and contact support, which is the exact outcome the help center was supposed to prevent.

The instinct is to bolt a chatbot on top of the same index, but a generative agent reading from a brittle search backend just hallucinates more confidently. Sanity Context is the AI Content Operating System for grounding agents in your real support content, an intelligent backend that lets an agent retrieve the right article, the right version, and the right answer before it generates a word. It sits on top of the Content Lake, where your help content already lives as structured, queryable data.

This guide walks through replacing help-center search with an agent that actually resolves questions: how retrieval has to change, how to keep answers current, how to govern what the agent is allowed to say, and where Sanity Context fits against vector databases and CMS bolt-ons.

Why keyword search fails the modern help center

Traditional help-center search is lexical. It indexes the words in your articles and matches them against the words in a query, which works only when the user already knows the vocabulary your writers used. Real support queries rarely do. People describe symptoms, not features ("the page just spins"), they use the wrong product names, and they ask compound questions that span three articles. A keyword index returns the article with the most term overlap, not the article that answers the question, and it returns nothing at all when the overlap is zero.

The failure compounds because help content is written for browsing, not for retrieval. A single troubleshooting article may bury the relevant paragraph under six headings of preamble, so even a correct match drops the user onto a page where they still have to hunt. The result is deflection going the wrong direction: search sends people to tickets instead of away from them.

Replacing search with an agent changes the contract. Instead of returning ten blue links, the agent reads the most relevant passages and composes a direct answer with a citation. But that only works if retrieval is good, because an agent fed weak candidates produces fluent, confident nonsense. The architecture problem is therefore a retrieval problem first. Get the agent the right passages and generation is easy; feed it keyword-matched noise and no prompt engineering will save it. This is the lens the rest of this guide uses: the agent is only as honest as the content layer underneath it, which is why the backend, not the model, is where this project succeeds or fails.

Hybrid retrieval: the architecture that actually answers questions

The fix for vocabulary mismatch is semantic retrieval, which compares the meaning of a query against the meaning of your content using embeddings rather than shared words. "The page just spins" lands near an article about loading timeouts even with no terms in common. But pure semantic search has its own failure: it loses precision on exact strings, error codes, SKUs, and product names, where a literal match matters more than a vibe. The robust answer is hybrid retrieval, blending semantic similarity with classic lexical scoring so you get both recall and precision in one ranked list.

Most stacks assemble this by hand: an embedding pipeline writing vectors to one database, a keyword engine in another, and application code merging two result sets with a reranker glued across the seam. Every join is a place for drift and latency. With Sanity Context the blend happens natively inside the Content Lake. A single GROQ query can combine `text::semanticSimilarity()` for meaning with a BM25 `match()` for exact terms, then weight the two with `score()` and `boost()` to tune which signal wins for a given query class. One query, one store, one ranked answer.

That consolidation matters operationally as much as architecturally. The agent's retrieval call is a GROQ query against the same content your editors already manage, not a request to a parallel system that has to be kept in sync. When you can express "semantically close AND contains this error code, boosted toward published troubleshooting docs" in one expression, the gap between what editors publish and what the agent retrieves disappears.

Illustration for How to Replace Your Help-Center Search With an Agent
Illustration for How to Replace Your Help-Center Search With an Agent

Keeping answers current without a vector pipeline

A help center is never finished. Articles get rewritten after a release, policies change, and a deprecated feature has to stop showing up in answers the day it is sunset. In a bolt-on RAG architecture this is where things rot. Embeddings live in a separate vector store, so every content edit has to trigger a re-embedding job, propagate through a queue, and overwrite the old vectors before the agent can be trusted again. Miss a step and the agent confidently cites the version you just retired.

This staleness is the quiet killer of help-center agents. The model is fine; the index is three weeks behind. Users notice immediately when an agent quotes a refund window that changed last sprint, and the trust you spent months earning evaporates in one wrong answer.

With Sanity Context, dataset embeddings are tied to the content itself, so when an editor updates an article the embeddings update within minutes. There is no separate vector pipeline to operate, monitor, or reconcile, because the thing being embedded and the thing being served are the same record in the Content Lake. The retrieval path reads from live content, not a nightly snapshot. For a team that ships content changes daily, the difference is structural: currency stops being an integration you maintain and becomes a property of where the content lives. That is a large part of what it means for Sanity to operate content end to end rather than stop at publishing, the legacy CMS boundary that turns every downstream system into a sync problem.

Governing what the agent is allowed to say

An answering agent is a publishing surface, and an ungoverned publishing surface is a liability. The moment an agent speaks on your behalf, someone has to own what it can claim about refunds, security, contractual terms, and anything a customer might act on. The wrong move is to encode those guardrails as a prompt string pasted into application config, where no reviewer sees it, no version history exists, and a change ships without anyone in support or legal knowing.

The better model treats agent instructions as content, governed by the same people who govern the rest of the help center. In Sanity, the agent's behavior, the system instructions, the answer templates, the topics it must escalate rather than answer, lives in the Studio alongside the articles. Editors can review it, and Content Releases let a team stage a change to agent behavior and publish it the same way they stage and publish a website update, so a new escalation rule goes live as a reviewed, dated, reversible change rather than a quiet edit to a deployment variable.

This is also where compliance gets real. Sanity is SOC 2 Type II compliant and GDPR compliant, supports regional hosting and data residency, and publishes its sub-processor list, and Roles & Permissions plus Audit logs let you record who changed what an agent is allowed to say and when. When a customer disputes an answer, you can show the exact instruction set and content version that produced it. An agent built on a config file in a repo cannot give you that, and for any regulated support operation that gap is the difference between a defensible system and an unauditable one.

Connecting the agent: from Content Lake to production

Architecture is only useful if a real agent can call it in production. The connection point for Sanity Context is the Sanity Context MCP endpoint, which is what a production agent actually queries to retrieve grounded content. Rather than wiring your agent to a bespoke retrieval API, you point it at an endpoint shaped for exactly this job: ask a question, get back the relevant, current, governed passages with the structure intact.

The content feeding that endpoint does not have to start out clean. Knowledge Bases turn datasets, websites, PDFs, and support databases into agent-readable documents that share the same Sanity Context retrieval path, so a help center scattered across an old portal, a folder of policy PDFs, and an existing ticketing knowledge base can be consolidated into one queryable foundation instead of three silos the agent has to be taught about separately. That shared foundation is the difference between an agent that knows your whole support corpus and one that knows whichever fragment you managed to index.

When the agent needs to do more than answer, Agent Actions provide schema-aware APIs for content workflows like generating a draft FAQ from a cluster of similar tickets, transforming a long article into a concise answer snippet, or translating an answer for a regional audience, all aware of your content model rather than emitting free text someone has to reformat. The pattern across all of it is the same: the agent reads from and writes to the same structured store editors govern, so retrieval, generation, and editorial control share one backbone instead of being stitched together across vendors. That shared backbone is what lets a support team scale answer output without scaling headcount to match.

A migration path that does not break trust on day one

You cannot rip out help-center search on a Friday and hope. A credible migration runs the agent in shadow first. Point it at the same queries your existing search is handling, log the answers it would have given, and have your support team grade them against the articles. Because retrieval is a GROQ query against the Content Lake, you can inspect exactly which passages produced each answer, which makes grading a content problem your editors can act on rather than a black box you can only retrain.

From there, expose the agent on a slice of traffic, the lowest-risk topic clusters first, with a visible "talk to a human" path on every answer so a wrong response costs a click, not a customer. Watch deflection and escalation rates by topic, and use the gaps to drive content work: the questions the agent escalates most are the articles your help center is actually missing. This is a healthier feedback loop than keyword search ever produced, because every failure points at a specific content fix rather than a tuning parameter.

Governance makes the rollout reversible. Each behavior change ships through Content Releases as a dated, reviewable change, so if a new answer template starts misfiring you roll back the release the way you would roll back a site deploy. The agent does not become a separate system with its own change process; it stays part of the content operation. Replacing search this way means the question is never "is the model good enough" in the abstract. It is "is the content right, is retrieval finding it, and is the behavior governed", three questions an editorial team can own, which is exactly why grounding the agent in a Content Operating System rather than a standalone model is what makes the replacement stick.

Help-center answering agents: how the retrieval backends compare

FeatureSanityPineconeContentfulpgvector / Neon
Hybrid retrievalNative: text::semanticSimilarity() plus BM25 match() blended with score() and boost() in one GROQ query.Sparse-dense hybrid supported, but lexical and dense signals are configured in the index and tuned outside your content store.No native vector search; pair the App Framework with an external search or vector service and merge results in app code.Vectors via pgvector plus full-text via tsvector, blended by SQL you write and maintain yourself.
Embedding freshnessDataset embeddings are tied to content, so an article edit propagates to retrieval within minutes; no separate pipeline.Vectors update only when your re-embedding job runs and upserts; a missed run leaves stale answers in the index.Freshness depends on the external pipeline you build between Contentful webhooks and your vector store.You own the re-embed-on-change trigger and the upsert; currency is exactly as good as your jobs.
Source of contentThe same Content Lake records editors manage are what the agent retrieves; no parallel copy to reconcile.Vector store holds derived copies; the canonical content lives elsewhere and must be kept in sync.Content is canonical in Contentful, but retrieval reads from a separate index you maintain alongside it.Content and vectors can share Postgres, but you design the schema and sync between source and embeddings.
Agent instruction governanceInstructions and escalation rules live in the Studio, staged via Content Releases, with Roles & Permissions and Audit logs.Out of scope; prompts and guardrails live in your application, with whatever review process you add.Roles and workflows exist for content; agent behavior is not modeled and governed in-platform.No governance layer; agent behavior is application config and code review.
Ingesting mixed sourcesKnowledge Bases turn datasets, websites, PDFs, and support databases into agent-readable docs on one retrieval path.Accepts any vectors you produce, but parsing PDFs and sites into chunks is your ingestion code.Built for structured content entries; unstructured PDFs and external sites need custom ingestion.Stores whatever you insert; extraction and chunking of mixed sources is entirely your build.
Production connectionAgents query the Sanity Context MCP endpoint, shaped to return current, governed passages with structure intact.Query API returns nearest vectors; assembling governed, cited answers is left to your agent layer.Delivery and GraphQL APIs serve content; answer assembly and retrieval ranking are yours to build.SQL queries return rows; the retrieval contract and answer shaping are application responsibilities.