Skip to main content

Module swarm

Module swarm 

Source
Expand description

Swarm orchestration for parallel sub-agent execution

Implements the SubAgent/SubTask paradigm for parallel task execution, similar to Kimi K2.5’s Agent Swarm but generalized for the CodeTether ecosystem.

Key concepts:

  • Orchestrator: Decomposes complex tasks into parallelizable subtasks
  • SubAgent: A dynamically instantiated agent for executing a subtask
  • SubTask: A unit of work that can be executed in parallel
  • Critical Path: Latency-oriented metric for parallel execution

Re-exports§

pub use cache::CacheConfig;
pub use cache::CacheStats;
pub use cache::SwarmCache;
pub use executor::SwarmExecutor;
pub use executor::run_agent_loop;
pub use orchestrator::Orchestrator;
pub use rate_limiter::AdaptiveRateLimiter;
pub use rate_limiter::RateLimitInfo;
pub use rate_limiter::RateLimitStats;
pub use result_store::ResultStore;
pub use result_store::ResultStoreContext;
pub use result_store::SharedResult;
pub use result_store::SubTaskStoreHandle;
pub use subtask::SubAgent;
pub use subtask::SubTask;
pub use subtask::SubTaskContext;
pub use subtask::SubTaskResult;
pub use subtask::SubTaskStatus;

Modules§

cache
Swarm result caching for avoiding duplicate task execution
executor
Parallel execution engine for swarm operations
orchestrator
Orchestrator for decomposing tasks and coordinating sub-agents
rate_limiter
Adaptive rate limiting for swarm operations
result_store
Shared result store for sub-agent result sharing
subtask
SubTask and SubAgent definitions

Structs§

StageStats
Statistics for a single execution stage
SwarmArtifact
An artifact produced by the swarm
SwarmConfig
Swarm execution configuration
SwarmResult
Result of swarm execution
SwarmStats
Swarm execution statistics

Enums§

ActorStatus
Status of an actor in the swarm
DecompositionStrategy
Decomposition strategy for breaking down tasks
SwarmMessage
Message types for swarm coordination

Constants§

MAX_SUBAGENTS
Maximum number of concurrent sub-agents
MAX_TOOL_CALLS
Maximum total tool calls across all sub-agents

Traits§

Actor
Actor trait for swarm participants
Handler
Handler trait for processing messages in the swarm