Recipes
Recipes
Copy-paste solutions for common scenarios. Each recipe is end-to-end and runs as written.
Recipes are short, complete, runnable. Each one is a single page that contains everything you need: install, code, run.
Pick the closest match to what you're building, copy, adjust the API key, run.
| Recipe | What you get | Time |
|---|---|---|
| Chat with RAG | A streaming React chat answering from your own docs | 5 min |
| PDF Q&A | Ask questions about a local PDF | 8 min |
| Code reviewer | An agent that reviews a diff and posts comments | 10 min |
| Discord bot | A Discord bot that talks back, with tools | 12 min |
| Multi-agent research team | Planner + researcher + writer | 15 min |
| Cost-guarded chat | Chat that aborts when it costs too much (UI-level) | 5 min |
| Cost guard | Enforce a dollar budget with the costGuard observer | 5 min |
| Persistent memory | Chat that remembers across sessions | 5 min |
| Confirmation-gated tool | Dangerous tool that asks before acting | 5 min |
| Custom adapter | Wrap any LLM API as an AgentsKit adapter | 10 min |
| Wrap a non-streaming endpoint | Fake streaming for one-shot providers | 5 min |
| Edit + regenerate messages | Let users edit prompts and re-run specific turns | 5 min |
| Eval suite for an agent | Score an agent's quality in CI | 10 min |
Conventions used in recipes
- Replace
KEYwith your actual API key (useprocess.env.X_API_KEYin real code) - Code is TypeScript; recipes work in plain JavaScript by removing types
- Each recipe declares its
npm installline at the top - Recipes don't depend on each other — every page stands alone