Learn Pi Agent

Learning path

s01 to s12: hang your own mechanisms on pi's loop

Legend

Loop & Action
Knowledge & Context
Delegation & Integration
Distribution & Integration
01
s01Built-in agent loop

AgentSessionpi already runs the loop

17 LOC0 tools

“One prompt() is a whole agent loop; pi already turns it for you.”

Learn more
02
s02defineTool tool pool

Custom toolsAdd a capability, add one handler

27 LOC2 tools

“Add a capability, add just one handler.”

Learn more
03
s03tool_call permission gate

Permission gateDraw the boundary first, then hand over freedom

30 LOC0 tools

“Draw the boundary first, then hand over freedom.”

Learn more
04
s04Events and hooks

Events and hooksHang on the loop, do not write into it

47 LOC0 tools

“Observe with events, intervene with hooks, never touch the main loop.”

Learn more
05
s05Agent Skills on demand

On-demand skillsLoad it when you need it

46 LOC0 tools

“Only names and descriptions are resident; the body is read on a hit.”

Learn more
06
s06Prompt templates

Prompt templatesA slash command for a common instruction

25 LOC0 tools

“Standardize how to ask, too.”

Learn more
07
s07Session tree and compaction

Sessions and branchingContext fills up; save and fork it

37 LOC0 tools

“A session is a tree, not a straight line.”

Learn more
08
s08Isolated child session

SubagentsGive a subtask a brand-new messages[]

50 LOC1 tools

“Trade context budget for focus.”

Learn more
09
s09JSONL RPC

RPC integrationDrive pi from any program with JSONL

55 LOC0 tools

“Commands in on stdin, events out on stdout.”

Learn more
10
s10Custom model provider

Custom providersThe model is not only from one vendor

36 LOC0 tools

“pi's model layer is open.”

Learn more
11
s11Pi Package distribution

Pi PackagePack your tools, skills, and templates and share them

38 LOC0 tools

“One unit, one install.”

Learn more
12
s12Mechanism integration

The full harnessMany mechanisms, one session

65 LOC1 tools

“Every extension point ultimately flows into the same loop.”

Learn more

Code growth

s01
17
s02
27
s03
30
s04
47
s05
46
s06
25
s07
37
s08
50
s09
55
s10
36
s11
38
s12
65