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_KEY

Example overview

ExampleDemonstrated contentDependency
tutorialEvent Sourcing → fold projection → Goal state machine (teaching entry point)none
agent_loopAgent Turn/Step dual loop + tool continuation stepsnone
usageSession/projection/Goal tools/commands/persistencenone
todoTodo wholesale replacement of the todo list (planning primitive)none
workflowPipeline serial / Parallel parallel / cancellation cascadingnone
subagentMulti-backend derivation + family tree + parent-release cascadingnone
sandbox_approvalApproval three states + sandbox modenone
mcpMCP client → tool bridge (in-memory Transport)none
chatReal DeepSeek multi-turn conversationAPI Key required

Companion tutorials

Each example ships with source-mapping guidance (see tutorials). It is recommended to read the “example + source + tutorial” trio together.