Skip to main content

18 reusable multi-agent orchestration patterns for LLMs

Project description

pyagent-patterns

18 reusable multi-agent orchestration patterns for LLMs — zero dependencies, async-first, fully typed.

Install

pip install pyagent-patterns

Patterns

Tier Patterns
Orchestration Supervisor, Pipeline, Fan-Out/Fan-In, Hierarchical, Orchestrator-Workers
Resolution Self-Reflection, Cross-Reflection, Debate, Voting, Evaluator-Optimizer
Structural Role-Based, Layered, Topology, Blackboard
Advanced Talker-Reasoner, Swarm, Human-in-the-Loop, ReAct

Plus: CompositePattern (escalation chains), PatternAdvisor, GuardrailChain, BoundedExecution, CircuitBreaker.

Quick Example

import asyncio
from pyagent_patterns.base import Agent, MockLLM
from pyagent_patterns.resolution import SelfReflection

llm = MockLLM(responses=["Draft code", "Needs error handling", "Improved code", "APPROVED"])
pattern = SelfReflection(agent=Agent("coder", llm), max_rounds=3)
result = asyncio.run(pattern.run("Write a sorting function"))
print(result.output)

Documentation

Full docs: pyagent.dev

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyagent_patterns-0.1.0.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyagent_patterns-0.1.0-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file pyagent_patterns-0.1.0.tar.gz.

File metadata

  • Download URL: pyagent_patterns-0.1.0.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for pyagent_patterns-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3540dcd8dff42ddfde0f5cfdb3cdfd3dbcd3093f4c475c71c921085189b02ab1
MD5 ab3bd589b03eeb8054810b2d0222b141
BLAKE2b-256 f4b4f0fe22037bc5e9ec8d68ba4b21d5c74dd1b10f3278e722b6a0f3ff98b273

See more details on using hashes here.

File details

Details for the file pyagent_patterns-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyagent_patterns-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d81314405d5797511f1cdce388115d2a11dbef6c525e221c0ac198f062f3753
MD5 1b54b73b04c2272f991677623271fa2b
BLAKE2b-256 f99897b2ab6a8e50347fb79662d2d97c0d3bbdec24133eee42b05e82a866fada

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page