How to Build an AI Agent
How to Build an AI Agent

학습 경로

s01에서 s12까지: 진행형 에이전트 설계

레이어 범례

Tools & Execution
Planning & Coordination
Memory Management
Concurrency
Collaboration
01
s01Single-tool agent loop

The Agent LoopBash is All You Need

84 코드 라인1 도구

The minimal agent kernel is a while loop + one tool

자세히 알아보기
02
s02Tool dispatch map

ToolsOne Handler Per Tool

120 코드 라인4 도구

The loop stays the same; new tools register into the dispatch map

자세히 알아보기
03
s03TodoManager + nag reminder

TodoWritePlan Before You Act

176 코드 라인5 도구

An agent without a plan drifts; list the steps first, then execute

자세히 알아보기
04
s04Subagent spawn with isolated messages[]

SubagentsClean Context Per Subtask

151 코드 라인5 도구

Subagents use independent messages[], keeping the main conversation clean

자세히 알아보기
05
s05SkillLoader + two-layer injection

SkillsLoad on Demand

187 코드 라인5 도구

Inject knowledge via tool_result when needed, not upfront in the system prompt

자세히 알아보기
06
s06micro-compact + auto-compact + archival

CompactThree-Layer Compression

205 코드 라인5 도구

Context will fill up; three-layer compression strategy enables infinite sessions

자세히 알아보기
07
s07TaskManager with file-based state + dependency graph

TasksTask Graph + Dependencies

207 코드 라인8 도구

A file-based task graph with ordering, parallelism, and dependencies -- the coordination backbone for multi-agent work

자세히 알아보기
08
s08BackgroundManager + notification queue

Background TasksBackground Threads + Notifications

198 코드 라인6 도구

Run slow operations in the background; the agent keeps thinking ahead

자세히 알아보기
09
s09TeammateManager + file-based mailbox

Agent TeamsTeammates + Mailboxes

348 코드 라인10 도구

When one agent can't finish, delegate to persistent teammates via async mailboxes

자세히 알아보기
10
s10request_id correlation for two protocols

Team ProtocolsShared Communication Rules

419 코드 라인12 도구

One request-response pattern drives all team negotiation

자세히 알아보기
11
s11Task board polling + timeout-based self-governance

Autonomous AgentsScan Board, Claim Tasks

499 코드 라인14 도구

Teammates scan the board and claim tasks themselves; no need for the lead to assign each one

자세히 알아보기
12
s12Composable worktree lifecycle + event stream over a shared task board

Worktree + Task IsolationIsolate by Directory

694 코드 라인16 도구

Each works in its own directory; tasks manage goals, worktrees manage directories, bound by ID

자세히 알아보기

코드라인 성장

s01
84
s02
120
s03
176
s04
151
s05
187
s06
205
s07
207
s08
198
s09
348
s10
419
s11
499
s12
694