Skip to main content

PicoAgents

PicoAgents Web UI

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_KEY environment 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:

Get the Book

Designing Multi-Agent Systems Book Cover

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

Metadata

Release files for picoagents 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for picoagents 0.5.0
File Size Uploaded Provenance
picoagents-0.5.0.tar.gz 504.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for picoagents 0.5.0
File Interpreter ABI Platform
picoagents-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.0 MB

Release files / picoagents-0.5.0.tar.gz

Download URL picoagents-0.5.0.tar.gz
Size 504.0 kB
Tags Source
SHA-256 checksum
How to use checksums
756afcdb56e709ce7cae74a5924d1a9ebb6791d4360ae0f4c40b229d281d7114
BLAKE2b-256 checksum
How to use checksums
0ab2eee4f43cec62948cca1192a39f7b371fd38e904b3e298256bc392fae55f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.4

Release files / picoagents-0.5.0-py3-none-any.whl

Download URL picoagents-0.5.0-py3-none-any.whl
Size 501.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c1f68e834eb9224d3c9d101fd5006b18ed3b0e2b71b725f0ad1f595bedae717
BLAKE2b-256 checksum
How to use checksums
8c3f6169b3d0cdb383087ea7a25decf2ed2bc14c3e21387481033c5650b864af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.4

Security for picoagents 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page