agents.multi.experiments.list_multi_agent¶
List-based multi-agent implementation.
from typing import Any A clean, simple multi-agent that acts like a Python list of agents. Focus on composition and orchestration, not complex state management.
Classes¶
Multi-agent system that works like a Python list. |
Functions¶
|
Create a pipeline of agents (alias for sequential). |
|
Create a sequential multi-agent from agents. |
Module Contents¶
- class agents.multi.experiments.list_multi_agent.ListMultiAgent¶
Bases:
haive.agents.base.agent.Agent
,haive.core.common.mixins.recompile_mixin.RecompileMixin
,collections.abc.Sequence
[haive.agents.base.agent.Agent
]Multi-agent system that works like a Python list.
Simple, clean interface for composing agents: - Append, insert, remove agents like a list - Agents execute in sequence by default - Each agent manages its own tools/state - Message passing between agents
Examples
multi = ListMultiAgent("my_system") multi.append(PlannerAgent()) multi.append(ResearchAgent()) multi.append(WriterAgent()) result = multi.invoke({"messages": [HumanMessage("Write about AI")]})
- append(agent)¶
Add agent to end of list.
- Parameters:
agent (haive.agents.base.agent.Agent)
- Return type:
- build_graph()¶
Build simple sequential graph.
- Return type:
haive.core.graph.state_graph.base_graph2.BaseGraph
- clear()¶
Remove all agents.
- Return type:
- get_agent_by_name(name)¶
Get agent by name.
- Parameters:
name (str)
- Return type:
haive.agents.base.agent.Agent | None
- insert(index, agent)¶
Insert agent at specific position.
- Parameters:
index (int)
agent (haive.agents.base.agent.Agent)
- Return type:
- pop(index=-1)¶
Remove and return agent at index.
- Parameters:
index (int)
- Return type:
haive.agents.base.agent.Agent
- remove(agent)¶
Remove agent by instance or name.
- Parameters:
agent (haive.agents.base.agent.Agent | str)
- Return type:
- setup_agent()¶
Setup the multi-agent system.
- Return type:
None
- then(agent)¶
Add next agent in chain (alias for append).
- Parameters:
agent (haive.agents.base.agent.Agent)
- Return type:
- agents.multi.experiments.list_multi_agent.pipeline(*agents, name='pipeline')¶
Create a pipeline of agents (alias for sequential).
- Parameters:
agents (haive.agents.base.agent.Agent)
name (str)
- Return type: