Report Abuse

Basic Information

Swarm is an experimental, educational Python library for building, coordinating, and executing networks of chat-based agents. It exposes two simple primitives, Agent and handoffs, so developers can compose agents that encapsulate instructions and functions and transfer conversation control to each other. Swarm runs on top of the Chat Completions API and is intentionally stateless between calls. The repository includes an installable package requiring Python 3.10+, example projects showing common patterns, and a REPL demo for interactive exploration. The README notes Swarm has been superseded by the OpenAI Agents SDK for production use and is intended primarily as a lightweight, learnable environment to prototype multi-agent orchestration and function execution patterns.

Links

App Details

Features
Swarm provides an Agent abstraction that bundles instructions, model selection, and a list of callable Python functions. The client.run() loop handles getting completions, executing tool/function calls, performing agent handoffs, updating context variables, and returning an aggregated Response object with messages, the last agent, and context variables. Functions are auto-converted to JSON Schemas for tool calling and may return Agents or Result objects to update state and trigger handoffs. The library supports streaming with start/end delim events, debug and execution control flags, example folders demonstrating triage, weather, airline and support flows, and a run_demo_loop REPL for interactive testing.
Use Cases
Swarm helps developers learn and prototype multi-agent orchestration patterns without a large framework or persistent state. It makes it straightforward to split responsibilities across focused agents, implement workflow-style handoffs, and connect chat-driven logic to Python tools that can return values, update context, or transfer execution. Streaming, function schema generation, and error-handling patterns in tool execution simplify building testable interactions. The included examples and REPL accelerate experimentation with customer support, triage, and personal assistant scenarios. The README also guides users toward migrating to the production-ready OpenAI Agents SDK when moving beyond experimental prototypes.

Please fill the required fields*