你大概已经写过一个套壳聊天框,调过几次 API,也许还试过 AutoGPT —— 看着它自己跟自己聊了二十轮、烧了五美元、绕回原地。现在「agent」是 AI 圈最被滥用的词:每个框架都说自己在做 agent,每条推都在发 agent。这一章不教你建,先帮你把线画清:agent 到底是什么,以及更有用的那一半 —— 它不是什么。You've probably built a chat wrapper, called an API a few times, maybe even tried AutoGPT — and watched it talk to itself for twenty rounds, burn five dollars, and loop back to where it started. 'Agent' is now the most overloaded word in AI: every framework claims to build one, every other tweet ships one. This chapter doesn't teach you to build — it draws the line first: what an agent actually is, and the more useful half — what it isn't.这本书是一个从零动手的项目:从一个只会聊天的 LLM 出发,一章加一种能力,直到它能在真实环境里干活。但动手之前,得先有判断 —— 不然你会把一个本该是一行函数的活,建成一个会绕圈的 agent。This book is a hands-on project from zero: start with an LLM that only chats, add one capability per chapter, until it can do real work. But before the hands, you need judgment — otherwise you'll build a looping agent for a job that should have been a one-line function.动手有动手的对象。这本书从头到尾建同一个东西:一个研究 / 分析助手 —— 你给它一个问题,它去搜、去抓网页、在沙箱里跑分析代码、记住中间结论,最后回一份带引用的报告。每一章给它加一种能力,到最后你手里是一个完整、能跑的 agent,不是一堆零散片段。Hands-on needs something to work on. From start to finish this book builds one thing: a research / analysis assistant — you give it a question, it searches, fetches pages, runs analysis code in a sandbox, remembers intermediate findings, and returns a cited report. Each chapter adds it one capability, and by the end you hold a complete, runnable agent — not a pile of scattered snippets.这本书分两部分。第一部分把 agent 从 20 行循环建到能上生产 —— 工具、记忆、推理、MCP、多 agent、安全、评估、部署、选型。到那时它「能跑」。第二部分(企业篇)回答一个不同的问题:怎么让它值得被放进一家公司。这两件事的差距,不是一个更强的模型,而是一整层工程 —— 让 agent 可信地、规模化地、在别人的数据上、留得下审计地行动。这一层有八根支柱:身份鉴权、带权限的检索、对抗性安全、治理审计、常设评测、失败工程、控制平面、多租户。它们不是功能清单,是「能跑」到「企业级」之间那道差集。This book has two parts. Part one builds the agent from a 20-line loop to production-ready — tools, memory, reasoning, MCP, multi-agent, safety, evaluation, deployment, framework choice. By then it runs. Part two, the enterprise part, answers a different question: what makes it worth placing inside a company. The gap between the two is not a stronger model but a whole layer of engineering — letting the agent act trustworthily, at scale, on other people's data, with an audit trail left behind. That layer has eight pillars: identity and auth, permission-aware retrieval, adversarial security, governance and audit, standing evaluation, failure engineering, a control plane, and multi-tenancy. Not a feature list — the difference set between 'runs' and 'enterprise-grade.'
— I
Agent 不是更大的 promptAn Agent Is Not a Bigger Prompt.
把 prompt 写长、把对话拉长,都不会变成 agent。分界只有一条:下一步是谁决定的。A longer prompt or a longer conversation never becomes an agent. There is one dividing line: who decides the next step.Anthropic 把这类系统分两种:workflow 是「LLM 和工具被预定义的代码路径编排」,agent 是「LLM 自己动态决定流程和工具用法」。1注 1Note 1Anthropic · 「Building Effective Agents」(Erik Schluntz、Barry Zhang,2024-12-19)—— 区分 workflow(LLM 与工具被预定义代码路径编排)与 agent(LLM 自己动态决定流程与工具);建议「find the simplest solution possible」,只在复杂度确实改善结果时才加。并给出取舍:workflow 为定义清晰的任务提供可预测性与一致性,agent 以更高成本与误差累积(compounding errors)换灵活性 —— 宜配沙箱测试与护栏、在可信环境运行。Anthropic · 'Building Effective Agents' (Erik Schluntz, Barry Zhang, 2024-12-19) — distinguishes workflows (LLMs and tools orchestrated through predefined code paths) from agents (LLMs dynamically directing their own process and tools); advises finding the simplest solution and adding complexity only when it demonstrably improves outcomes. And states the trade-off: workflows offer predictability and consistency for well-defined tasks, while agents trade higher costs and the potential for compounding errors for flexibility — best run with sandboxed testing, guardrails, and trusted environments.区别不在规模,在自主权 —— 流程图是你写死的,还是模型在运行时自己挑的。Anthropic splits these systems in two: a workflow is one where 'LLMs and tools are orchestrated through predefined code paths,' while an agent is one where 'LLMs dynamically direct their own processes and tool usage.'1注 1Note 1Anthropic · 「Building Effective Agents」(Erik Schluntz、Barry Zhang,2024-12-19)—— 区分 workflow(LLM 与工具被预定义代码路径编排)与 agent(LLM 自己动态决定流程与工具);建议「find the simplest solution possible」,只在复杂度确实改善结果时才加。并给出取舍:workflow 为定义清晰的任务提供可预测性与一致性,agent 以更高成本与误差累积(compounding errors)换灵活性 —— 宜配沙箱测试与护栏、在可信环境运行。Anthropic · 'Building Effective Agents' (Erik Schluntz, Barry Zhang, 2024-12-19) — distinguishes workflows (LLMs and tools orchestrated through predefined code paths) from agents (LLMs dynamically directing their own process and tools); advises finding the simplest solution and adding complexity only when it demonstrably improves outcomes. And states the trade-off: workflows offer predictability and consistency for well-defined tasks, while agents trade higher costs and the potential for compounding errors for flexibility — best run with sandboxed testing, guardrails, and trusted environments. The difference is not scale but autonomy — whether you hard-coded the flowchart, or the model picks the path at run time.多数人以为自己要的是 agent,其实要的是 workflow。Anthropic 的建议很直接:先找最简单的方案,只在复杂度确实改善结果时才加。1注 1Note 1Anthropic · 「Building Effective Agents」(Erik Schluntz、Barry Zhang,2024-12-19)—— 区分 workflow(LLM 与工具被预定义代码路径编排)与 agent(LLM 自己动态决定流程与工具);建议「find the simplest solution possible」,只在复杂度确实改善结果时才加。并给出取舍:workflow 为定义清晰的任务提供可预测性与一致性,agent 以更高成本与误差累积(compounding errors)换灵活性 —— 宜配沙箱测试与护栏、在可信环境运行。Anthropic · 'Building Effective Agents' (Erik Schluntz, Barry Zhang, 2024-12-19) — distinguishes workflows (LLMs and tools orchestrated through predefined code paths) from agents (LLMs dynamically directing their own process and tools); advises finding the simplest solution and adding complexity only when it demonstrably improves outcomes. And states the trade-off: workflows offer predictability and consistency for well-defined tasks, while agents trade higher costs and the potential for compounding errors for flexibility — best run with sandboxed testing, guardrails, and trusted environments.一个能用固定步骤说清的活,写成 agent 只会更慢、更贵、更难调。Most people think they want an agent when they want a workflow. Anthropic's advice is blunt: find the simplest solution first, and add complexity only when it demonstrably improves outcomes.1注 1Note 1Anthropic · 「Building Effective Agents」(Erik Schluntz、Barry Zhang,2024-12-19)—— 区分 workflow(LLM 与工具被预定义代码路径编排)与 agent(LLM 自己动态决定流程与工具);建议「find the simplest solution possible」,只在复杂度确实改善结果时才加。并给出取舍:workflow 为定义清晰的任务提供可预测性与一致性,agent 以更高成本与误差累积(compounding errors)换灵活性 —— 宜配沙箱测试与护栏、在可信环境运行。Anthropic · 'Building Effective Agents' (Erik Schluntz, Barry Zhang, 2024-12-19) — distinguishes workflows (LLMs and tools orchestrated through predefined code paths) from agents (LLMs dynamically directing their own process and tools); advises finding the simplest solution and adding complexity only when it demonstrably improves outcomes. And states the trade-off: workflows offer predictability and consistency for well-defined tasks, while agents trade higher costs and the potential for compounding errors for flexibility — best run with sandboxed testing, guardrails, and trusted environments. A job you can spell out in fixed steps only gets slower, costlier, and harder to debug as an agent.
— II
Agent 是一个循环An Agent Is a Loop.
剥掉所有框架,agent 就是一个循环:感知、决策、行动、观察,然后再来。Strip away every framework and an agent is a loop: perceive, decide, act, observe, then again.每一轮,模型看到目标和当前的观察,决定调哪个工具;工具的结果回灌成下一轮的观察,直到任务完成或触发停止条件。ReAct 把这个循环写成「推理和行动交替」。2注 2Note 2Yao et al. · 「ReAct: Synergizing Reasoning and Acting in Language Models」(2022,arXiv:2210.03629)—— 把推理(reason)与行动(act)交替成一个循环,是 Agent 循环的奠基论文之一。Yao et al. · 'ReAct: Synergizing Reasoning and Acting in Language Models' (2022, arXiv:2210.03629) — interleaves reasoning and acting into a loop; one of the founding papers behind the agent loop.用伪代码写出来就这么短:Each round, the model sees the goal and the current observation, and decides which tool to call; the tool's result feeds back as the next observation, until the task finishes or a stop condition fires. ReAct frames this loop as interleaving reasoning and acting.2注 2Note 2Yao et al. · 「ReAct: Synergizing Reasoning and Acting in Language Models」(2022,arXiv:2210.03629)—— 把推理(reason)与行动(act)交替成一个循环,是 Agent 循环的奠基论文之一。Yao et al. · 'ReAct: Synergizing Reasoning and Acting in Language Models' (2022, arXiv:2210.03629) — interleaves reasoning and acting into a loop; one of the founding papers behind the agent loop. In pseudocode it is this short:
while not done: decision = model(goal, observations) # 决策:下一步做什么 if decision.is_final: # 模型认为完成了 return decision.answer result = run_tool(decision.tool, decision.args) # 行动 observations.append(result) # 观察,喂回下一轮
Agent 的本质:一个循环The essence of an agent: a loop
循环本身很小 —— 这就是为什么第二章用 20 行代码就能写出一个能工作的 agent。难的不是循环,是循环里的每一格:工具怎么定义、记忆放哪、推理怎么不跑偏、安全怎么兜底。3注 3Note 3Lilian Weng · 「LLM Powered Autonomous Agents」(2023-06)—— 把 Agent 拆成 planning / memory / tool use 三块的高引用综述,作者时任 OpenAI 研究员。作为概念地图使用。Lilian Weng · 'LLM Powered Autonomous Agents' (2023-06) — a widely cited overview decomposing agents into planning / memory / tool use, by a then-OpenAI researcher. Used as a concept map.这本书剩下的章节,就是逐格把它做实。The loop itself is tiny — which is why chapter 2 builds a working agent in twenty lines. The hard part isn't the loop, it's each slot inside it: how tools are defined, where memory lives, how reasoning stays on track, how safety holds.3注 3Note 3Lilian Weng · 「LLM Powered Autonomous Agents」(2023-06)—— 把 Agent 拆成 planning / memory / tool use 三块的高引用综述,作者时任 OpenAI 研究员。作为概念地图使用。Lilian Weng · 'LLM Powered Autonomous Agents' (2023-06) — a widely cited overview decomposing agents into planning / memory / tool use, by a then-OpenAI researcher. Used as a concept map. The rest of this book fills those slots in, one at a time.这套「循环外面的每一格」,2026 年的行业有一个统一的名字:harness —— 包住模型的全部运行时工程,循环、工具、上下文管理、恢复策略都算。它的分量,Anthropic 自己测过:即便 Opus 4.5 这样的前沿编码模型,跑在官方 Agent SDK 的循环里、跨多个上下文窗口,只给一句高层 prompt,开箱也造不出一个生产质量的 web 应用 —— 模型没变,差距全在 harness 给没给它结构。6注 6Note 6Anthropic · 「Effective harnesses for long-running agents」(2025-11-26)—— harness 决定长时程表现的实测:「Out of the box, even a frontier coding model like Opus 4.5 running on the Claude Agent SDK in a loop across multiple context windows will fall short of building a production-quality web app if it's only given a high-level prompt」(开箱状态下,即便 Opus 4.5 这样的前沿编码模型,只给一句高层 prompt 也造不出生产质量的 web 应用);解法是给结构 —— 初始化 agent、feature list、增量推进。Anthropic · 'Effective harnesses for long-running agents' (2025-11-26) — measured proof that the harness decides long-horizon performance: 'Out of the box, even a frontier coding model like Opus 4.5 running on the Claude Agent SDK in a loop across multiple context windows will fall short of building a production-quality web app if it's only given a high-level prompt'; the fix is structure — an initializer agent, feature lists, incremental progress.所以行业的注意力正在从「谁的模型强」移向「谁的 harness 能把模型的强兑现」:模型一年一跳,harness 才是同代产品真正拉开差距的那一层。Anthropic 的年度趋势报告把这场转移压成一句 ——「软件开发正在从写代码,转向编排写代码的 agent」。7注 7Note 7Anthropic · 「2026 Agentic Coding Trends Report」—— 年度趋势坐标系,主题句:「Software development is shifting from writing code to orchestrating agents that write code」(软件开发正在从写代码,转向编排写代码的 agent)。截至 2026-07。Anthropic · '2026 Agentic Coding Trends Report' — the annual trends frame; thesis line: 'Software development is shifting from writing code to orchestrating agents that write code.' As of 2026-07.这本书教你亲手搭的,正是这一层。This 'every slot around the loop' has, as of 2026, one settled industry name: the harness — all the runtime engineering wrapped around the model: loop, tools, context management, recovery strategy. Anthropic measured its weight: even a frontier coding model like Opus 4.5, running in the official Agent SDK's loop across multiple context windows, will fall short of building a production-quality web app out of the box if it's only given a high-level prompt — same model; the gap is whether the harness gives it structure.6注 6Note 6Anthropic · 「Effective harnesses for long-running agents」(2025-11-26)—— harness 决定长时程表现的实测:「Out of the box, even a frontier coding model like Opus 4.5 running on the Claude Agent SDK in a loop across multiple context windows will fall short of building a production-quality web app if it's only given a high-level prompt」(开箱状态下,即便 Opus 4.5 这样的前沿编码模型,只给一句高层 prompt 也造不出生产质量的 web 应用);解法是给结构 —— 初始化 agent、feature list、增量推进。Anthropic · 'Effective harnesses for long-running agents' (2025-11-26) — measured proof that the harness decides long-horizon performance: 'Out of the box, even a frontier coding model like Opus 4.5 running on the Claude Agent SDK in a loop across multiple context windows will fall short of building a production-quality web app if it's only given a high-level prompt'; the fix is structure — an initializer agent, feature lists, incremental progress. So the industry's attention is shifting from 'whose model is stronger' to 'whose harness cashes that strength out': models leap yearly, and the harness is where same-generation products actually pull apart. Anthropic's annual trends report compresses the shift into one line — 'Software development is shifting from writing code to orchestrating agents that write code.'7注 7Note 7Anthropic · 「2026 Agentic Coding Trends Report」—— 年度趋势坐标系,主题句:「Software development is shifting from writing code to orchestrating agents that write code」(软件开发正在从写代码,转向编排写代码的 agent)。截至 2026-07。Anthropic · '2026 Agentic Coding Trends Report' — the annual trends frame; thesis line: 'Software development is shifting from writing code to orchestrating agents that write code.' As of 2026-07. That layer is exactly what this book teaches you to build by hand.
— III
什么时候不该建 AgentWhen Not to Build an Agent.
agent 不是默认选项,是最后选项。能用一次 LLM 调用解决的,别上循环。An agent is not the default option — it is the last one. If a single LLM call solves it, don't put it in a loop.循环是有代价的:每一轮都可能跑偏,多轮意味着更多 token、更高延迟、更难复现的 bug。判断标准是步骤数固不固定 —— 步骤固定、路径已知,那是 workflow 或一个函数;步骤数取决于中间结果(比如「修一个还不知道在哪的 bug」),才轮得到 agent。1注 1Note 1Anthropic · 「Building Effective Agents」(Erik Schluntz、Barry Zhang,2024-12-19)—— 区分 workflow(LLM 与工具被预定义代码路径编排)与 agent(LLM 自己动态决定流程与工具);建议「find the simplest solution possible」,只在复杂度确实改善结果时才加。并给出取舍:workflow 为定义清晰的任务提供可预测性与一致性,agent 以更高成本与误差累积(compounding errors)换灵活性 —— 宜配沙箱测试与护栏、在可信环境运行。Anthropic · 'Building Effective Agents' (Erik Schluntz, Barry Zhang, 2024-12-19) — distinguishes workflows (LLMs and tools orchestrated through predefined code paths) from agents (LLMs dynamically directing their own process and tools); advises finding the simplest solution and adding complexity only when it demonstrably improves outcomes. And states the trade-off: workflows offer predictability and consistency for well-defined tasks, while agents trade higher costs and the potential for compounding errors for flexibility — best run with sandboxed testing, guardrails, and trusted environments.The loop has a cost: every round can drift, and more rounds mean more tokens, higher latency, and bugs that are harder to reproduce. The test is whether the number of steps is fixed — fixed steps on a known path is a workflow or a function; a step count that depends on intermediate results (say, 'fix a bug you can't yet locate') is where an agent earns its place.1注 1Note 1Anthropic · 「Building Effective Agents」(Erik Schluntz、Barry Zhang,2024-12-19)—— 区分 workflow(LLM 与工具被预定义代码路径编排)与 agent(LLM 自己动态决定流程与工具);建议「find the simplest solution possible」,只在复杂度确实改善结果时才加。并给出取舍:workflow 为定义清晰的任务提供可预测性与一致性,agent 以更高成本与误差累积(compounding errors)换灵活性 —— 宜配沙箱测试与护栏、在可信环境运行。Anthropic · 'Building Effective Agents' (Erik Schluntz, Barry Zhang, 2024-12-19) — distinguishes workflows (LLMs and tools orchestrated through predefined code paths) from agents (LLMs dynamically directing their own process and tools); advises finding the simplest solution and adding complexity only when it demonstrably improves outcomes. And states the trade-off: workflows offer predictability and consistency for well-defined tasks, while agents trade higher costs and the potential for compounding errors for flexibility — best run with sandboxed testing, guardrails, and trusted environments.把这条判断展开,就是 2026 年通行的决策框架:步骤能预先枚举、判定标准明确、错了代价高的活,交给确定性工作流 —— 它给你可预测和一致;路径没法预先写死、要一边探索一边调整的活,才交给自由循环的 agent —— 它拿更高的成本和会累积的误差换灵活性,所以要配上沙箱测试和护栏、放在可信的环境里跑。1注 1Note 1Anthropic · 「Building Effective Agents」(Erik Schluntz、Barry Zhang,2024-12-19)—— 区分 workflow(LLM 与工具被预定义代码路径编排)与 agent(LLM 自己动态决定流程与工具);建议「find the simplest solution possible」,只在复杂度确实改善结果时才加。并给出取舍:workflow 为定义清晰的任务提供可预测性与一致性,agent 以更高成本与误差累积(compounding errors)换灵活性 —— 宜配沙箱测试与护栏、在可信环境运行。Anthropic · 'Building Effective Agents' (Erik Schluntz, Barry Zhang, 2024-12-19) — distinguishes workflows (LLMs and tools orchestrated through predefined code paths) from agents (LLMs dynamically directing their own process and tools); advises finding the simplest solution and adding complexity only when it demonstrably improves outcomes. And states the trade-off: workflows offer predictability and consistency for well-defined tasks, while agents trade higher costs and the potential for compounding errors for flexibility — best run with sandboxed testing, guardrails, and trusted environments.而真实的生产系统大多两者都有:工作流做骨架,把其中开放式的子任务挖出来,交给 agent 去填。这本书把 agent 这一格教扎实,是为了让你把它嵌对位置 —— 不是把所有东西都改写成 agent。Unfold that test and you get the decision framework 2026 settled on: work whose steps can be enumerated in advance, whose pass criterion is well-defined, and whose failures are costly goes to a deterministic workflow — it gives you predictability and consistency; only work whose path can't be scripted ahead, needing exploration and adjustment as it goes, goes to a free-running agent — which trades higher costs and compounding errors for flexibility, so pair it with sandboxed testing, guardrails, and a trusted environment.1注 1Note 1Anthropic · 「Building Effective Agents」(Erik Schluntz、Barry Zhang,2024-12-19)—— 区分 workflow(LLM 与工具被预定义代码路径编排)与 agent(LLM 自己动态决定流程与工具);建议「find the simplest solution possible」,只在复杂度确实改善结果时才加。并给出取舍:workflow 为定义清晰的任务提供可预测性与一致性,agent 以更高成本与误差累积(compounding errors)换灵活性 —— 宜配沙箱测试与护栏、在可信环境运行。Anthropic · 'Building Effective Agents' (Erik Schluntz, Barry Zhang, 2024-12-19) — distinguishes workflows (LLMs and tools orchestrated through predefined code paths) from agents (LLMs dynamically directing their own process and tools); advises finding the simplest solution and adding complexity only when it demonstrably improves outcomes. And states the trade-off: workflows offer predictability and consistency for well-defined tasks, while agents trade higher costs and the potential for compounding errors for flexibility — best run with sandboxed testing, guardrails, and trusted environments. And real production systems mostly have both: a workflow as the skeleton, with the open-ended subtasks carved out and handed to an agent. This book teaches the agent slot thoroughly so you can embed it in the right place — not rewrite everything as one.反过来,什么时候它才值得建?OpenAI 的实践指南给了三类信号:要细腻判断(带例外、看情境的决策)、规则多到难维护、或重度依赖非结构化数据 —— 它把规则引擎比作一张清单,把 agent 比作一个会权衡情境的老练调查员。三样都不沾,确定性方案就够了。4注 4Note 4OpenAI · 「A Practical Guide to Building Agents」(2025-04)—— 何时该建 agent 的三类信号:需细腻判断、规则多到难维护、重度依赖非结构化数据;并把规则引擎比作清单、把 agent 比作一个会权衡情境的老练调查员。OpenAI · 'A Practical Guide to Building Agents' (2025-04) — three signals that justify an agent: nuanced judgment, rulesets too tangled to maintain, heavy reliance on unstructured data; it likens a rules engine to a checklist and an agent to a seasoned investigator weighing context.Conversely, when is one worth building? OpenAI's practical guide names three signals: nuanced judgment (decisions with exceptions and context), rulesets too tangled to maintain, or heavy reliance on unstructured data — it likens a rules engine to a checklist and an agent to a seasoned investigator weighing context. If none apply, a deterministic solution suffices.4注 4Note 4OpenAI · 「A Practical Guide to Building Agents」(2025-04)—— 何时该建 agent 的三类信号:需细腻判断、规则多到难维护、重度依赖非结构化数据;并把规则引擎比作清单、把 agent 比作一个会权衡情境的老练调查员。OpenAI · 'A Practical Guide to Building Agents' (2025-04) — three signals that justify an agent: nuanced judgment, rulesets too tangled to maintain, heavy reliance on unstructured data; it likens a rules engine to a checklist and an agent to a seasoned investigator weighing context.所以这本书每一章都会先问一句「这一格值不值得建」,再教你怎么建。建得出来和该不该建,是两回事 —— 把这条记到每一章里。So every chapter here asks 'is this slot worth building' before showing how to build it. Being able to build something and whether you should are two different things — carry that into every chapter.这条「先问值不值」背后,是 AI 七十年的苦涩教训:能随算力扩展的通用方法(搜索与学习)终究大幅胜过人工堆进去的领域知识。落到 agent —— 拿不准时,把判断交给模型的通用推理加工具,别用一摞写死的逻辑去模拟它。Sutton 的原话是「我们要的是能像我们一样去发现的 AI,而不是装着我们已发现之物的 AI」。5注 5Note 5Richard Sutton · 「The Bitter Lesson」(2019-03-13)—— AI 七十年最大的教训:能随算力扩展的通用方法(搜索与学习)终究大幅胜过人工编入的领域知识;「我们要的是能像我们一样去发现的 AI,而不是装着我们已发现之物的 AI」。落到 agent:靠模型通用推理 + 工具,别堆手写逻辑。Richard Sutton · 'The Bitter Lesson' (2019-03-13) — AI's biggest lesson in 70 years: general methods that scale with computation (search and learning) ultimately beat hand-built domain knowledge by a large margin; 'we want AI agents that can discover like we can, not which contain what we have discovered.' For agents: lean on the model's general reasoning + tools, don't pile up hand-written logic.Behind that 'ask whether it's worth it' sits the bitter lesson of seventy years of AI research: general methods that scale with computation — search and learning — ultimately beat hand-built domain knowledge by a wide margin. For agents it means: when in doubt, hand the judgment to the model's general reasoning plus tools, rather than simulating it with a stack of hard-coded logic. In Sutton's words, 'we want AI agents that can discover like we can, not which contain what we have discovered.'5注 5Note 5Richard Sutton · 「The Bitter Lesson」(2019-03-13)—— AI 七十年最大的教训:能随算力扩展的通用方法(搜索与学习)终究大幅胜过人工编入的领域知识;「我们要的是能像我们一样去发现的 AI,而不是装着我们已发现之物的 AI」。落到 agent:靠模型通用推理 + 工具,别堆手写逻辑。Richard Sutton · 'The Bitter Lesson' (2019-03-13) — AI's biggest lesson in 70 years: general methods that scale with computation (search and learning) ultimately beat hand-built domain knowledge by a large margin; 'we want AI agents that can discover like we can, not which contain what we have discovered.' For agents: lean on the model's general reasoning + tools, don't pile up hand-written logic.动手 · 在写任何代码之前,先做一次分类:Hands-on · before writing any code, do one classification pass:
01
写下 3 个你想用「agent」解决的真实任务Write down 3 real tasks you'd want an 'agent' for
从你自己的工作里挑,越具体越好(不是「帮我处理邮件」,是「每天把 X 类邮件归类并起草回复」)。Pick from your own work, as specific as possible (not 'handle my email,' but 'classify X-type email daily and draft replies').
02
给每个任务贴一个标签Tag each task
三选一:(a) 其实一次 LLM 调用就够、(b) 是固定步骤的 workflow、(c) 步骤数不固定、真需要 agent。One of three: (a) actually one LLM call, (b) a fixed-step workflow, (c) variable steps, a real agent.
03
数一数有几个真落在 (c)Count how many truly land in (c)
大概率多数是 (a) 或 (b)。剩下真正属于 (c) 的,才是你读这本书要建的东西 —— 其余的,省下循环的钱和麻烦。Most will likely be (a) or (b). The few that truly land in (c) are what you'll build with this book — for the rest, save the loop's cost and trouble.
把 prompt 写长不会变成 agent,
让它自己决定下一步才会。.
A longer prompt isn't an agent;
letting it decide the next step is..
Aklman Library
— 讨论Discussion
讨论Discussion.
评论区初始化中…Initializing comments…
01 / 01
没有匹配结果No matches.
换个关键词,或按 Esc 回到页面Try another keyword, or press Esc to return