Back to Portfolio
Open Source / Developer ToolingLive

Swarm Agent Kit

An open-source multi-agent orchestration framework for Python backends. It fills the gap between simple LLM scripts and real production deployments, where async, persistence, observability, and provider-agnostic routing are non-negotiable.

Author & Maintainer
Feb 2026 - Present
Open Source
Read the docs
swarm-agent-kit published on PyPI
100+
LLM Providers Supported
2
Orchestration Modes
PyPI
Published & Installable
MIT
Open Source License

The problem

By late 2025 the multi-agent space was crowded but shallow. Every framework I evaluated failed on at least one dimension that matters in production. Some locked you into a single provider, which is fine until your OpenAI bill triples or Anthropic ships a better model. Others had no native async support, which makes them unsafe inside a FastAPI or NestJS backend serving real users. Persistence was almost always an afterthought. Most frameworks assumed you'd run one conversation, in memory, and never restart the process.

Observability was worse. You had no idea which agent handed off to which, what state changed, or why a specific tool call happened. Developers building real products were gluing these missing pieces together from scratch every time, and the result was usually fragile.

The bet

Swarm Agent Kit treats the missing pieces as first-class concerns instead of features to bolt on later. Two orchestration modes cover the real design space. Native async keeps it safe under production concurrency. Persistence is bring-your-own-database. Shared state stays lean as sessions grow. LiteLLM sits underneath as the provider layer, so swapping models is a one-line change. And there's an observability dashboard so you can actually see what your agents are doing.

One pip install, and you're production-ready.

The design decision that changed everything

The hardest call wasn't technical. It was philosophical.

Every existing framework had picked a stance. Either agents plan everything themselves (autonomous, creative, unpredictable) or a central planner controls everything (predictable, easier to debug, less powerful). Both have real use cases. A production pipeline where sequencing matters needs the second. A research workflow where dynamic reasoning matters needs the first. Same team, same product, sometimes on the same day. Forcing users to choose at framework level felt wrong.

So I built both into the same core. In Unsupervised mode agents hand off tasks based on context. In Supervised mode a central LLM planner enforces a strict pipeline. Same primitives, same state model, same observability. You switch with a flag.

The framework's stance is that there isn't one right stance. Users pick per workflow, not per framework.

The swarm-kit repository on GitHub
The public repo: CI with trusted publishing to PyPI, MkDocs documentation, and runnable examples for both orchestration modes.

Where it came from

The origin was 100Minds.ai. I was building a voice-first AI coaching platform where different agents had to hand off tasks reliably inside a FastAPI backend. One agent framed the scenario, another generated feedback, another retrieved grounding content. Every framework I tried either blocked the event loop, which destroyed our sub-second latency budget, or forced vendor lock-in, which meant one price hike could sink the product.

I ended up writing the orchestration layer from scratch inside the 100Minds codebase. After shipping, I realized the pattern was more general than the product it lived in. So I extracted it, cleaned up the API surface, added LiteLLM to remove vendor lock-in, and published it as an open-source library.

State is where multi-agent systems die

Routing is not the hard part. State is. When agents share context, three failure modes show up fast: state balloons and every LLM call costs more, state goes stale and agents act on outdated context, or state gets clobbered because two agents wrote the same key.

I rewrote the state layer twice. The final design is a flat dictionary with a namespace prefix per agent. Agents can read broadly, seeing everyone's state, but write narrowly, only inside their own namespace. That one constraint removed the entire class of write-conflict bugs and gave the dashboard something clean to visualize.

Persistence as a hook, not a feature

Every framework I evaluated bundled its own store: SQLite, a Redis wrapper, or homemade JSON files. All of them were wrong for someone. If you already run PostgreSQL, you don't want a second store for agent state. If you're on serverless and can't run Redis, a Redis-first framework is dead on arrival.

In Swarm Agent Kit you pass in a save function and a load function. That's it. The framework calls them at the right points in the agent lifecycle. Postgres, Redis, SQLite, DynamoDB, a JSON file, or an in-memory dict all work.

swarm-kit studio, the debugger I built for myself

Building the dashboard showed me how badly I'd underestimated debugging. Multi-agent systems fail in ways that look like magic when you can't see the handoffs. An agent routes to the wrong specialist, the specialist makes a plausible but wrong call, and the output looks fine until you notice it's confidently incorrect. Without visibility you can't even reproduce the bug.

swarm-kit studio started as a tool for me and became one of the most cited reasons developers use the library. It shows every handoff, tool execution, and state change in real time, in your terminal.

What I learned

Building a framework other developers will use forces you to think about API design differently. The question stops being "does this work" and becomes "will this still make sense when someone reads it at 2am during an outage." Every parameter had to justify itself. Every default had to be defensible.

Namespaced state was the single highest-leverage decision in the library. The real complexity isn't routing, it's keeping shared state lean and consistent so token usage doesn't balloon as conversations grow.

Documentation is half the product. A library nobody can figure out is worse than one that doesn't exist, because it wastes everyone's time.

I spent almost as long on the docs site as on the library, and it has paid for itself many times over in adoption.

What I owned

  • Designed the dual-mode orchestration engine (Unsupervised and Supervised) on shared primitives, state, and observability, so users switch modes without rewriting agents
  • Built full async/await support that is safe inside high-concurrency frameworks like FastAPI and never blocks the event loop
  • Implemented namespaced global state so agents read broadly but write narrowly, removing write-conflict bugs and keeping token usage lean
  • Created bring-your-own persistence hooks for Redis, PostgreSQL, SQLite, or any backend instead of a bundled store
  • Shipped swarm-kit studio, a real-time CLI dashboard for handoffs, tool calls, and state changes
  • Integrated LiteLLM as the provider layer, giving 100+ LLM providers behind one interface
  • Published on PyPI with CI-based trusted publishing, full docs, quick-starts, architecture diagrams, and an MIT license