Examples
The repository ships 9 runnable examples, all zero dependencies out of the box (except chat, which needs an API Key). Source code lives in examples/.
Running the examples
1# Teaching entry point (start with this)
2go run ./examples/tutorial
3
4# The rest of the examples
5go run ./examples/agent_loop
6go run ./examples/usage
7go run ./examples/todo
8go run ./examples/workflow
9go run ./examples/subagent
10go run ./examples/sandbox_approval
11go run ./examples/mcp
12go run ./examples/chat # requires DEEPSEEK_API_KEYExample overview
| Example | Demonstrated content | Dependency |
|---|---|---|
tutorial | Event Sourcing → fold projection → Goal state machine (teaching entry point) | none |
agent_loop | Agent Turn/Step dual loop + tool continuation steps | none |
usage | Session/projection/Goal tools/commands/persistence | none |
todo | Todo wholesale replacement of the todo list (planning primitive) | none |
workflow | Pipeline serial / Parallel parallel / cancellation cascading | none |
subagent | Multi-backend derivation + family tree + parent-release cascading | none |
sandbox_approval | Approval three states + sandbox mode | none |
mcp | MCP client → tool bridge (in-memory Transport) | none |
chat | Real DeepSeek multi-turn conversation | API Key required |
Companion tutorials
Each example ships with source-mapping guidance (see tutorials). It is recommended to read the “example + source + tutorial” trio together.