diff --git a/content/en/docs/eino/core_modules/eino_adk/agent_collaboration.md b/content/en/docs/eino/core_modules/eino_adk/agent_collaboration.md index 6ab904943ea..550a5e248b9 100644 --- a/content/en/docs/eino/core_modules/eino_adk/agent_collaboration.md +++ b/content/en/docs/eino/core_modules/eino_adk/agent_collaboration.md @@ -15,7 +15,7 @@ ADK defines collaboration and composition primitives to build multi‑agent syst - Collaboration mode - +
@@ -23,7 +23,7 @@ ADK defines collaboration and composition primitives to build multi‑agent syst - Input context strategy -
ModeDescription
TransferHand off the task to another agent. The current agent exits and does not wait for the child agent’s completion.
ToolCall (AgentAsTool)Treat an agent as a tool, wait for its response, and use the output for subsequent processing.
+
@@ -31,7 +31,7 @@ ADK defines collaboration and composition primitives to build multi‑agent syst - Decision autonomy -
StrategyDescription
Upstream full dialogueReceive complete conversation history from upstream agents.
New task descriptionIgnore upstream dialogue and generate a fresh summary as input for the child agent.
+
@@ -39,7 +39,7 @@ ADK defines collaboration and composition primitives to build multi‑agent syst ## Composition Types -
AutonomyDescription
AutonomousAgent internally selects downstream agents (often via LLM) when needed. Even preset logic is considered autonomous from the outside.
PresetAgent execution order is predetermined and predictable.
+
@@ -61,7 +61,7 @@ Concept By default, assistant/tool messages from other agents are converted into user messages. This tells the current LLM: “Agent_A called some_tool with some_result. Now it’s your turn to decide.” It treats other agents’ behavior as external information rather than the current agent’s own actions, avoiding role confusion. - + Filtering by RunPath @@ -71,12 +71,12 @@ Definition: RunPathA “belongs to” RunPathB when RunPathA equals RunPathB or Examples of RunPath in different orchestrations: -
TypeDescriptionDiagramCollabContextDecision
SubAgentsBuild a parent agent with a list of named subagents, forming a tree. Agent names must be unique within the tree.TransferUpstream full dialogueAutonomous
SequentialRun subagents in order once, then finish.TransferUpstream full dialoguePreset
+
- - + + - +
ExampleRunPath
  • Agent: [Agent]
  • SubAgent: [Agent, SubAgent]
  • Agent: [Agent]
  • Agent (after function call): [Agent]
  • Agent: [Agent]
  • SubAgent: [Agent, SubAgent]
  • Agent: [Agent]
  • Agent (after function call): [Agent]
  • Agent1: [SequentialAgent, LoopAgent, Agent1]
  • Agent2: [SequentialAgent, LoopAgent, Agent1, Agent2]
  • Agent1: [SequentialAgent, LoopAgent, Agent1, Agent2, Agent1]
  • Agent2: [SequentialAgent, LoopAgent, Agent1, Agent2, Agent1, Agent2]
  • Agent3: [SequentialAgent, LoopAgent, Agent3]
  • Agent4: [SequentialAgent, LoopAgent, Agent3, ParallelAgent, Agent4]
  • Agent5: [SequentialAgent, LoopAgent, Agent3, ParallelAgent, Agent5]
  • Agent6: [SequentialAgent, LoopAgent, Agent3, ParallelAgent, Agent6]
  • Agent: [Agent]
  • SubAgent: [Agent, SubAgent]
  • Agent: [Agent, SubAgent, Agent]
  • Agent: [Agent]
  • SubAgent: [Agent, SubAgent]
  • Agent: [Agent, SubAgent, Agent]
  • Customize via `WithHistoryRewriter`: @@ -366,7 +366,7 @@ func AgentWithDeterministicTransferTo(_ context.Context, config *DeterministicTr Used by Supervisor to ensure subagents return control deterministically: - + ```go // github.com/cloudwego/eino/adk/prebuilt/supervisor.go @@ -404,7 +404,7 @@ See details and examples: `/docs/eino/core_modules/eino_adk/agent_implementation Run a series of agents in the provided order: - + ```go type SequentialAgentConfig struct { @@ -420,7 +420,7 @@ func NewSequentialAgent(ctx context.Context, config *SequentialAgentConfig) (Age Based on SequentialAgent; after completing one run, it starts from the beginning again: - + ```go type LoopAgentConfig struct { @@ -438,7 +438,7 @@ func NewLoopAgent(ctx context.Context, config *LoopAgentConfig) (Agent, error) Run agents concurrently: - + ```go type ParallelAgentConfig struct { diff --git a/content/zh/docs/eino/core_modules/eino_adk/agent_collaboration.md b/content/zh/docs/eino/core_modules/eino_adk/agent_collaboration.md index d4fa337d985..39f580318be 100644 --- a/content/zh/docs/eino/core_modules/eino_adk/agent_collaboration.md +++ b/content/zh/docs/eino/core_modules/eino_adk/agent_collaboration.md @@ -15,7 +15,7 @@ weight: 4 - Agent 间协作方式 - +
    @@ -23,7 +23,7 @@ weight: 4 - AgentInput 的上下文策略 -
    协作方式描述
    Transfer直接将任务转让给另外一个 Agent,本 Agent 则执行结束后退出,不关心转让 Agent 的任务执行状态
    ToolCall(AgentAsTool)将 Agent 当成 ToolCall 调用,等待 Agent 的响应,并可获取被调用Agent 的输出结果,进行下一轮处理
    +
    @@ -31,14 +31,14 @@ weight: 4 - 决策自主性 -
    上下文策略描述
    上游 Agent 全对话获取本 Agent 的上游 Agent 的完整对话记录
    全新任务描述忽略掉上游 Agent 的完整对话记录,给出一个全新的任务总结,作为子 Agent 的 AgentInput 输入
    +
    决策自主性描述
    自主决策在 Agent 内部,基于其可选的下游 Agent, 如需协助时,自主选择下游 Agent 进行协助。 一般来说,Agent 内部是基于 LLM 进行决策,不过即使是基于预设逻辑进行选择,从 Agent 外部看依然视为自主决策
    预设决策事先预设好一个Agent 执行任务后的下一个 Agent。 Agent 的执行顺序是事先确定、可预测的
    - 组合原语 - +
    @@ -61,7 +61,7 @@ History 对应【上游 Agent 全对话上下文策略】,多 Agent 系统中 通过这种方式,其他 Agent 的行为被当作了提供给当前 Agent 的“外部信息”或“事实陈述”,而不是它自己的行为,从而避免了 LLM 的上下文混乱。 - + 在 Eino ADK 中,当为一个 Agent 构建 AgentInput 时,它能看到的 History 是“所有在我之前产生的 AgentEvent”。 @@ -73,12 +73,12 @@ History 中每个 AgentEvent 都是由“特定 Agent 在特定的执行序列 下面表格中给出各种编排模式下,Agent 执行时的具体 RunPath: -
    类型描述运行模式协作方式上下文策略决策自主性
    SubAgents将用户提供的 agent 作为 父Agent,用户提供的 subAgents 列表作为 子Agents,组合而成可自主决策的 Agent,其中的 Name 和 Description 作为该 Agent 的名称标识和描述。
  • 当前限定一个 Agent 只能有一个 父 Agent
  • 可采用 SetSubAgents 函数,构建 「多叉树」 形式的 Multi-Agent
  • 在这个「多叉树」中,AgentName 需要保持唯一
  • Transfer上游 Agent 全对话自主决策
    Sequential将用户提供的 SubAgents 列表,组合成按照顺序依次执行的 Sequential Agent,其中的 Name 和 Description 作为 Sequential Agent 的名称标识和描述。Sequential Agent 执行时,将 SubAgents 列表,按照顺序依次执行,直至将所有 Agent 执行一遍后结束。Transfer上游 Agent 全对话预设决策
    +
    - - + + - +
    ExampleRunPath
  • Agent: [Agent]
  • SubAgent: [Agent, SubAgent]
  • Agent: [Agent]
  • Agent(after function call): [Agent]
  • Agent: [Agent]
  • SubAgent: [Agent, SubAgent]
  • Agent: [Agent]
  • Agent(after function call): [Agent]
  • Agent1: [SequentialAgent, LoopAgent, Agent1]
  • Agent2: [SequentialAgent, LoopAgent, Agent1, Agent2]
  • Agent1: [SequentialAgent, LoopAgent, Agent1, Agent2, Agent1]
  • Agent2: [SequentialAgent, LoopAgent, Agent1, Agent2, Agent1, Agent2]
  • Agent3: [SequentialAgent, LoopAgent, Agent3]
  • Agent4: [SequentialAgent, LoopAgent, Agent3, ParallelAgent, Agent4]
  • Agent5: [SequentialAgent, LoopAgent, Agent3, ParallelAgent, Agent5]
  • Agent6: [SequentialAgent, LoopAgent, Agent3, ParallelAgent, Agent6]
  • Agent: [Agent]
  • SubAgent: [Agent, SubAgent]
  • Agent: [Agent, SubAgent, Agent]
  • Agent: [Agent]
  • SubAgent: [Agent, SubAgent]
  • Agent: [Agent, SubAgent, Agent]
  • #### 自定义 @@ -177,7 +177,7 @@ type OnSubAgents interface { 接下来以一个多功能对话 Agent 演示 Transfer 能力,目标是搭建一个可以查询天气或者与用户对话的 Agent,Agent 结构如下: - + 三个 Agent 均使用 ChatModelAgent 实现: @@ -405,7 +405,7 @@ func AgentWithDeterministicTransferTo(_ context.Context, config *DeterministicTr 在 Supervisor 模式中,子 Agent 执行完毕后固定回到 Supervisor,由 Supervisor 生成下一步任务目标。此时可以使用 AgentWithDeterministicTransferTo: - + ```go // github.com/cloudwego/eino/adk/prebuilt/supervisor.go @@ -443,7 +443,7 @@ WorkflowAgent 支持以代码中预设好的流程运行 Agents。Eino ADK 提 SequentialAgent 会按照你提供的顺序,依次执行一系列 Agent: - + ```go type SequentialAgentConfig struct { @@ -459,7 +459,7 @@ func NewSequentialAgent(ctx context.Context, config *SequentialAgentConfig) (Age LoopAgent 基于 SequentialAgent 实现,在 SequentialAgent 运行完成后,再次从头运行: - + ```go type LoopAgentConfig struct { @@ -477,7 +477,7 @@ func NewLoopAgent(ctx context.Context, config *LoopAgentConfig) (Agent, error) ParallelAgent 会并发运行若干 Agent: - + ```go type ParallelAgentConfig struct {