- Studio
- Managed Agents
- Examples
Cookbooks
Cookbooks
Copy short patterns for Managed Agents: hooks, approvals, session clients, connectors, and agents that work together.
Cookbooks are short programs that each show one pattern you can copy into your own agent. Each one runs as it is, with the Agents SDK and a Mistral API key. Some need more setup, such as a Tavily key stored for the workspace in One shared key for a connector.
Choose a cookbook
Each row names a cookbook and the pattern it shows:
Cookbook | The pattern |
|---|---|
| Validate structured output | A hook that checks the final answer and makes the agent correct it |
| Several clients on one session | Live views of one session that race to answer one approval |
| One approval policy for every subagent | A policy on the lead's session that answers for its subagents |
| Private data guard | A stateful hook that refuses web search once the agent reads private data |
| One shared key for a connector | A connector that uses one API key stored for the workspace |
| Stop and answer a turn by id | A dependency upgrade in a notebook: a stopped wait, the same turn back from a re-run cell, and the edit approved from another kernel with only its ids |
| Slack bot: one session per thread | A bot that binds each thread's session by id and resumes from a stored cursor after a restart |
| Stop an agent that repeats itself | A stateful hook that blocks a tool after two calls in a turn, and ends the turn if the model keeps calling it |
| Live progress | A hook that pushes each finished step to a progress bar in your app |
| Issue triage swarm | 300 agents, one per open issue, summarize their issues on one message board and flag the duplicates |
Run a cookbook
To install the SDK, set your API key, and run a program and its test, follow Run an example. For complete programs that do a real job, see Examples.