An educational multi-agent orchestration framework built on OpenAI's Swarm — explore handoffs, routines, and agentic patterns
⚠️ Experimental & Educational — built to explore ergonomic interfaces for multi-agent systems, not for production use.
SwarmPy is an educational framework for exploring multi-agent orchestration patterns. Based on OpenAI's Swarm, it showcases the handoff and routines patterns from the Orchestrating Agents cookbook — wrapped in a Streamlit UI for hands-on experimentation.
- Agent handoffs — transfer control between agents based on context
- Routines — define multi-step agent workflows
- Swarm orchestration — lightweight, ergonomic multi-agent coordination
- Streamlit UI — interactive interface for experimenting with agent flows
- GPT-4 powered — built on OpenAI's chat completions API
git clone https://github.com/RhythrosaLabs/swarmpy.git
cd swarmpy
pip install -r requirements.txt
# Set your OpenAI key
export OPENAI_API_KEY=your_key
streamlit run app.pyOr install the Swarm library directly:
pip install git+https://github.com/openai/swarm.gitfrom swarm import Swarm, Agent
client = Swarm()
agent = Agent(name="Assistant", instructions="You are a helpful assistant.")
response = client.run(agent=agent, messages=[{"role": "user", "content": "Hello!"}])
print(response.messages[-1]["content"])- Python 3.10+ — core language
- OpenAI / GPT-4 — LLM backbone
- Swarm — multi-agent orchestration
- Streamlit — interactive UI
PRs welcome. Open an issue first for major changes.
MIT
If SwarmPy helps you explore agentic AI patterns, consider supporting development:
👉 Donate via PayPal — @noodlebake