English | 中文
Go Agent Harness runtime built on pluginkit. Assemble Runner, Platform, Loop, Agent, tools, and policies from YAML. Supports interactive REPL, long-running autonomous loops, sub-agent delegation, MCP, Slack/Feishu/ACP integrations, and headless daemons.
- Plugin assembly — 79 registered plugin kinds; L0 defaults plus L1 overlays
- Coding agent loop — file I/O, shell, policy approval, JSONL session persistence
- Autonomous runs — turn continuation (
hook/turn-continue), todo/finish, token compaction, crash recovery - Sub-agent delegation — define sub-agents in
agents/*.md; the main agent only sees summarized results - Self-learning —
/learnformemory.md, Grounded Dreaming, Skill Workshop proposals - Network tools — HTTP fetch, Exa search, human-in-the-loop prompts
- Integrations — Slack, Feishu, HTTP chat API, Langfuse; multiplex several IM channels; expose AgentKit or call remote agents over ACP (e.g. Cursor CLI). See presets — Integrations
- Headless — worker (one-shot), timer (fixed interval), cron (calendar + agent scheduling)
- Web manager — edit the assembly graph, diagnose structure, dry-run build validation
flowchart TB
subgraph entry["Entry"]
CLI["cmd/agent"]
MGR["-manager Web UI"]
end
subgraph spine["Spine"]
R["Runner"]
P["Platform<br/>(cli / worker / timer / multiplex)"]
L["Loop"]
A["Agent<br/>(coding / …)"]
end
subgraph deps["Dependencies"]
LLM["LLM Provider"]
TOOLS["Tools Runtime"]
SESS["Session Store"]
HOOK["Hooks"]
POL["Policy / Approval"]
end
CLI --> R
MGR -.->|config edit| R
R --> P
P --> L
L --> A
A --> LLM
A --> TOOLS
A --> SESS
A --> HOOK
TOOLS --> POL
Configuration: config.base.yaml (L0, shipped with the repo) plus config.yaml or presets/*.yaml (L1 overlays; later files win). The instance graph is built with pluginkit/build; the root id is runner.default.
- Go 1.26+
- OpenAI-compatible API key (optional for smoke presets)
git clone https://github.com/lengzhao/agentkit.git
cd agentkit
export OPENAI_API_KEY=sk-...
# Interactive REPL
go run ./cmd/agent
# REPL with an initial message
go run ./cmd/agent "Summarize this repo layout"
# Project coding preset
go run ./cmd/agent -config presets/coding.yaml "your task"
# Local smoke without an API key (scripted LLM)
go run ./cmd/agent -config presets/coding-smoke.yaml "List the directory and read README"Copy the example into an L1 file (listed in .gitignore):
cp config.example.yaml config.yaml-config accepts comma-separated overlays merged in order (later overrides earlier):
go run ./cmd/agent -config presets/autonomous.yaml,presets/worker.yaml "one-shot job"| Scenario | Example |
|---|---|
| Interactive coding | go run ./cmd/agent -config presets/coding.yaml |
| Autonomous run | go run ./cmd/agent -config presets/autonomous.yaml "multi-step task" |
| Sub-agent delegation | go run ./cmd/agent "ask researcher to …" (L0 default; smoke: presets/subagent-smoke.yaml) |
| Self-learning | /learn, /learn dream run, /learn skill … in the REPL |
| Search + fetch | export TAVILY_API_KEY=... and -config presets/web.yaml |
| Headless batch | -config presets/autonomous.yaml,presets/worker.yaml |
| Scheduled daemon | -config presets/autonomous.yaml,presets/cron.yaml |
| Config Web UI | go run ./cmd/agent -manager -addr :8080 |
Full preset index: presets/README.md (中文).
agentkit/
├── cmd/agent/ # Main binary (REPL / headless / -manager)
├── config.base.yaml # L0 default graph
├── presets/ # Scenario L1 overlays
├── runtime/ # Runner, Loop, Platform, cap implementations
├── plugins/ # Tools, hooks, policy, prompts, learning, …
├── cap/ # Swappable capability interfaces and DTOs
├── examples/
│ ├── agents/ # Sub-agent examples
│ └── skills/ # Agent skill examples
└── docs/ # Design docs (Chinese; see docs/README.md)
Detailed design docs live under docs/ (Chinese). Start here:
- English index: docs/README.md
- 中文索引: docs/README.zh.md
Suggested reading order:
flowchart LR
A["plugin-catalog"] --> B["go-agent-harness-architecture"]
B --> C["roadmap"]
| Doc | Topic |
|---|---|
| go-agent-harness-architecture.zh.md | Runner, spine, assembly, lifecycle |
| plugin-catalog.zh.md | Plugin kind catalog |
| roadmap.zh.md | Status and roadmap |
| guides/learning-dreaming.zh.md | Dreaming, diary, Skill Workshop |
| guides/delivery.zh.md | Custom plugin card sending |
| guides/ | Autonomous runs, multi-tenant, tools, HIL, … |
go test ./...
go generate ./... # refresh blank imports after adding plugins
tail -f ~/.agentkit/agent.logPlugins register with pluginkit.Register(kind, New). Constructors use (Config, Deps); dependencies come from the deps field in YAML.
| Project | Notes |
|---|---|
| pluginkit | Plugin registry and graph build |
| DeepSeek Harness | Agent harness reference |
| Pi | Coding agent extension model |