How fcn06/swarm works
Swarm’s visible runtime is centered on multi-agent planning and execution: a client request reaches a planner, which creates or loads a workflow and sends it to an executor; the executor runs graph activities through agent, task, or tool invokers. Separate modules provide basic agents and MCP-based context and tool handling. The README also describes gateway, resilience, discovery, and evaluation capabilities, but gateway implementation paths are absent from the supplied tree; those branches are therefore not mapped. Edges reflect excerpted calls or explicit README statements, not inferred wiring.
Main entry points: planner_agent.rs Planner Agent · graph_orchestrator.rs Graph Orchestrator · agent.rs MCP Agent · mcp_client.rs MCP Client
Components 22
Planning
- Planner Agent
planner_agent/src/business_logic/planner_agent.rs
Workflow Execution
- Graph Orchestrator
workflow_management/src/graph/graph_orchestrator.rs - Condition Evaluator
workflow_management/src/tasks/condition_evaluator.rs - Agent Invoker
workflow_management/src/agent_communication/agent_invoker.rs - Task Invoker
workflow_management/src/tasks/task_invoker.rs - Tool Invoker
workflow_management/src/tools/tool_invoker.rs - A-star Planner
workflow_management/src/graph/a_star.rs
Agent Runtime
- Executor Agent
executor_agent/src/business_logic/executor_agent.rs - Basic Agent
basic_agent/src/business_logic/basic_agent.rs - Agent Factory
agent_factory/src/agent_factory.rs
MCP Runtime
- MCP Agent
mcp_runtime/src/mcp_agent_logic/agent.rs - Context Providers
mcp_runtime/src/mcp_agent_logic/context_providers.rs - Response Processing
mcp_runtime/src/mcp_agent_logic/process_response.rs - MCP Client
mcp_runtime/src/mcp_client/mcp_client.rs - Tool Conversion
mcp_runtime/src/mcp_tools/tools.rs - MCP Runtime
mcp_runtime/src/runtime/mcp_runtime.rs
Other components
- Workflow Client
planner_agent/bin/simple_workflow_agent_client.rs - LLM Provider
- Memory Service
- MCP Server
- Discovery Service
- Evaluation Service
Connections 17
- Workflow Client → Planner Agent: submits request
planner_agent/bin/simple_workflow_agent_client.rs - Planner Agent → LLM Provider: requests plan
planner_agent/src/business_logic/planner_agent.rs - Planner Agent → Executor Agent: sends task
planner_agent/src/business_logic/planner_agent.rs - Planner Agent → Discovery Service: queries capabilities
- Planner Agent → Evaluation Service: evaluates outcome
- Executor Agent → Graph Orchestrator: executes graph
- Graph Orchestrator → Condition Evaluator: evaluates conditions
workflow_management/src/graph/graph_orchestrator.rs - Graph Orchestrator → Agent Invoker: delegates agent work
workflow_management/src/graph/graph_orchestrator.rs - Graph Orchestrator → Task Invoker: invokes tasks
workflow_management/src/graph/graph_orchestrator.rs - Graph Orchestrator → Tool Invoker: invokes tools
workflow_management/src/graph/graph_orchestrator.rs - MCP Agent → MCP Client: calls tools
mcp_runtime/src/mcp_agent_logic/agent.rs - MCP Agent → Tool Conversion: formats tools
mcp_runtime/src/mcp_agent_logic/agent.rs - MCP Agent → Context Providers: assembles context
- Context Providers → Memory Service: reads history and facts
mcp_runtime/src/mcp_agent_logic/context_providers.rs - MCP Runtime → MCP Client: initializes client
mcp_runtime/src/runtime/mcp_runtime.rs - MCP Client → MCP Server: connects over HTTP
mcp_runtime/src/mcp_client/mcp_client.rs - MCP Agent → Response Processing: processes response