Overview
Swarms v15 covers everything merged after 14.0.2, across four releases and 111 commits. A further set of changes has landed on master since 15.0.3 and is listed under Unreleased. The headline is how agents talk to each other. Every multi-agent structure now delivers shared context as typed chat turns: each speaker arrives as its own labelled message, instead of the whole room being flattened into one user message. Structures also record each agent’s answer rather than its whole transcript, and start each task from an empty conversation. Runs stop leaking earlier tasks into later ones, and requests keep a stable prefix that prompt caching can reuse. Around that, v15 adds token usage accounting, fallback swarms forSwarmRouter, MCPDeployer for serving agents as authenticated MCP servers, a model catalogue check, and wider OpenTelemetry coverage. 15.0.0 also removed the deprecated AOP module and the HierarchicalSwarm live dashboard.
Highlights
- Typed chat turns everywhere (15.0.0): shared context arrives as labelled turns, and each agent contributes its answer, not its transcript.
- Token usage (15.0.1, 15.0.2):
agent.usageandrouter.usagereport provider token counts, including streaming runs and reasoning tokens.agent.input_tokensestimates the next request. - Fallback swarms (15.0.1):
SwarmRouter(fallback_swarms=[...])tries the next architecture when one fails. - MCPDeployer (15.0.3): serve any agent, swarm or callable as an MCP tool behind API keys, a token verifier or your own auth.
- Conversations from prior turns (15.0.3): pass chat-format
messagestoAgentorrun(). - Model catalogue (15.0.3):
is_model_available,model_countandget_available_modelscheck names against LiteLLM and OpenRouter. - Leaner autonomous loop (15.0.1): a
globtool, tool output capped by token budget, and context compression between subtasks.
Unreleased
These changes are on master after 15.0.3 and are not in any published release yet. They ship in the next release. To use them now, install from source:
pip install git+https://github.com/kyegomez/swarms.git. See Installation.New features
- TreeOfThoughts: a reasoning agent that grows a tree of partial solutions, scores and prunes them, and answers from the best path. Every model output is a validated function call. See Tree of Thoughts.
- DecisionModel: a client that asks choice, score and yes/no (
noul) questions about a state in one request and returns typed answers with calibrated probabilities. It defaults to TypeSafe’sjev-latest, andmodel_name="clef"or"clef-flash"uses Cloudflare Workers AI.get_decision_models()lists the available names. See DecisionModel. - More usage totals:
GraphWorkflow.usagesums every node and subgraph, andHeavySwarm.usageincludes question generation. See Token usage. - Autonomous loop budgets:
Agenttakesmax_planning_attempts(default5),max_subtask_iterations(default100) andmax_subtask_loops(default20). Each must be at least 1. See Autonomous mode. - Several skill directories:
skills_diraccepts a list of paths. When two directories hold a skill with the same name, the later one wins. - ToolManager: tool handling moved out of
agent.pyinto aToolManagerbuilt once per agent asagent.tool_manager. Context compression also stops tokenizing the history while its byte size is under budget, which cuts a tool turn from about 770 µs to 162 µs. See ToolManager.
Fixes
Agent.run()raisesAgentLLMErroronce every retry has failed, instead of returning an empty string.fallback_modelsare now tried, because the error reaches the fallback chain. See Production best practices.- Selected skills reach the model on every call. They were appended to
system_promptafter the LLM was built, so the model never saw them. run_streamandarun_streamwithmax_loops="auto"enter the autonomous loop instead of calling the model without a plan.- Interactive follow-up input is sent to the model again.
- An agent with tools that answers in plain text no longer records
"[] (empty list)"or a tool summary as its answer. - A failing tool batch runs once per
tool_retry_attemptsattempt, not twice. Agent.run(n=...)passes every input to each sample.ConcurrentWorkflow.run,GroupChat’s async run,ReasoningDuoandMajorityVoting.run_concurrentlystart each run or task from an empty conversation.ConcurrentWorkflowreturns results in agent order and records each agent’s answer.RoundRobinSwarmrecords answers too.SelfConsistencyAgentgives each sample its own agent, so samples are independent.router(task)androuter.batch_run(tasks)work for every swarm type. They passedimgs=None, which most swarms rejected.CouncilAsAJudgeruns its judges onmodel_namewhenjudge_agent_model_nameis unset.ModelRouterparses the routing reply before reading it, andCronJobwaits for the next interval after a failed run instead of retrying every second.MCPDeployerenforcestimeoutfor blocking targets.Conversationno longer creates~/.swarms/conversations, which crashedAgent()on a read-only home directory. It seeds the system prompt only when no history was restored.batch_agent_executionworks again and returns results in agent order.aggregate()defaults to a live model.- The CLI help states the real HeavySwarm model default,
gpt-5.4.
Changed defaults and removals
temperaturedefaults toNone(was0.5), so it is left out of the request and the provider’s default applies. Current Claude models rejected the old default.dynamic_toolsdefaults toFalse(wasTrue). Passdynamic_tools=Trueto keep tool schemas behindtool_search.- The
"xml"output type andswarms/utils/xml_utils.pywere removed.output_type="xml"now raisesValueError. LLMCouncil.run()dropped thequeryalias. Callrun(task), which rejects an empty task.swarms/utils/swarm_autosave.pywas deleted in favor ofWorkspaceManager, and the unusedHierarchicalOrderRearrangeschema was removed.- Tool methods moved from
Agenttoagent.tool_manager, includingexecute_tools,tool_execution_retry,setup_tools,setup_dynamic_tools,mcp_tool_handlingandparse_llm_output.Agentkeepsadd_tool,add_tools,remove_tool,remove_toolsandmcp_enabled.
New features
Fallback swarms (15.0.1)
SwarmRouter used to run exactly one swarm type. Now fallback_swarms lists types to try in order when the primary raises, during construction or during run(). Each fallback is built from the same agents and configuration. If every type fails, SwarmRouterRunError names each attempt.
SwarmRouterRunError is importable from swarms.structs.swarm_router. See SwarmRouter and Production best practices.
Token usage (15.0.1, 15.0.2)
agent.usage reports the token counts the provider returned, summed over every LLM call the agent has made: input_tokens, output_tokens, cached_tokens, reasoning_tokens and total_tokens. router.usage sums them across a router’s agents, including a director, aggregator or judge the built swarm holds. In 15.0.2, streaming runs started counting and reasoning_tokens was added. agent.input_tokens estimates how many tokens the next request would carry.
MCPDeployer (15.0.3)
MCPDeployer turns an agent, any structure with a run() method, or a plain callable into an MCP server. Each target becomes one tool. Pass a list or a dict to serve several. Requests are authenticated by a custom auth callable, an MCP TokenVerifier, or static api_keys. With no auth configured, construction fails unless you pass allow_anonymous=True. It serves streamable HTTP by default, or SSE or stdio.
run() blocks. Use start() and stop(), or a with block, to serve from a background thread. See MCPDeployer, Serve an agent and Serve a team.
Conversations from prior turns (15.0.3)
Agent and Conversation take messages, a list of chat-format dicts. Agent(messages=[...]) seeds the agent’s memory at construction. run(task, messages=[...]) sends the turns as the transcript the task continues from, including with max_loops="auto". Tool calls in the turns survive the round trip.
Conversation a unique conversation-<8 hex> name, and stopped creating an empty ./conversations directory when nothing is saved.
Model catalogue check (15.0.3)
get_available_models lists every model name LiteLLM knows, plus OpenRouter’s live catalogue with an openrouter/ prefix. The OpenRouter list is cached for five minutes, and a failed fetch returns an empty list with a warning. is_model_available and model_count build on it.
Point-to-point patterns (15.0.3)
The three classes invarious_alt_swarms.py now live in their own modules, each with a matching function: OneToOne and one_to_one, Broadcast and broadcast, OneToThree and one_to_three. All of them are exported from swarms.
Autonomous loop upgrades (15.0.1)
Themax_loops="auto" loop gained a glob(pattern, path) tool that finds files recursively and returns relative paths, newest first. read_file, run_bash, grep and glob output is now capped by tokens, at a quarter of the agent’s context_length, and the truncation notice says how much was cut. ContextCompressor now runs between subtask iterations, which it never did in auto mode before. Sub-agents receive the parent’s tools and enough loops to use them. A tool that fails after tool_retry_attempts is reported to the model as a tool failure instead of re-running the model as if the provider had failed. See Autonomous mode.
HierarchicalSwarm shows its plan (15.0.0)
The director’s plan, which was parsed and discarded, now renders above the orders it gave each worker. Orders are shown in full, and the panel is titled with the director’s name. The panel is controlled by the newprint_on parameter (default True) rather than verbose. The module was also split: prompts, schemas and the order parser moved to their own files. See HierarchicalSwarm.
Wider tracing (15.0.3)
SelfMoASeq, ModelRouter, SocialAlgorithms, AutoSwarmBuilder and SpreadSheetSwarm now emit OpenTelemetry init and run spans. AutoSwarmBuilder.run is the parent of the swarm run it delegates to, so the build phase and the run share one trace. ModelRouter carries the tracing context into its thread pool. SequentialWorkflow.run emits its span again after a refactor had moved the decorator onto a helper. See Telemetry.
Package version (15.0.1)
swarms.__version__ reads the installed package version. In a source checkout with no installed distribution, it returns "unknown".
Improvements
Typed chat turns (15.0.0).MixtureOfAgents, AgentRearrange, SequentialWorkflow, GroupChat, HierarchicalSwarm, MajorityVoting, GraphWorkflow, RoundRobinSwarm, the swarming architectures, AgentJudge and ReasoningDuo all moved to typed turns. An agent’s own earlier turns arrive as assistant messages and everyone else’s as labelled user messages. 15.0.1 and 15.0.2 extended the same change to PlannerWorkerSwarm’s cycle judge, the Advisor swarm and HeavySwarm’s synthesis. 15.0.3 extended it to the CouncilAsAJudge aggregator. Guidance such as the collaboration preamble now travels as a system turn instead of being appended to your agents’ system_prompt, which never reached the model.
Per-task isolation. Nine structures reset their conversation at the start of run() (15.0.1), and HierarchicalSwarm resets its conversation and delivery cursor per task. SequentialWorkflow.run_batched and run_concurrent give each task its own clone (15.0.0, 15.0.3), and ConcurrentWorkflow.batch_run gives each task its own conversation (15.0.3). SpreadSheetSwarm no longer runs one agent in several threads, and SelfMoASeq and ImageAgentBatchProcessor draw each sample or image from a fresh agent (15.0.0).
Orchestration. AgentRearrange parses its flow once, seeds its team-awareness message once instead of twice, and gates its logging on verbose (15.0.0). MultiAgentRouter runs selected agents concurrently and honours skip_null_tasks (15.0.0). SocialAlgorithms records every message in a Conversation (15.0.0).
Providers. Swarms works with mcp 2.x (15.0.1). OpenAI’s o-series and GPT-5-family models receive max_completion_tokens instead of max_tokens, with one automatic retry when a provider’s error names the other key (15.0.2). System prompts now render their time line when an agent is built, not when the process started (15.0.1, 15.0.3).
Contributing (15.0.3). Commit messages, PR titles and issue titles must use the WARP format, [TYPE][Function/FileName][Short Description], and comments are one line. See Contributing. The repository also gained a Simplified Chinese README.
Bug fixes
AutoAgentBuilderacceptsagent_kwargswithout raisingTypeError(15.0.0).tools=[]no longer enables the deferred-tool machinery with an empty catalog (15.0.0).- A reused autonomous agent no longer grows its system prompt by a handoff block on every run (15.0.0).
- A caller-supplied
saved_state_pathis no longer overwritten (15.0.0). AgentRearrange.remove_agentremoves by name instead of always raising (15.0.0).SwarmRouter(list_all_agents=True)no longer raises at construction (15.0.0).GraphWorkflowfan-in labels each predecessor’s output correctly when one is missing (15.0.0).GroupChatcan seat a speaker again: bids returned as strings scored 0.0 for every agent (15.0.0).DebateWithJudge,one_on_one_debateand the expert panel pass each speaker’s answer, with names, rather than transcripts or a Python list repr (15.0.0).- The hierarchical structured-communication evaluator’s score is parsed instead of hard-coded, so its early stop can fire (15.0.0).
MixtureOfAgentslabels each worker contribution with its layer (15.0.1).- Failed MCP tool calls are reported as failures under
mcp2.x (15.0.1). return_all_except_first_stringdrops one message, not two (15.0.1), and"all-except-first"output no longer drops a swarm’s first agent answer (15.0.3).- Wrapped
Args:lines in docstrings no longer truncate tool-schema descriptions (15.0.1). HierarchicalSwarmraises when every loop failed, instead of returning a normal-looking transcript (15.0.3).Conversation.add_multiple_messagesworks on machines with fewer than four CPUs and returns what it added, in order (15.0.3).- The
HeavySwarmdefault variant no longer crashes, the medium variant gets the right questions, and HeavySwarm runs on Claude. The question decomposer also sees the image (15.0.3). - In auto mode,
agent.run()shapes its result byoutput_typeon every exit path (15.0.3). - Over-length
run_bashfile writes point the model atcreate_file(15.0.3).
Removals and breaking changes
- The deprecated AOP module (
swarms/structs/aop.py) and its examples were deleted (15.0.0). To serve agents over MCP, use MCPDeployer. - The
HierarchicalSwarmlive dashboard was removed (15.0.0).interactivestill prompts for a task whenrun()gets none.HierarchicalSwarm.arun,arun_streamandrun_streamwere removed too. "auto"and"BatchedGridWorkflow"are no longerSwarmRouterswarm types (15.0.0). Neither could run.BatchedGridWorkflowstill works on its own.reasoning_effortdefaults toNoneagain (was"medium"in v14), so tool calls work on OpenAI reasoning models by default (15.0.0).Conversation.return_messages_as_listreturns message dicts. The"role: content"strings moved toreturn_messages_as_strings(15.0.0).SocialAlgorithmsretiredenable_communication_logging,parallel_executionandmax_workers. Old arguments are still accepted and ignored (15.0.0).ReasoningDuo’s internal agents are named<agent_name>-reasoningand<agent_name>-main(15.0.0).- The
Artifactclass andswarms.artifactspackage were removed (15.0.1). various_alt_swarms.pywas split intoone_to_one.py,broadcast.pyandone_to_three.py(15.0.3).- Four helpers with no callers were deleted:
query_ragent,find_multiple_agents_by_name,track_historyandcoordinate_workflow(15.0.3).MultiAgentRouter.get_agent_response_schemawent in 15.0.0. - An unnamed
Conversationis namedconversation-<8 hex>instead ofconversation-test(15.0.3).
Conclusion
v15 makes multi-agent runs honest about who said what. Context arrives as typed turns, each task starts clean, and every structure records answers rather than transcripts. Usage accounting shows what a run cost, fallback swarms keep a router serving when one architecture fails, andMCPDeployer lets other agents and MCP hosts call yours. When you upgrade from v14, replace any AOP server with MCPDeployer, drop references to the HierarchicalSwarm dashboard and its streaming methods, and update code that read strings from return_messages_as_list. If you install from master, also check the new temperature and dynamic_tools defaults listed under Unreleased.