跳到主要内容

代理 (Agents)

Langflow 的 代理 (Agent) 组件是构建代理流的关键。 此组件定义了流中 AI 代理的行为和能力。

How do agents work?

Agents extend Large Language Models (LLMs) by integrating tools, which are functions that provide additional context and enable autonomous task execution. These integrations make agents more specialized and powerful than standalone LLMs.

Whereas an LLM might generate acceptable, inert responses to general queries and tasks, an agent can leverage the integrated context and tools to provide more relevant responses and even take action. For example, you might create an agent that can access your company's documentation, repositories, and other resources to help your team with tasks that require knowledge of your specific products, customers, and code.

Agents use LLMs as a reasoning engine to process input, determine which actions to take to address the query, and then generate a response. The response could be a typical text-based LLM response, or it could involve an action, like editing a file, running a script, or calling an external API.

In an agentic context, tools are functions that the agent can run to perform tasks or access external resources. A function is wrapped as a Tool object with a common interface that the agent understands. Agents become aware of tools through tool registration, which is when the agent is provided a list of available tools typically at agent initialization. The Tool object's description tells the agent what the tool can do so that it can decide whether the tool is appropriate for a given request.

代理流示例

有关使用 代理 (Agent) 组件的流示例,请参阅以下内容:

代理 (Agent) 组件

代理 (Agent) 组件是代理流中的主要代理执行者。 此组件使用 LLM 集成来响应输入(例如聊天消息或文件上传)。

代理可以使用基础 LLM 中已有的工具,以及您连接到 代理 组件 工具 (Tools) 端口的其他工具。 您可以将任何 Langflow 组件连接为工具,包括其他 代理 组件,以及通过 MCP 工具 (MCP Tools) 组件 连接的 MCP 服务器。

有关使用此组件的更多信息,请参阅 使用 Langflow 代理

另请参阅

Search