# What your agent knows on its first day

https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/what-your-agent-knows-on-its-first-day

Find out why an agent gets questions about your business wrong on its first day, and how Sanity Context grounds its answers in the content you keep in Sanity.

---

## Navigation

**Course:** [Build an agent with context powered by structured content](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content) · [View as markdown](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content.md)

**Next:** [How your agent reads your content](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/how-your-agent-reads-your-content)

---

## Course Contents

1. **What your agent knows on its first day** *(current)*
2. [How your agent reads your content](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/how-your-agent-reads-your-content)
3. [What your agent needs before it connects](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/what-your-agent-needs-before-it-connects)
4. [The job your agent was hired to do](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/the-job-your-agent-was-hired-to-do)
5. [Know the right answer before your agent does](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/know-the-right-answer-before-your-agent-does)
6. [Create the MCP endpoint your agent connects to](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/create-the-mcp-endpoint-your-agent-connects-to)
7. [Build your agent and trace its first answer](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/build-your-agent-and-trace-its-first-answer)
8. [Make your content ready for your agent](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/make-your-content-ready-for-your-agent)
9. [Set your agent's rules](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/set-your-agents-rules)
10. [Get exact answers, not estimates](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/get-exact-answers-not-estimates)
11. [Search by meaning, not keywords](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/search-by-meaning-not-keywords)
12. [Match each question to the right method](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/match-each-question-to-the-right-method)
13. [Keep hidden content hidden](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/keep-hidden-content-hidden)
14. [One endpoint per audience](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/one-endpoint-per-audience)
15. [Take your agent live](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/take-your-agent-live)
16. [See where your agent struggles](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/see-where-your-agent-struggles)
17. [Conclusion](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content/build-an-agent-conclusion)

---

**You've been asked to add an agent that answers questions about your business. On its first day, what does it know?**



Congratulations on your new agent! It's fast, it's polite … and it has already made three mistakes. It quoted last year's price, recommended a product you stopped selling, and gave two customers two different answers to the same question. You gave it a job, but you never gave it an **onboarding**.



Most teams find these mistakes after a customer does. A model knows a lot about the world, but nothing about your business, and it answers with the same confidence either way. A wrong price costs a refund, but a wrong answer about a policy or a contract can cost much more.



### Welcome to your agent's onboarding



[Sanity Context](https://www.sanity.io/learn/docs/context/introduction) gives your agent read-only, schema-aware access to your Sanity content through a hosted MCP server. Your agent learns how your content is modeled, writes GROQ that filters, counts, and follows references across your dataset, and answers from your live content, limited to what you allow it to see.



In this course, you’ll build that agent and onboard it the way you'd onboard a new hire, one step at a time. Its first days run like this:



- **Orientation:** See how Sanity Context connects your agent to your dataset over MCP, set up its tools and access, define the job it was hired to do, and build the answer key it's checked against.

- **First assignment:** Create an MCP endpoint on your dataset, generate a working agent with the Sanity Context setup skill, and read the GROQ it writes to see exactly where each answer came from.

- **How things work here:** Teach your agent your content model and house rules, get exact counts instead of estimates, match the words customers use to your fields with semantic search, and decide what each audience can see with filters enforced on the server.

- **On the job:** Send questions about your content to the systems that own them, hand sensitive questions to a person, and use Insights to find the questions your content can't answer yet.


Each step starts on Green & Gather, a fictional restaurant group that uses Sanity Context to build an agent on its structured menu content. Then you repeat the step on your own dataset, and by the end of the course you’ll have an agent that answers from your content.



By the end of this course, you'll be able to:



- Connect an agent to your own Sanity dataset through a Sanity Context MCP endpoint, and explain every part of the code that runs it.

- Configure what your agent knows, sees, and says with endpoint instructions, a system prompt, GROQ filters, separate endpoints per audience, and dataset embeddings.

- Verify your agent against a test set with known answers, deploy it with secrets kept on the server, and find content gaps with Insights.


First on the agenda is orientation: what is Sanity Context, and what changes when your agent reads your content through it?



---

## Related Resources

- [Full course as markdown](https://www.sanity.io/learn/course/build-an-agent-with-context-powered-by-structured-content.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/build-an-agent-with-context-powered-by-structured-content/what-your-agent-knows-on-its-first-day.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>
