A pure-Go, in-process reference implementation of the DeepSeek Harness Agent. Event sourcing, fold projection, Goal planning and tool governance — translated line by line into idiomatic Go, so you can read, debug and rebuild a real Agent.
Three pillars make up the Agent kernel. Each is a Capability Seam: a service definition plus a swappable provider, so replacing one provider changes behavior without touching the rest.
Dsh-Go answers one question: how does a real Agent work inside? Instead of a black box, it gives you the actual machinery — and each piece is small enough to grasp in an afternoon.
| Core concept | What it means | Learn it |
|---|---|---|
| Event Sourcing | No mutable state; append immutable events, derive state from them | Tutorial |
| Fold Projection | State = a pure function of the event log, incremental O(N) | Tutorial |
| Goal State Machine | active / paused / blocked / complete planning with stable error codes | Tutorial |
| Turn / Step Loop | One turn per user message; steps run tools and feed results back | Architecture |
| Tool Waterfall | pre → execute → post → result pipeline with pluggable middleware | Capabilities |
Start from examples/
and run go run ./examples/tutorial — no LLM key needed until the very last one.
| Example | What it demonstrates |
|---|---|
tutorial | Event sourcing → fold projection → Goal machine (the teaching entry) |
agent_loop | Turn/Step double loop + tool continuation |
usage | Session, projection, Goal tool, commands, persistence |
todo | Swapping a capability end-to-end |
workflow | Pipeline / parallel / cancellation cascade |
subagent | Multi-provider derivation + parent-release cascade |
sandbox_approval | Approval states + sandbox mode |
mcp | MCP client → tool bridge |
chat | Real DeepSeek multi-turn chat (requires an API key) |