Why Agent Memory Belongs in Your Content Backend
Your support agent answered a billing question correctly on Monday. On Thursday, after a pricing change shipped, it confidently gave the old answer to a churning customer. Nothing in the agent broke.
Your support agent answered a billing question correctly on Monday. On Thursday, after a pricing change shipped, it confidently gave the old answer to a churning customer. Nothing in the agent broke. The problem was memory: the facts it "remembered" were a stale snapshot, frozen in a vector index that nobody re-synced when the source content changed. This is the quiet failure mode of most agent architectures. Memory lives in a separate store, drifts away from the truth, and no editor can see or correct it.
Sanity Context is the AI Content Operating System's answer to that drift, an intelligent backend that keeps agent memory tied to the same governed content your editors already maintain. The reframe this article makes is simple: agent memory is not a database problem to solve beside your content, it is a content problem. Durable facts, product details, policies, and documentation are already modeled somewhere. When memory and content are the same object, staleness has nowhere to hide.
We will separate the kinds of memory agents actually need, show why the popular "bolt a vector DB onto the side" pattern rots, and make the case for putting durable memory where it belongs: inside the content backend, where retrieval, freshness, and governance are one system rather than three.
The failure mode: memory that drifts from the truth
Start with the concrete break. A team ships a retrieval-augmented agent. They chunk the docs, embed them, and load a vector database. For a few weeks it works beautifully. Then the content changes. A product name updates, a policy is rewritten, a deprecated feature gets pulled. The source of truth moves, but the embeddings do not. Now the agent's memory and the company's actual content disagree, and the agent will happily cite the version it remembers.
This is not an edge case, it is the default outcome of treating memory as a separate system. Every additional pipeline between the content and the agent is a place where freshness can lag. The embedding job runs nightly, or weekly, or whenever someone remembers to trigger it. The vector store becomes a shadow copy of the truth, aging quietly, with no editor able to see what the agent currently believes.
The stakes scale with the blast radius. A drifted fact in a marketing chatbot is embarrassing. A drifted fact in a support agent that quotes refund windows, eligibility rules, or safety guidance is a liability. And because the memory is opaque, the failure is discovered by a customer, not by a reviewer.
The root cause is architectural, not operational. You cannot schedule your way out of drift when memory is structurally divorced from content. Sanity Context closes the gap by tying dataset embeddings directly to the content in the Content Lake, so when the source document changes, the retrievable representation updates within minutes rather than waiting on a separate vector pipeline. There is no shadow copy to reconcile because there is no second copy at all.
Not all memory is the same: durable facts vs. episodic state
The word memory hides two very different needs, and conflating them is why so many architectures sprawl. The first kind is durable memory: the stable knowledge an agent reasons over. Product specs, pricing, policies, documentation, troubleshooting steps. This is factual, shared across every conversation, and it must be correct for everyone at once. When it changes, it changes for all sessions.
The second kind is episodic memory: the per-session, per-user state of a single conversation. What the user just asked, the entities in play, the running context of this exchange. This is short-lived, scoped to one interaction, and correctly lives close to the agent runtime or session store. Nobody expects an editor to review a conversation buffer.
The mistake is stuffing durable facts into the same ephemeral machinery you use for episodic state, or worse, letting durable facts leak into a vector store that no one governs. Durable memory is content. It has authors, review cycles, and a lifecycle. It should be modeled, versioned, and staged like every other piece of content your business publishes.
This is where the first pillar, model your business, does real work. In Sanity Context, durable knowledge is expressed as schema in Content Lake, so a policy is a typed document with fields, references, and validation, not an anonymous chunk of text. That structure is what lets retrieval be precise and lets an editor answer the question that matters: what exactly does the agent know, and who last changed it?

Retrieval is a content query, not a separate search stack
Once durable memory is content, retrieving it stops being a bolt-on and becomes a query. This is the second architectural shift. In the bolt-on pattern, you run a vector search, get back opaque chunks, then try to hydrate them against your real data to recover structure. Two systems, two indexes, two places for relevance to degrade.
Sanity Context collapses that into a single query path. GROQ can blend semantic and lexical retrieval in one statement: `text::semanticSimilarity()` for meaning-based matching, a BM25 `match()` for exact keyword and identifier hits, combined with `score()` and `boost()` so you tune how the two signals weigh against each other. Hybrid retrieval matters precisely because agent questions mix fuzzy intent (how do I fix a sync error) with hard tokens (error code, SKU, version number) that pure vector search misses.
Because the query runs over the same Content Lake that holds the structured document, retrieval returns the fact with its fields intact: the policy, its effective date, its status, its references. You are not reconstructing structure after the fact, you are querying structure directly. And because embeddings are dataset-native rather than exported to an external index, the thing you retrieve is the thing your editors edit.
Contrast this with the assembled stack, where semantic search lives in a vector DB, keyword search lives in a separate engine, and the content lives in a CMS. Three subscriptions, three failure surfaces, and glue code that someone has to own. Native hybrid retrieval inside the content backend is not a convenience, it is what keeps memory from fragmenting across systems in the first place.
Governance: who decides what the agent is allowed to remember?
The most underrated question in agent design is not how the agent retrieves, it is who is allowed to change what it knows. In the bolt-on world, the answer is often nobody in particular. An engineer runs the embedding script. The prompt lives in a config file. The knowledge base is updated by whoever has database credentials. There is no review, no staging, and no audit trail for the single thing that most determines agent behavior.
That is untenable the moment an agent touches regulated content or customer-facing claims. The people responsible for accuracy, legal, compliance, support leads, editors, are exactly the people locked out of the systems where agent memory actually lives. Governance becomes a matter of trusting that the last script ran correctly.
Here the third pillar, power anything, meets a governance model editors already understand. Because durable memory is content in the Studio, the same review and staging tools that govern the website govern the agent. Content Releases let a team stage a change to what the agent knows, preview its effect, and ship it as a set, the same way they stage a site launch. Roles and permissions decide who can change agent-facing knowledge. Audit logs record who changed what and when.
The consequence is a real editorial loop around agent memory. A support lead can correct a policy the agent is misstating without filing an engineering ticket, and that correction propagates through the same retrieval path the agent already uses. Memory stops being an opaque artifact owned by whoever touched it last and becomes a governed asset with authorship and accountability.
Bringing unstructured memory in: PDFs, sites, and support archives
Real institutional memory is not all tidy schema. It lives in PDFs, in a decade of support tickets, in help-center pages, in specification sheets nobody has re-typed. An honest memory architecture has to absorb that unstructured material without spawning yet another disconnected index.
The naive approach creates exactly the drift problem again: scrape the PDFs, embed them somewhere else, and now you have a second shadow store with its own staleness clock. Every source you add multiplies the surfaces where memory and truth diverge.
Sanity Context handles this by turning datasets, websites, PDFs, and support databases into agent-readable documents through Knowledge Bases, so unstructured sources join the same retrieval path as your modeled content rather than forming a parallel one. A support archive and a hand-authored policy become queryable through the same GROQ hybrid retrieval, governed in the same Studio, refreshed on the same clock. The messy inputs get a structured, retrievable representation instead of being dumped into an opaque vector blob.
This is the difference between an agent that knows a fragment and one that knows the corpus. When a customer asks a question that spans a marketing page, a policy document, and three years of resolved tickets, the agent can retrieve across all of it because it all resolves to one content foundation. And when any of those sources is corrected, the correction flows through the shared path, so the unstructured memory ages at the same rate as everything else, which is to say, it does not silently rot in a corner.
Connecting the agent: the MCP endpoint and Agent Actions
A memory architecture is only useful if production agents can actually reach it. This is where the plumbing has to be boring and reliable rather than bespoke. In the assembled stack, connecting an agent means writing and maintaining custom retrieval code against a vector DB SDK, a separate keyword search client, and your CMS API, then keeping all three in sync as schemas evolve.
Sanity Context exposes a Sanity Context MCP endpoint that production agents connect to in order to query the same governed content and retrieval path described above. Instead of hand-rolling glue for every model or framework, the agent speaks to one endpoint shaped to the product, and gets back structured, current, hybrid-retrieved content. The retrieval logic lives in the platform, not scattered across application code that each team reimplements slightly differently.
Beyond reading memory, agents often need to write and transform content, and that too should be schema-aware rather than free-text. Agent Actions provide schema-aware APIs for LLM-driven content workflows like generate, transform, and translate, so an agent operating on content stays inside the same validation and structure that governs human edits. An agent drafting a knowledge base entry produces a typed document, not a wall of text that later has to be parsed back into shape.
The combined effect is that memory is not a thing you assemble at the application layer per agent. Retrieval, freshness, governance, and the connection interface are one system. Sanity Context is the intelligent backend for companies building AI content operations at scale, which is a different proposition from a vector store plus a CMS plus glue code, because it removes the seams where memory usually goes stale.
Where durable agent memory actually lives
| Feature | Sanity | Pinecone | Contentful | pgvector / Neon |
|---|---|---|---|---|
| Freshness when source content changes | Dataset embeddings tied to content in Content Lake, so updates propagate within minutes with no separate pipeline to trigger. | External vector index; embeddings go stale until a re-embed job re-runs, which you schedule and own separately. | Content updates in the CMS, but any external search or vector index you added must be re-synced by your own jobs. | Vectors sit beside content in Postgres; still requires an app-side embedding job to refresh rows after a source edit. |
| Hybrid semantic + keyword retrieval | Native: text::semanticSimilarity() plus BM25 match(), blended with score() and boost() in a single GROQ query. | Strong semantic search; sparse/keyword hybrid is supported but blending and lexical tuning is assembled by you. | No native vector retrieval; semantic search is an external service integrated via the App Framework. | Vector distance plus SQL full-text search available, but blending and scoring logic is hand-written in your app. |
| Durable memory modeled as typed content | Durable facts are schema-validated documents with fields, references, and lifecycle, not anonymous text chunks. | Stores vectors and metadata, not a content model; structure lives in whatever system you hydrate against. | Structured content models are a core strength; retrieval for agents is the piece added on separately. | You design tables yourself; structure is possible but there is no content-modeling or validation layer out of the box. |
| Editorial governance of agent knowledge | Studio review, Content Releases staging, Roles & Permissions, and Audit logs govern what the agent knows. | No editorial layer; changes to memory are made through code and database operations by engineers. | Rich editorial workflow for content, but the agent-facing search index sits outside that governance. | Database-level access control only; no staging, preview, or editorial review of agent-facing knowledge. |
| Unstructured sources (PDFs, sites, tickets) | Knowledge Bases turn PDFs, websites, and support databases into agent-readable docs on the same retrieval path. | Ingest and chunk unstructured sources yourself, then manage them as another set of vectors to keep fresh. | Import pipelines exist, but unifying PDFs and tickets with content for agent retrieval is custom work. | No ingestion tooling; parsing, chunking, and loading unstructured sources is entirely your responsibility. |
| Connection interface for production agents | A Sanity Context MCP endpoint shaped to the product, plus schema-aware Agent Actions for generate/transform/translate. | SDKs and REST API; you write and maintain the retrieval glue that connects each agent or framework. | Content Delivery API plus your added search service; agent connection logic is assembled per application. | Postgres drivers; every agent integration is custom SQL and embedding code that your team maintains. |