Sanity, the CMS platform powering Nike, Cloudflare, and Figma, built an incredibly sophisticated approach to structured content. Their Content Lake stores content as data, not pages — queryable, reusable, portable across any channel.
But when it came to LLM-assisted content creation, their own teams faced the same problem as everyone else: copy content out of Sanity, paste it into ChatGPT, get a response, paste it back. All that structure? The AI couldn't see it.
So they built Content Agent. The team knew it was working when they asked it to add mullets to their author headshots — and it actually did it, directly in the CMS, without exporting a single file.

Building Content Agent
Sanity's product already has all the context an AI would need — field descriptions, document relationships, required vs. optional fields, the semantic meaning of content.
The next step was building an in-app agent that could read and understand it.
So in late 2025, the Sanity team—led by co-founder Even Westvang and engineer Rosti Melkumyan—built Content Agent.
Content Agent starts by reading how your content is organized. Then it uses that understanding to answer questions, create documents, and validate content.
For example, it:
- Navigates content relationships. Ask for "blog posts about product launches" and it doesn't just keyword search. It finds posts, identifies which ones reference products, follows those relationships to check launch dates, and reads your field descriptions to understand business context.
- Creates schema-valid documents. Rather than giving unstructured text to copy-paste, Content Agent creates actual documents that match your content model perfectly — proper references, correct field types, valid structure throughout.
- Transforms images. The agent doesn't just modify text. It can change product photos to match variant colors, adapt visuals for different markets, and update imagery to match brand guidelines.
- Identifies content gaps. Ask "What's trending in our industry, and have we covered it?" and it researches external sources using Firecrawl, analyzes what it finds, then cross-references with your existing content to identify gaps.
Putting Mastra to Work
Sanity built Content Agent using Mastra. Their architecture uses WebSockets for real-time streaming, with Mastra's runtime context passing session data to give each user the right permissions and API access. Tools are passed directly into Mastra's stream method, letting the agent respond in real-time as users chat.
The team also built a schema graph that maps how content types connect to each other (so when you ask for "blog posts that Evan has written," the agent knows to look at the author field, not the person field.) This graph is computed in Temporal and cached in Redis.
Finding the Right Architecture
The team started with 35 tools in a single agent, then experimented with a multi-agent architecture — specialized sub-agents for search, mutation, and collection management.
But they found sub-agents lost too much context. "This main agent would do a lot of research, find a bunch of stuff, and then pass that into another agent — and all of that research was gone," Melkumyan explained.
So they lifted most capabilities back to the main agent, keeping sub-agents only for specific tasks like mutations. For bulk operations on large datasets — some Sanity customers have 10 million documents — they built a "set" system: fetch documents as a set ID, then spawn parallel mutation tasks in Temporal that can run in the background.
All changes land in a staging bundle first, so users can review before releasing.
Days of Work in One Conversation
Over 40 organizations tested Content Agent during early access, including Morning Brew, Complex, Home Instead, CoinDesk, and Braze.
The results speak for themselves: one team tracked 111 articles needing topic updates in a spreadsheet. They asked Content Agent to implement the changes and got 227 edits staged for review. Another organization ran 170+ threads transforming press releases into articles. A third coordinated link updates across 11 countries in a single 57-message conversation.
"Content Agent feels like magic to our non-technical users," says Matt Chamberlain, Product Manager at Braze. "They can ask questions across our documentation, marketing site, and learning content without knowing where things live in the structure."
Content Agent launched publicly in January 2026.
The partnership goes both ways as Mastra uses Sanity to create and edit website content as well.