Full-Code · Orchestration Frameworksactive

picoagents

Type: full-code · Vendor: Victor Dibia · Language: Python · License: MIT · Status: active · Status in practice: emerging

Links: homepage

Teach the building blocks of production multi-agent systems through small, testable primitives.

Description. Minimal multi-agent framework published as companion code for Victor Dibia's book Designing Multi-Agent Systems (O'Reilly 2025). Pedagogic in scope but published on PyPI and actively maintained; demonstrates composable termination conditions, a pre/post/error middleware chain, and first-class interruptibility (cancellation + external signals) as separately-tested primitives.

Agent loop shape. An imperative async agent loop assembled from small, separately-tested primitives: each step passes through a pre/post/error middleware chain, the loop keeps running until a composable termination condition fires, and execution stays interruptible throughout via cancellation tokens and external signals. Multi-agent work is coordinated by actor-style message passing between independently-addressable agents.

Primary use cases

  • Book companion code for working through multi-agent design exercises
  • Reference implementation of composable termination and middleware contracts

Key concepts

  • Composable Termination Conditions composable-termination-conditionsFull termination package — MaxMessageTermination, TokenUsageTermination, TextMentionTermination, TimeoutTermination, HandoffTermination, ExternalTermination, CancellationTermination, FunctionCallTermination, plus a CompositeTermination combinator with any/all semantics.
  • Agent Middleware Chain agent-middleware-chainBaseMiddleware exposes process_request / process_response / process_error; MiddlewareChain runs the chain forward through process_request, then reverse through process_response.
  • Interruptible Agent Execution interruptible-agent-executionCancellationToken + CancellationTermination + ExternalTermination are first-class primitives. The cancellation token follows AutoGen's design for cancelling pending async operations.
  • Actor-Model Agents actor-model-agentsPicoagents has shared-conversation orchestration (RoundRobin, AIOrchestrator, plan-based) over a shared message list, not per-agent mailboxes — closest analogue but no actor-model abstraction.
  • Conversational Multi-Agent autogen-conversationalRoundRobinOrchestrator cycles agents over a shared conversation history; AIOrchestrator picks the next speaker via LLM-driven structured-output selection — both classic conversational multi-agent patterns.

Patterns this full-code implements —

Neighbourhood

Click any neighbour to follow the lineage. Scroll to zoom, drag to pan.

Instantiates

References

Provenance

  • Last analyzed:
  • Last updated:
  • Verification status: verified