构建有效的智能体
Over the past year, we've worked with dozens of teams building large language model (LLM) agents across industries. Consistently, the most successful implementations weren't using complex frameworks or specialized libraries. Instead, they were building with simple, composable patterns.
在过去的一年中,我们与数十个团队合作,构建跨行业的大型语言模型(LLM)智能体。成功的实现通常不是使用复杂的框架或专业库,而是使用简单、可组合的模式进行构建。
In this post, we share what we’ve learned from working with our customers and building agents ourselves, and give practical advice for developers on building effective agents.
在这篇文章中,我们分享了与客户合作和自己构建智能体的经验教训,并为开发者提供了构建有效智能体的实用建议。
What are agents?
什么是智能体?
"Agent" can be defined in several ways. Some customers define agents as fully autonomous systems that operate independently over extended periods, using various tools to accomplish complex tasks. Others use the term to describe more prescriptive implementations that follow predefined workflows. At Anthropic, we categorize all these variations as agentic systems, but draw an important architectural distinction between workflows and agents:
“智能体”可以通过多种方式定义。一些客户将智能体定义为在较长时间内独立操作的完全自主系统,使用各种工具来完成复杂任务。其他人则用这个术语来描述遵循预定义工作流的更具指导性的实现。在Anthropic,我们将所有这些变体归类为智能体系统,但在工作流和智能体之间划分了一个重要的架构区别:
- Workflows are systems where LLMs and tools are orchestrated through predefined code paths.
- 工作流是通过预定义代码路径协调LLM和工具的系统。
- Agents, on the other hand, are systems where LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks.
- 智能体,另一方面,是 LLM 动态指导其自身过程和工具使用的系统,保持对如何完成任务的控制。
Below, we will explore both types of agentic systems in detail. In Appendix 1 (“Agents in Practice”), we describe two domains where customers have found particular value in using these kinds of systems.
在下面,我们将详细探讨这两种类型的智能体系统。在附录1(“实践中的智能体”)中,我们描述了客户在使用这些系统时发现特别有价值的两个领域。
When (and when not) to use agents
何时(以及何时不)使用智能体
When building applications with LLMs, we recommend finding the simplest solution possible, and only increasing complexity when needed. This might mean not building agentic systems at all. Agentic sy...