A minimal multi-agent framework for educational purposes
Project description
PicoAgents
An educational multi-agent framework built to teach you how multi-agent systems work from first principles.
Companion code for "Designing Multi-Agent Systems" by Victor Dibia. Every concept in the book is implemented here with clarity and best practices—so you can learn by reading the code and understanding exactly how it works.
Built for learning: This framework prioritizes code clarity and pedagogical value over performance optimization.
Installation
pip install picoagents
Requirements:
- Python 3.10+
- OpenAI API key (set
OPENAI_API_KEYenvironment variable)
Quick Start
from picoagents import Agent, OpenAIChatCompletionClient
def get_weather(location: str) -> str:
"""Get current weather for a given location."""
return f"The weather in {location} is sunny, 75°F"
# Create an agent
agent = Agent(
name="assistant",
instructions="You are helpful. Use tools when appropriate.",
model_client=OpenAIChatCompletionClient(model="gpt-4.1-mini"),
tools=[get_weather]
)
# Use the agent
response = await agent.run("What's the weather in Paris?")
print(response.messages[-1].content)
What's Included
PicoAgents implements complete, working examples of:
- Agents - Reasoning loops, tool calling, memory, middleware, streaming
- Workflows - Type-safe DAG-based execution with parallel and conditional patterns
- Orchestration - Round-robin, AI-driven, and plan-based multi-agent coordination
- Tools - 15+ built-in tools (file ops, code execution, web search, planning)
- Evaluation - LLM-as-judge patterns, reference-based validation, metrics
- Web UI - Auto-discovery, streaming chat, session management
Project Structure
picoagents/
├── src/picoagents/
│ ├── agents/ # Agent implementations (Ch 4-5)
│ ├── workflow/ # Workflow orchestration (Ch 5)
│ ├── orchestration/ # Autonomous coordination (Ch 6)
│ ├── tools/ # Tool system and built-in tools
│ ├── eval/ # Evaluation framework (Ch 8)
│ ├── webui/ # Web interface with auto-discovery
│ ├── llm/ # LLM clients (OpenAI, Azure)
│ ├── memory/ # Memory implementations
│ └── termination/ # Termination conditions
└── tests/ # Comprehensive test suite
Web UI
Launch the web interface with auto-discovery of agents and workflows:
picoagents ui
Features streaming responses, real-time debug events, and session management.
Examples
See the main repository for 50+ runnable examples organized by book chapter:
examples/agents/- Basic agents, tools, memory, computer use (Ch 4-5)examples/workflows/- Workflow patterns and case studies (Ch 5)examples/orchestration/- Multi-agent coordination (Ch 6)examples/evaluation/- Evaluation patterns (Ch 8)
Get the Book
Designing Multi-Agent Systems: Principles, Patterns, and Implementation for AI Agents
This framework implements every concept from the book. The book provides:
- Why and when to use each pattern
- Trade-off analysis for design decisions
- Real-world case studies with complete implementations
- Evaluation strategies for measuring system performance
→ Buy Digital Edition | → GitHub Repository
Development
# Clone repository
git clone https://github.com/victordibia/designing-multiagent-systems.git
cd designing-multiagent-systems/picoagents
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
python -m pytest tests/
# Type checking
python -m mypy src/
python -m pyright src/
# Code formatting
python -m black src/ tests/
python -m isort src/ tests/
Author
Victor Dibia - Website | LinkedIn | GitHub
Citation
@book{dibia2025multiagent,
title={Designing Multi-Agent Systems: Principles, Patterns, and Implementation for AI Agents},
author={Dibia, Victor},
year={2025},
url={https://buy.multiagentbook.com}
}
License
MIT License - see LICENSE file for details.
Learn more: Book Website | GitHub | Documentation
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 picoagents-0.4.0.tar.gz.
File metadata
- Download URL: picoagents-0.4.0.tar.gz
- Upload date:
- Size: 536.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ce37156c8b793264ea4d01e6946e9fed5701c6fe48c3ba2848a0b7b68533b3d
|
|
| MD5 |
2db7b784a23c960ae7eed966a2c324f0
|
|
| BLAKE2b-256 |
7c59eb202382194842886a08f365bfd28968423234e38f3edc9fd6f3688350af
|
File details
Details for the file picoagents-0.4.0-py3-none-any.whl.
File metadata
- Download URL: picoagents-0.4.0-py3-none-any.whl
- Upload date:
- Size: 535.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6ad9af36f82c4ce0ad0835bb34acbb9c33a678adc9ad1e4b1a074cfc3e5b06d
|
|
| MD5 |
082663eb178965a859f786901dd478bf
|
|
| BLAKE2b-256 |
ac49f6dad5d8489f0c6a2587727cff5b1b5008af27f3f3e368a7c679f4eb666a
|