AI 代理人互動式教學

從理論基礎到生產實作——12 個主題帶你掌握 AI Agent 的完整版圖,含互動模擬、Python/JS 雙語範例與 2026 最新工具鏈。

From theory to production — master AI Agents in 12 topics with interactive simulations, Python/JS examples, and 2026's latest toolchain.

01 核心概念與基礎

🤖
Step 1

什麼是 AI 代理人?

從經典 AI 教科書到 LLM 時代:定義、PEAS、代理人類型,以及現代 LLM Agent 的核心配方。

From classical AI textbooks to the LLM era: definitions, PEAS, agent types, and the modern LLM Agent recipe.

🧠
Step 2

LLM 作為大腦

Tokenization、context window、temperature 與 sampling:理解 Agent 推理引擎的關鍵特性與限制。

Tokenization, context window, temperature & sampling: key properties and limits of the agent's reasoning engine.

💬
Step 3

Prompt 工程

System prompt 設計、角色工程、few-shot、Chain-of-Thought 與結構化輸出。

System prompt design, role engineering, few-shot, Chain-of-Thought, and structured output.

02 Agent 核心元件

🔧
Step 4

工具呼叫

Function calling 規格、JSON schema 設計、工具描述、錯誤處理與並行工具呼叫。

Function calling spec, JSON schema design, tool descriptions, error handling, and parallel tool calls.

🧩
Step 5

記憶系統

工作記憶、情節記憶、語意記憶與長期記憶:用向量檢索與知識圖譜串起跨任務一致性。

Working, episodic, semantic, and long-term memory — vector search and knowledge graphs for cross-task consistency.

🗺️
Step 6

規劃與推理

ReAct、Plan-and-Execute、Tree-of-Thoughts 與 Reflection:四種主流規劃迴圈解析。

ReAct, Plan-and-Execute, Tree-of-Thoughts, and Reflection — four mainstream planning loops dissected.

03 進階能力

📚
Step 7

RAG 檢索增強

Chunking、embedding、hybrid search、rerank 與 Agentic RAG——讓 Agent 擁有可信知識。

Chunking, embedding, hybrid search, rerank, and Agentic RAG — grounding agents in trustworthy knowledge.

👥
Step 8

多代理人系統

Supervisor、Swarm、Debate、Hierarchical:協作模式、訊息協定與 hand-off 設計。

Supervisor, swarm, debate, hierarchical: collaboration patterns, message protocols, and hand-off design.

📊
Step 9

Agent 評估

Outcome vs trajectory metrics、SWE-bench / GAIA / TAU-bench、觀測與成本追蹤。

Outcome vs trajectory metrics, SWE-bench / GAIA / TAU-bench, observability, and cost tracking.

04 生產實戰與生態

⚙️
Advanced

框架比較

LangGraph、CrewAI、AutoGen / AG2、LlamaIndex Agents、OpenAI Agents SDK——選擇指南。

LangGraph, CrewAI, AutoGen/AG2, LlamaIndex Agents, OpenAI Agents SDK — a selection guide.

🔌
Advanced

MCP 協定

2024 年發布、2025 年成為 Linux Foundation 標準的 Model Context Protocol:工具/資源/Prompt 三原語。

Released 2024, Linux Foundation–hosted in 2025: Model Context Protocol's tools / resources / prompts primitives.

🛡️
Advanced

安全與部署

OWASP Top 10 for Agentic Apps、prompt injection、tool misuse、護欄設計與生產監控。

OWASP Top 10 for Agentic Apps, prompt injection, tool misuse, guardrails, and production monitoring.

05 延伸學習

📚
References

參考資料佐證

12 主題的學術論文、官方規格、廠商指南與 benchmark 完整整理,附 arXiv / DOI 連結與疑義注記。

Academic papers, official specs, vendor guides, and benchmarks for all 12 topics — with arXiv/DOI links and errata notes.

📝
Quiz

互動式考題

涵蓋 12 主題的單選、多選、是非題,內建錯題複習、隨機練習、考試模式與多使用者進度。

Single-choice, multi-select, and true/false questions covering all 12 topics, with wrong-answer review, random practice, exam mode, and multi-user progress tracking.

06 如何使用本教學

🎯
Path A

初學路線

建議依序閱讀 Step 1 → Step 9,每章末完成 Quiz;不必死記程式碼,先抓概念與直覺。

Read sequentially Step 1 → 9; do each chapter's quiz. Don't memorize code — build intuition first.

🔬
Path B

工程師路線

直接從 Step 4 (Tool Use) 進入,搭配 Step 6 (Planning)、Step 10 (Frameworks)、Step 11 (MCP)。

Jump to Step 4 (Tool Use), then Step 6 (Planning), Step 10 (Frameworks), and Step 11 (MCP).

🏗️
Path C

生產路線

關心如何部署、評估與安全:聚焦 Step 9 (Eval)、Step 12 (Safety) 與 Step 10 (Frameworks)。

Focus on shipping: Step 9 (Eval), Step 12 (Safety), and Step 10 (Frameworks).