A minimalist multi-agent orchestration library.
Project description
🐝 Swarm Agent Kit
A minimalist, state-aware multi-agent orchestration framework designed for production backends.
Overview
Swarm Agent Kit bridges the gap between simple chat scripts and complex production environments. It provides native state management, async execution, database persistence hooks, and a real-time observability dashboard.
Dual-Mode Orchestration — Choose between Unsupervised Mode (agents dynamically route and hand off tasks autonomously) or Supervised Mode (a central LLM planner forces agents through a strict sequential pipeline).
Bring-Your-Own-Database (BYOD) — Native persistence hooks let you seamlessly save and resume sessions using Redis, PostgreSQL, or any database of your choice.
Production-Ready Async — Full async/await support, safe to deploy inside high-concurrency frameworks like FastAPI.
Global State Management — Agents share and mutate a global memory dictionary via built-in tools, keeping context lean and token usage low.
Native Tool Execution — Bind standard Python functions and JSON schemas to specific agents to trigger external APIs.
Quick Start
Installation
pip install swarm-agent-kit
Set your API keys in a .env file (powered by LiteLLM — supports 100+ providers):
OPENAI_API_KEY="sk-..."
Basic Usage
from swarm_kit.core.agent import Agent
from swarm_kit.core.swarm import Swarm
import asyncio
# 1. Define your specialized agents
support = Agent(
name="Support",
instructions="You are a helpful IT support agent. Help the user fix their bug."
)
# 2. Initialize the Swarm (with optional DB hooks)
swarm = Swarm(agents=[support])
# 3. Execute asynchronously
async def main():
await swarm.execute_async(
start_agent_name="Support",
user_input="My dashboard is crashing on startup.",
session_id="ticket_123"
)
if __name__ == "__main__":
asyncio.run(main())
CLI & Observability
Swarm Agent Kit ships with a built-in CLI and a real-time local dashboard to visualize agent handovers, tool executions, and state mutations.
swarm-kit studio
Runs locally at http://localhost:8000
Database Persistence
Never lose session history. Pass your own save/load handlers and Swarm Kit handles the rest:
def save_to_redis(session_id, history, state):
redis_client.set(session_id, {"history": history, "state": state})
swarm = Swarm(agents=[...], save_handler=save_to_redis)
await swarm.execute_async(..., session_id="ticket_123")
Works with Redis, PostgreSQL, SQLite, or any storage backend.
Documentation
Full API references, tutorials, and advanced integration guides:
moseleydev.github.io/swarm-kit
License
MIT © moseleydev
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 swarm_agent_kit-0.1.5.tar.gz.
File metadata
- Download URL: swarm_agent_kit-0.1.5.tar.gz
- Upload date:
- Size: 751.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b61ec9691601b5b6cd5e84e02107dbef738ea032b64937518187b76779ca8641
|
|
| MD5 |
9e9eebd11c16f10859130a3f7092de39
|
|
| BLAKE2b-256 |
cb5040d4aa7be2957aaed9c2ead5e689abed3c6b84ca239cb0d7e659f7217be5
|
Provenance
The following attestation bundles were made for swarm_agent_kit-0.1.5.tar.gz:
Publisher:
publish.yml on moseleydev/swarm-kit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
swarm_agent_kit-0.1.5.tar.gz -
Subject digest:
b61ec9691601b5b6cd5e84e02107dbef738ea032b64937518187b76779ca8641 - Sigstore transparency entry: 1185710094
- Sigstore integration time:
-
Permalink:
moseleydev/swarm-kit@3eb5f2e5afc8010214b43ce78023baddca33a32b -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/moseleydev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3eb5f2e5afc8010214b43ce78023baddca33a32b -
Trigger Event:
release
-
Statement type:
File details
Details for the file swarm_agent_kit-0.1.5-py3-none-any.whl.
File metadata
- Download URL: swarm_agent_kit-0.1.5-py3-none-any.whl
- Upload date:
- Size: 12.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 |
7a95b245c90abe2078c4cd412c9dce4d0b9da479b1c150b0e2636c8afda590fe
|
|
| MD5 |
b08f34e9ca0a8baa04e65648021b1df3
|
|
| BLAKE2b-256 |
bef98e50eb1a59e940941090e38fa10cf5016da07ed35cc5f343d4e578a65775
|
Provenance
The following attestation bundles were made for swarm_agent_kit-0.1.5-py3-none-any.whl:
Publisher:
publish.yml on moseleydev/swarm-kit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
swarm_agent_kit-0.1.5-py3-none-any.whl -
Subject digest:
7a95b245c90abe2078c4cd412c9dce4d0b9da479b1c150b0e2636c8afda590fe - Sigstore transparency entry: 1185710099
- Sigstore integration time:
-
Permalink:
moseleydev/swarm-kit@3eb5f2e5afc8010214b43ce78023baddca33a32b -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/moseleydev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3eb5f2e5afc8010214b43ce78023baddca33a32b -
Trigger Event:
release
-
Statement type: