Files
ai-agent-book/book-he/images/fig5-10.svg
T
liqiang b119135836
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
ai-agent-book 精选快照(<2MB 代码与文档,来自 github.com/bojieli/ai-agent-book)
2026-08-20 13:12:50 +00:00

61 lines
11 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 40 880 515" width="880" height="515" style="background:#ffffff">
<defs><marker id="ah" markerWidth="12" markerHeight="8" refX="12" refY="4" orient="auto"><polygon points="0 0, 12 4, 0 8" fill="#333333"/></marker><marker id="ah-light" markerWidth="12" markerHeight="8" refX="12" refY="4" orient="auto"><polygon points="0 0, 12 4, 0 8" fill="#999999"/></marker></defs>
<rect x="60" y="55" width="180" height="50" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2"/>
<text x="150" y="72" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">Dust → Star</text>
<text x="150" y="92" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">Physical Laws</text>
<line x1="240" y1="80" x2="255" y2="80" stroke="#333333" stroke-width="2" marker-end="url(#ah)"/>
<rect x="260" y="55" width="180" height="50" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2"/>
<text x="350" y="72" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">Star → Planet</text>
<text x="350" y="92" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">Gravitational aggregation</text>
<line x1="440" y1="80" x2="455" y2="80" stroke="#333333" stroke-width="2" marker-end="url(#ah)"/>
<rect x="460" y="55" width="180" height="50" rx="6" fill="#d0d0d0" stroke="#333333" stroke-width="2"/>
<text x="550" y="72" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">Planet → Life</text>
<text x="550" y="92" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">DNA self-replication</text>
<line x1="640" y1="80" x2="655" y2="80" stroke="#333333" stroke-width="2" marker-end="url(#ah)"/>
<rect x="660" y="55" width="180" height="50" rx="6" fill="#999999" stroke="#333333" stroke-width="2"/>
<text x="750" y="72" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#ffffff" text-anchor="middle" dominant-baseline="central" font-weight="bold">Life → Agent</text>
<text x="750" y="92" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#ffffff" text-anchor="middle" dominant-baseline="central" font-weight="normal">Code bootstrapping</text>
<line x1="30" y1="120" x2="850" y2="120" stroke="#999999" stroke-width="2" stroke-dasharray="8,4"/>
<rect x="30" y="135" width="400" height="70" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2"/>
<text x="230" y="155" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14.5" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">DNA self-replication: random mutation + natural selection</text>
<text x="230" y="177" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="9" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">Does not understand itself · Cannot modify directionally · 3.7 billion years of blind trial and error</text>
<rect x="450" y="135" width="400" height="70" rx="6" fill="#999999" stroke="#333333" stroke-width="2"/>
<text x="650" y="155" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="15" fill="#ffffff" text-anchor="middle" dominant-baseline="central" font-weight="bold">Agent bootstrapping: understand code + directed design</text>
<text x="650" y="177" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="10.5" fill="#ffffff" text-anchor="middle" dominant-baseline="central" font-weight="normal">Understands its own mechanisms · Creates purposefully · Inherits best practices</text>
<rect x="20" y="225" width="390" height="295" rx="6" fill="#ffffff" stroke="#333333" stroke-width="2" stroke-dasharray="8,4"/>
<text x="215" y="248" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="20" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">Original Agent (own code)</text>
<rect x="30" y="265" width="175" height="124" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2"/>
<text x="118" y="285" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">System prompt</text>
<text x="40" y="308" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="8.5" fill="#333333" text-anchor="start" dominant-baseline="central" font-weight="normal">You are an airline customer service agent</text>
<text x="40" y="326" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central" font-weight="normal">Cancellation rules: ...</text>
<text x="40" y="344" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central" font-weight="normal">Transfer rules: ...</text>
<text x="40" y="362" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central" font-weight="normal">Tool: cancel_order</text>
<rect x="215" y="265" width="185" height="124" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2"/>
<text x="308" y="285" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">Agent framework code</text>
<text x="225" y="308" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central">loop:</text>
<text x="225" y="326" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central"> msg = llm(ctx)</text>
<text x="225" y="344" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central"> if tool_call:</text>
<text x="225" y="362" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central"> exec(tool)</text>
<rect x="30" y="400" width="370" height="54" rx="4" fill="#f5f5f5" stroke="#999999" stroke-width="2"/>
<text x="215" y="419" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="15.5" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="normal">Tool definition + MCP integration + message format</text>
<text x="215" y="438" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">Verified high-quality implementation</text>
<text x="440" y="215" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="bold">Copy + modify</text>
<line x1="410" y1="375" x2="470" y2="375" stroke="#333333" stroke-width="2" marker-end="url(#ah)"/>
<rect x="470" y="225" width="390" height="295" rx="6" fill="#ffffff" stroke="#333333" stroke-width="2" stroke-dasharray="8,4"/>
<text x="665" y="248" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="20" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">New Agent (after directed modification)</text>
<rect x="480" y="265" width="180" height="124" rx="6" fill="#d0d0d0" stroke="#333333" stroke-width="2"/>
<text x="570" y="285" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">New system prompt</text>
<text x="490" y="308" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="7.5" fill="#333333" text-anchor="start" dominant-baseline="central" font-weight="normal">You are an e-commerce customer service agent</text>
<text x="490" y="326" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central" font-weight="normal">Refund rules: ...</text>
<text x="490" y="344" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central" font-weight="normal">Logistics inquiry: ...</text>
<text x="490" y="362" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central" font-weight="normal">Tool: refund_order</text>
<rect x="670" y="265" width="180" height="124" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2"/>
<text x="760" y="285" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="14" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">Inherited framework code</text>
<text x="680" y="308" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central">loop:</text>
<text x="680" y="326" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central"> msg = llm(ctx)</text>
<text x="680" y="344" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central"> if tool_call:</text>
<text x="680" y="362" font-family="'Courier New', Courier, monospace" font-size="12" fill="#333333" text-anchor="start" dominant-baseline="central"> exec(tool)</text>
<rect x="480" y="400" width="370" height="54" rx="4" fill="#f5f5f5" stroke="#999999" stroke-width="2"/>
<text x="665" y="419" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="normal">New tools + new business logic</text>
<text x="665" y="438" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="13.5" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">Architecture framework fully inherited → quality guaranteed</text>
</svg>