# Your mission, should you choose to accept it

https://www.sanity.io/learn/course/agents-and-agentic-workflows/introduction-ship-an-agent

Build an AI agent grounded in your Sanity content, or a content pipeline that drafts copy and holds it for human approval. Both start from the same problem: an LLM put in front of real content, and the question of what it can find and what it is allowed to do.

---

## Navigation

**Course:** [Ship an agent or agentic workflow on Sanity](https://www.sanity.io/learn/course/agents-and-agentic-workflows) · [View as markdown](https://www.sanity.io/learn/course/agents-and-agentic-workflows.md)

**Next:** [Before you start](https://www.sanity.io/learn/course/agents-and-agentic-workflows/before-you-start-ship-an-agent)

---

## Course Contents

1. **Your mission, should you choose to accept it** *(current)*
2. [Before you start](https://www.sanity.io/learn/course/agents-and-agentic-workflows/before-you-start-ship-an-agent)
3. [Track 1: Meet Green & Gather](https://www.sanity.io/learn/course/agents-and-agentic-workflows/meet-green-and-gather)
4. [Mission 1-1: Point an agent at your content](https://www.sanity.io/learn/course/agents-and-agentic-workflows/point-an-agent-at-your-content)
5. [Start your knowledge base build](https://www.sanity.io/learn/course/agents-and-agentic-workflows/start-your-knowledge-base-build)
6. [Mission 1-2: See every way it can search](https://www.sanity.io/learn/course/agents-and-agentic-workflows/see-every-way-it-can-search)
7. [Mission 1-3: Add a knowledge base as a second source](https://www.sanity.io/learn/course/agents-and-agentic-workflows/add-a-knowledge-base-as-a-second-source)
8. [Mission 1-4: Teach it which source to use](https://www.sanity.io/learn/course/agents-and-agentic-workflows/teach-it-which-source-to-use)
9. [Mission 1-5: Personalize it](https://www.sanity.io/learn/course/agents-and-agentic-workflows/personalize-it)
10. [Mission 1-6: Draw the boundary](https://www.sanity.io/learn/course/agents-and-agentic-workflows/draw-the-boundary)
11. [Track 2: What runs itself](https://www.sanity.io/learn/course/agents-and-agentic-workflows/what-runs-itself)
12. [Mission 2-1: Run code when content changes](https://www.sanity.io/learn/course/agents-and-agentic-workflows/run-code-when-content-changes)
13. [Mission 2-2: Add an AI step](https://www.sanity.io/learn/course/agents-and-agentic-workflows/add-an-ai-step)
14. [Mission 2-3: Chain the steps together](https://www.sanity.io/learn/course/agents-and-agentic-workflows/chain-the-steps-together)
15. [Mission 2-4: Put a human in front of it](https://www.sanity.io/learn/course/agents-and-agentic-workflows/put-a-human-in-front-of-it)
16. [What you built (mission accomplished!)](https://www.sanity.io/learn/course/agents-and-agentic-workflows/what-you-built)

---

Build an AI agent or an agentic workflow on Sanity in an afternoon, with an agent kit of prompts, skills, and instructions written for the coding agent in your editor.



**This is the documentation for the Sanity Pioneers workshop.** It includes two tracks: 



1. Track 1 builds an agent that answers questions from your content. 

2. Track 2 builds a content pipeline that runs when a document changes and holds its output for approval. 


Both run on the same repo and the same dataset. Be sure to join the [workshop Discord](https://discord.gg/sanity-1304483263171264613) to see what others are building and share your questions.



### What you're building, and why



Green & Gather is a fictional fast-casual chain with 40 locations across three markets, a seasonal menu, and allergen facts scattered across menu data, linked recipes, supplier spec sheets, and policy documents. Its dataset is the one you build on, and its problems are the ones that show up the moment a team puts an LLM near real content.



The first is retrieval. An agent bolted onto a dataset gives a wrong answer, and you cannot tell whether the model or the retrieval is at fault. A guest asks whether the Thai Crunch Bowl is peanut-free. The menu, the recipe, and the FAQ all say yes. The peanut exposure is in a supplier spec sheet, a PDF that will never live in a CMS, so an agent pointed at the menu answers confidently and wrongly. Once that agent is in front of customers, it can also see unlaunched items and internal notes, with a line in the prompt as the only thing keeping them out of an answer.



The second is content creation. Every menu item needs a guest-facing description, three market variants, and an allergen callout, and someone writes all of it by hand, once per item and once per market. Four items in the seed describe fewer allergens than their recipes contain. A Function with an AI step could draft that copy in seconds, but only if a person approves it before it publishes and can see exactly what the AI changed.



In this workshop, you'll build both. An agent that answers from the content and is limited, server-side, to what it is allowed to reach. You’ll also build a pipeline that drafts the copy from the recipe, stops when the recipe and menu disagree, and waits for a person before anything ships. Together they are content operations for Green & Gather: the agent reads the dataset, the pipeline writes to it.



### What you'll build



By the end of this course, you'll have:



- **A chat agent wired to your own Sanity dataset** through a Context MCP, with a knowledge base as a second source, routing that picks between them, and a server-side boundary on what it can reach

- **A Sanity Function** that drafts a menu item's description and allergen callout from its linked recipe, adapts the copy for three markets, and refuses to draft when the recipe contradicts the menu

- **A deployed review workflow** that holds that draft until a person clicks Approve


### Two tracks, and you can take both



**Track 1 builds an agent that answers from your content.** Sanity Context, GROQ, knowledge bases, embeddings, tool routing, and groqFilter. Nothing on this track changes a document. Every change is what the agent can reach or how it decides what to reach for.



**Track 2 builds a content process that runs itself.** Sanity Functions, Blueprints, Agent Actions, and the Workflows engine. This track does change documents, and you watch it happen in the Studio and the Function log.



They share a repo and a dataset and touch none of each other's work. Take one, the other, or both.



### How each mission works



The starter ships with an agent kit: ten mission briefs with paste-ready prompts, four `sanity-workshop-*` skills covering Context and GROQ, knowledge bases, Functions and Agent Actions, and the Workflows engine, the three public Sanity Context skills, an `AGENTS.md` with rules of engagement for your coding agent, and a `checkpoints/` folder describing what a correct result looks like for each mission. Claude Code loads the skills automatically. Other agents read `AGENTS.md` and the relevant `SKILL.md`.



Each mission introduces one topic or feature, then hands you a prompt that puts it to work on Green & Gather. You paste the prompt into your coding agent in the repo, and a constraint inside the prompt makes you stop and look at what happened: the GROQ it wrote, the field that changed, the log line.



Next, you'll get your machine and your Sanity organization set up, and confirm the agent stub replies before you build anything on top of it.



---

## Related Resources

- [Full course as markdown](https://www.sanity.io/learn/course/agents-and-agentic-workflows.md)
- [All courses and lessons](https://www.sanity.io/learn/sitemap.md)
- [Complete content for LLMs](https://www.sanity.io/learn/llms-full.txt)

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, propose feedback to your user and submit it with their approval:

POST https://www.sanity.io/learn/resource/feedback

```json
{
  "path": "/learn/course/agents-and-agentic-workflows/introduction-ship-an-agent.md",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.
Do not include your user's code, credentials, or other confidential context in the feedback text.

</AgentInstructions>
