课程总览
项目目标
完成后你能做到:
- 理解 LLM 的工作原理(next-token prediction、token、向量、幻觉)
- 用 Python 流式调用 LLM、设计 prompt、估算 token
- 实现工具注册系统 + Agent 主循环(Function Calling)
- 区分并实现 ReAct、Plan-and-Solve、Reflection 三种 Agent 范式
- 从零实现上下文管理与向量记忆系统
- 搭建完整的 Coding Agent(5 个核心工具)
- 整合所有模块,部署为 CNB 仓库 NPC
每天的工作流
bash
# 1. 看讲义(lecture/)
# 2. 跑 Demo(lab/)
# 3. 补全 my-agent/ 里当天的模块
# 4. 跑测试验证
cd my-agent && python tests/test_llm.py # Day1
cd my-agent && python tests/test_tools.py # Day2
# ...目录结构
.
├── 01-meet-your-ai/ # Day1:讲义 + Demo
├── 02-tools-and-agent-loop/ # Day2:讲义 + Demo
├── 03-agent-patterns/ # Day3:讲义 + Demo
├── 04-context-and-memory/ # Day4:讲义 + Demo
├── 05-coding-agent-tools/ # Day5:讲义 + Demo
├── 06-coding-agent-integration/ # Day6:讲义 + Demo
├── 07-skills-and-npc/ # Day7:讲义 + Demo
├── 08-recap-and-final/ # Day8:总结
├── my-agent/ # ★ 你的核心产出(每天填空一个模块)
├── exercises/ # 配套练习题(代码填空 + 自动验证)
├── examples/ # 完整参考实现
└── assets/ # 封面与全局资源搭建路线
Day1: LLMClient ─┐
Day2: ToolRegistry ─┤
Day3: Agent Loop ─┤──→ Day6 拼装成完整 Agent ──→ Day7 加 Skills + 挂 NPC
Day4: Context + Memory ─┤
Day5: Coding Tools × 5 ─┘