Cookbook¶
The Cookbook is a collection of short, task-oriented recipes that cut
across multiple Zeroth subsystems. Each recipe is around 200 words, has
a When to use / When NOT to use block so you can scan for fit
in under ten seconds, and embeds a real runnable file from examples/
so you can copy, paste, and run it locally.
If you're looking for an overview of a single subsystem, start in Concepts. If you're looking for a guided walkthrough of a single subsystem's API, see the Usage Guides. The Cookbook is where you come when you already know the pieces and want to see them snapped together.
Recipes¶
- Add a human approval step to a node — pause a node until a human approves, then resume.
- Attach memory to an agent — wire a memory connector so an agent can carry state across turns.
- Cap a run's cost budget — estimate LLM cost with
CostEstimatorand block calls that would exceed a per-run cap. - Sandbox a tool call — run a tool in an isolated,
allowlisted environment with
SandboxManager. - Retry a failing webhook with backoff — jittered exponential backoff, dead-letter thresholds, and HMAC verification.
- Block a tool call via policy — deny a
Capabilitybefore the tool fires withPolicyGuard. - Query the audit trail for a run — walk every
NodeAuditRecordfor a run withAuditRepository. - Hand off between two agents mid-graph — chain a researcher agent into a writer agent.
- Branch execution on a condition — evaluate
edge conditions with
BranchResolver+ConditionContext. - Inject a secret into an execution unit — resolve secret refs into env vars and redact them from audit.
- Govern LangGraph tool calls — decide
every tool call with
govern_toolsorZerothMiddleware, plus the compatibility matrix and what tool enforcement does not claim. - LangGraph enforcement evidence —
how a run or deployment is classified
admission/observed/enforced, the 90-second stale threshold, and mixed-version handling.