Adventure 8
Adventure 8
Adventure 8
Adventure 8
Adventure 8
Adventure 8
Adventure 8
Adventure 8
原生 API | Framework | ||
需要写的代码 | 更多 | 更少 | |
做出第一个 agent 要多久 | 几小时 | 几分钟 | |
调你自己的代码 | 更容易 | 差不多 | |
调 framework 本身 | 不需要 | 难 | |
灵活度 | 完全自由 | 受限制 | |
换 provider | 更容易 | 通常要重写 |
Adventure 8
是什么:一个帮你处理 agent「管道工程」(state、errors、streaming)的库,让你少写代码。类比:懒人料理包 — 食材洗好切好分好。煮起来快,但没从零开始那么自由。为什么重要:大部分「agent 代码」都是管道。Framework 帮你省下 90% 的活,代价是在剩下 10% 里失去一些灵活度。
Adventure 8
Adventure 8
Adventure 8
Adventure 8
Adventure 8
Adventure 8
Do you NEED multiple specialized agents?
├── Yes → CrewAI
└── No (single agent is fine):
│
Locked to one model provider?
├── OpenAI only → OpenAI Assistants
├── Claude only → Claude Agent SDK
└── Want to switch / try many
→ LangChain (or raw API)Adventure 8
Adventure 8
Adventure 8
Adventure 8
Adventure 8
Adventure 8
是什么:一个开放协议,用标准方式描述 tool,这样任何兼容的 agent 都能用任何兼容的 tool。类比:USB。打印机厂商不会为每种电脑做一个专属接口 — 他们只实现 USB 一次,所有 USB 电脑都能用。为什么重要:Tool 写一次,所有 MCP agent 都能用。整个生态会快得多。
Adventure 8
Adventure 8
Adventure 8
@server.tool()
def get_random_number(min: int, max: int) -> int:
"""Return a random integer between min and max (inclusive)."""
return random.randint(min, max)get_random_number 出现在 tool 列表里Adventure 8
filesystem MCP server 让 agent 在你指定的文件夹里读写文件。read_file(path)write_file(path, content)list_directory(path)search_files(pattern)@server.tool() decoratormodelcontextprotocol/servers — 今晚就读一下。Adventure 8
@server.tool() decorator 写你的函数Adventure 8
read_email tool 在 Cursor 和 Claude Code 里都能用。」Adventure 8
是什么:一个小程序,把 tool 暴露给兼容 MCP 的 agent — 宣告、执行、返回。类比:USB 外设。打印机不在乎什么电脑插上来;它只说 USB。MCP server 只说 MCP。为什么重要:写一个 server 很简单;真正的价值是「即插即用」。写一次,每个 agent 都能用。
Adventure 8
filesystem | 在一个文件夹里读/写/列出文件 | |
github | 读 repo、issue、PR;在 issue 下评论 | |
postgres | 对数据库跑 SQL 查询 | |
slack | 读频道、发消息、搜索 | |
puppeteer | 驱动一个真实浏览器 — 跳转、点击、截图 | |
memory | 跨 session 的持久化 key-value 记忆 | |
fetch | 对任意 URL 发 HTTP GET,返回干净的文本 | |
gmail | 读收件箱、搜索邮件线程、起草邮件 | |
notion | 读写 Notion 的 page 和 database |
Adventure 8
~/.claude/mcp_settings.json 或者通过 Claude Code 的 UIAdventure 8
memory MCP server(跨 session 的持久笔记)到 Claude Code 里。一步一步一起来:modelcontextprotocol/servers repo,找到 memory server 的 README~/.claude/mcp_settings.jsonAdventure 8
memory.set()memory.get()memory.delete()Adventure 8
Adventure 8
User: "Plan my friend's birthday"
│
Orchestrator
╱ │ ╲
Researcher Planner Budgeter
╲ │ ╱
Orchestrator
│
Final answerAdventure 8
Adventure 8
Adventure 8
Adventure 8
Adventure 8
带一个你希望「有人能做个工具来解决」的问题来。它马上就会是你做出来的。
Adventure 8