A recursive, functional, and state-isolated Multi-Agent Framework.
Project description
🐝 AgentSwarm
A Recursive, Functional, and Type-Safe Framework for Autonomous AI Agents.
AgentSwarm is a next-generation agentic orchestration framework designed to solve the critical issues of Context Pollution and Complex Orchestration in multi-agent systems.
Unlike chat-based frameworks (like AutoGen) or static graph frameworks (like LangGraph), AgentSwarm treats agents as Strongly Typed Asynchronous Functions that operate in isolated environments ("Tabula Rasa"), natively supporting recursion and Map-Reduce patterns.
🚀 Why AgentSwarm?
Current architectures suffer from two main problems:
- Context Pollution: Sub-agents inherit the parent's entire chat history, wasting tokens, increasing latency, and confusing the model.
- Boilerplate Hell: Defining dynamic recursive graphs requires complex configuration and rigid state definitions.
AgentSwarm solves these problems:
- 🧠 Tabula Rasa Execution: Every invoked agent starts with a clean context. The sub-agent receives only the specific input required, executes the task, and returns the output. No noise, no context window overflow.
- 📦 Native Blackboard Pattern: Agents don't pass massive raw text strings back and forth. They use a shared Key-Value Store to manipulate, transform, and merge data, exchanging only references (Keys).
- 🛡️ Type-Safe by Design: Built on Pydantic and Python Generics. Agent inputs and outputs are validated at runtime, and JSON schemas for the LLM are generated automatically from type hints.
- ⚡ Implicit Parallelism: The
ReActAgentengine automatically handles parallel tool execution (Map) and result aggregation (Reduce) without complex graph definitions.
🛠️ Architecture
AgentSwarm is built on three fundamental concepts:
1. Agent-as-a-Function
Every agent is a class inheriting from BaseAgent[Input, Output]. There are no "nodes" or "edges" to manually define. Orchestration emerges naturally from the functional calls between agents.
Moreover, agents are strongly typed and asynchronous by design, making them easy to compose and debug. When errors occur, they are propagated as standard exceptions, that can be managed by agents at different levels.
2. The "Store" (Shared Memory)
Instead of overloading the chat context, agents use the Store to manage information. We provide a set of agents to ease the management of the store:
- GatheringAgent: Retrieves data from the store for display or processing.
- TransformerAgent: Transforms data in the store (e.g., summarize, filter) using natural language commands and returns a new Key, keeping the context light.
- MergeAgent: Combines multiple data keys into a single entity.
3. Recursive Map-Reduce
The Map-Reduce pattern is a powerful way to decompose complex tasks into smaller, parallelizable subtasks. It is used since decades in parallel computing. With AgentSwarm, we borrow this pattern to ease the orchestration of complex tasks, preventing context pullution or exosting, prefering to use the store as a shared memory.
A MapReduceAgent can decompose complex tasks, dynamically instantiate clones of itself or other agents, and execute work in parallel, avoiding deadlocks via instance isolation.
4. Interoperability & Hybrid Execution
AgentSwarm is designed to be an open ecosystem, not a walled garden.
- Protocol Agnostic: It (will) supports the Model Context Protocol (MCP) and Agent-to-Agent (A2A) standards, allowing your agents to interact seamlessly with external tools and third-party agent networks. You can also easily wrap existing LangChain tools and run them within the Swarm.
- Hybrid Runtime: Each agent can be executed locally, or remotly, exploiting AWS or Google Cloud services. Also the Store can be a remote key-value store, like Redis.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_agentswarm-0.1.1.tar.gz.
File metadata
- Download URL: ai_agentswarm-0.1.1.tar.gz
- Upload date:
- Size: 27.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
719861984ee77624632eb88dca6099fb25b19e6de56c14c474d56e983769d968
|
|
| MD5 |
9275138db719de0cae30b36743e85e54
|
|
| BLAKE2b-256 |
2786af661c7999cdb59a8649413571026fb708c482427918f650442953dfa648
|
Provenance
The following attestation bundles were made for ai_agentswarm-0.1.1.tar.gz:
Publisher:
publish.yml on ai-agentswarm/agentswarm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_agentswarm-0.1.1.tar.gz -
Subject digest:
719861984ee77624632eb88dca6099fb25b19e6de56c14c474d56e983769d968 - Sigstore transparency entry: 823935957
- Sigstore integration time:
-
Permalink:
ai-agentswarm/agentswarm@688434c103b1b38a2ff891ef6794294d1814793e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ai-agentswarm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@688434c103b1b38a2ff891ef6794294d1814793e -
Trigger Event:
release
-
Statement type:
File details
Details for the file ai_agentswarm-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ai_agentswarm-0.1.1-py3-none-any.whl
- Upload date:
- Size: 31.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56b1099b7d897ea12ad1a9942ccf76badba86d298a96a2711f7300a3f5289d2f
|
|
| MD5 |
22e357c118ce25439a56af0cb5dba5e1
|
|
| BLAKE2b-256 |
3837693cd4c958735887bd26c9efb51707a07b4c25ed96001d5769832b0c2649
|
Provenance
The following attestation bundles were made for ai_agentswarm-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on ai-agentswarm/agentswarm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_agentswarm-0.1.1-py3-none-any.whl -
Subject digest:
56b1099b7d897ea12ad1a9942ccf76badba86d298a96a2711f7300a3f5289d2f - Sigstore transparency entry: 823935990
- Sigstore integration time:
-
Permalink:
ai-agentswarm/agentswarm@688434c103b1b38a2ff891ef6794294d1814793e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ai-agentswarm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@688434c103b1b38a2ff891ef6794294d1814793e -
Trigger Event:
release
-
Statement type: