架構層次
五個正交關注點組合成完整的 Agent
L1 Tools & Execution
Agent 能做什麼。基礎層:工具賦予模型與外部世界互動的能力。
The Agent Loop
One Loop Is All You Need
The smallest useful agent is a loop that calls the model, runs tools, and feeds results back.
Tool Use
Add a Tool, Add Just One Line
The loop stays stable while capabilities register into a dispatch table.
Permission
Check Permissions Before Execution
Dangerous actions need a harness decision point before the shell runs.
Hooks
Hang on the Loop, Don't Write into It
Cross-cutting behavior belongs around the loop, not tangled inside it.
L2 Planning & Control
如何組織工作。從簡單的待辦列表到跨 Agent 共享的依賴感知任務板。
TodoWrite
An Agent Without a Plan Drifts Off Course
Explicit plans keep long-running work visible and correctable.
Subagent
Break Large Tasks into Small Ones with Clean Context
Subagents give each subtask a clean message history while preserving the main thread.
Skill Loading
Load Only When Needed
Inject specialized knowledge only when the task actually needs it.
System Prompt
Assembled at Runtime, Never Hardcoded
The system prompt is a generated product of policy, tools, skills, and context.
Error Recovery
Errors Are the Start of a Retry
A robust harness classifies failures and decides what kind of retry is worthwhile.
L3 Memory Management
在上下文限制內保持記憶。壓縮策略讓 Agent 可以無限工作而不失去連貫性。
L4 Concurrency & Scheduling
非阻塞執行。後臺執行緒和通知匯流排實現並行工作。
L5 Multi-Agent Platform
多 Agent 協作。團隊、訊息傳遞和能獨立思考的自主隊友。
Task System
Break Big Goals into Small Tasks
A task graph turns vague goals into ordered, observable work.
Agent Teams
One Agent Isn't Enough, Form a Team
Persistent teammates let work continue in parallel without stuffing every thought into one context.
Team Protocols
Teammates Need Agreements
Multi-agent systems need explicit message contracts, not vibes.
Autonomous Agents
Check the Board, Claim the Task
Teammates become useful when they can discover and claim work themselves.
Worktree Isolation
Separate Directories, No Conflicts
Parallel agents need isolated filesystems as much as isolated conversations.
MCP Tools
External Tools, Standard Protocol
External services can become agent tools through a standard discovery and call protocol.
Comprehensive Agent
All Mechanisms, One Loop
The final harness is still one loop, now surrounded by the systems that make it production-shaped.