Cookbook
Recipe-style examples for common agent patterns. Each recipe shows the three
files (main.py, manifest.json, Dockerfile) plus the key ideas and
pitfalls. Copy, adapt, deploy.
Recipes#
Takes a question, pulls relevant docs from the vector store, feeds them to the LLM, returns a grounded answer. Uses ctx.vector, ctx.llm.
Drafts a customer-visible action (an email reply, a refund approval, a journal entry) and parks on reviewer approval before executing. Uses ctx.human, ctx.capability.
schedules[] in the manifest + a handler that branches on scheduled vs manual invocation, with a ctx.state cursor.
Which recipe do I need?#
| If your agent needs to… | Start with | Key kernel services |
|---|---|---|
| Answer questions from your own documents or policies, without inventing facts | RAG agent | ctx.vector, ctx.llm |
| Take a customer-visible action only after a person signs off | Human-in-the-loop agent | ctx.human, ctx.capability |
| Run on its own every hour / day / cron expression and pick up where it left off | Scheduled cron agent | schedules[], ctx.state |
More recipes (planned)#
The cookbook is growing. These land in subsequent releases:
| Recipe | Pattern |
|---|---|
| Webhook-triggered agent | webhooks[] with HMAC verification + handler consuming the webhook payload. |
| Multi-agent orchestration | One agent invokes another via ctx.agents.invoke() as a child workflow. |
| Connector-backed agent | Agent reads from ctx.connector.list() grants, calls ctx.connector.call(). |
| Stateful agent | Agent uses ctx.state across invocations to maintain cursor positions, caches, drafted-not-sent artifacts. |
| Eval-driven development | Manifest eval.scenarios[] + harness pattern. |
| Context-portal skill-consuming agent | Agent calls ctx.semantic.skills_get() to run a tenant-authored playbook. |
Pattern conventions used across all recipes#
Every recipe follows the same habits — copy them into your own agents.
- Python-first — recipes are Python. .NET versions are tracked separately in the SDK reference.
async def handle(req, ctx)— every recipe's entry point.await ctx.log.info("start", ...)at the top of handle(),await ctx.log.info("done", ...)at the end — minimum observability for debuggable invocations.- Guard optional capabilities with
await ctx.capability.available(name)before calling. - Prefer
purpose=overmodel=for LLM calls so admins can rebind without a redeploy. - Never log secrets —
ctx.credentials.get()returns one; don't echo in logs.