Skip to main content

A production-grade Python framework implementing reusable multi-agent design patterns, stateful orchestration, and resilient execution harnesses for autonomous LLM systems.

Project description

pyagent-all

PyAgent: A Production Stack for Multi-Agent LLM Systems โ€” one command installs all four architecture pillars.

License: MIT Python 3.11+

pip install pyagent-all

Four Architecture Pillars

PyAgent is organised around four pillars that mirror the lifecycle of a production multi-agent system. Install them all with pyagent-all, or pick only the pillars you need.


๐Ÿ“‹ Pillar 1 โ€” Blueprint

Declare your entire agent system in a single YAML file.

Package Role Standalone install
pyagent-blueprint YAML spec โ†’ Pydantic validation โ†’ RuntimeGraph. Validate, compile, test, diff, render, and generate from the CLI. pip install pyagent-blueprint
# customer-support.yaml
api_version: pyagent/v1
metadata: { name: customer-support, version: "1.0.0" }
providers:
  fast:   { provider: anthropic, model: claude-haiku-3-5-20241022 }
  expert: { provider: anthropic, model: claude-sonnet-4-20250514  }
agents:
  classifier: { provider: fast,   prompt: "Classify into billing, technical, general." }
  specialist: { provider: expert, prompt: "Handle the request professionally." }
workflows:
  main:
    pattern: supervisor
    agents: { classifier: classifier, routes: { billing: specialist } }
blueprint validate customer-support.yaml   # static analysis
blueprint test     customer-support.yaml   # contract conformance
blueprint diff     v1.yaml v2.yaml         # semantic diff

โšก Pillar 2 โ€” Execution

Run 18 orchestration patterns against real providers, with model routing and compression.

Package Role Standalone install
pyagent-patterns 18 named patterns: Pipeline, Supervisor, Fan-Out, Debate, Swarm, ReAct and more pip install pyagent-patterns
pyagent-providers Multi-provider registry, routing strategies, fallback chains, capability negotiation pip install pyagent-providers
pyagent-router Difficulty scoring (1โ€“10), cost estimation, model selection middleware pip install pyagent-router
pyagent-compress Inter-agent message compression, agent pruning, token budget enforcement pip install pyagent-compress
import asyncio
from pyagent_patterns.orchestration import Pipeline
from pyagent_patterns.base import Agent
from pyagent_providers import ProviderRegistry, AnthropicLLM
from pyagent_router.middleware import RouterMiddleware

registry = ProviderRegistry()
registry.register("anthropic", AnthropicLLM)

model_registry = {
    "claude-haiku":  AnthropicLLM("claude-haiku-3-5-20241022"),
    "claude-sonnet": AnthropicLLM("claude-sonnet-4-20250514"),
}
router   = RouterMiddleware(model_registry=model_registry)
pipeline = Pipeline(stages=[
    router.wrap(Agent("extractor",  AnthropicLLM("claude-sonnet-4-20250514"))),
    router.wrap(Agent("summarizer", AnthropicLLM("claude-sonnet-4-20250514"))),
])
result = asyncio.run(pipeline.run("Summarise this quarterly report..."))

๐Ÿง  Pillar 3 โ€” Context & Memory

Give agents structured, trust-aware memory that persists across turns.

Package Role Standalone install
pyagent-context Three-tier memory (working / session / semantic), trust levels, sensitivity classification, compression, PII redaction pip install pyagent-context
from pyagent_context import ContextLedger, ContextItem, TrustLevel, Sensitivity

ledger = ContextLedger()
ledger.append(ContextItem(
    content="Customer ID: C-10482, account since 2022",
    source="database",
    trust=TrustLevel.VERIFIED,
    sensitivity=Sensitivity.INTERNAL,
))

# Wire to all agents in a compiled graph
graph.wire_context(ledger)

๐Ÿ“Š Pillar 4 โ€” Observability

Trace every LLM call, track costs, and govern from a web dashboard.

Package Role Standalone install
pyagent-trace TraceEventBus pub/sub, OTel spans, Langfuse export, cost tracking, record/replay pip install pyagent-trace
pyagent-studio kubectl-style CLI + FastAPI web dashboard: simulate, diff, trace explorer, governance, provider health pip install pyagent-studio
from pyagent_trace.events import TraceEventBus

bus = TraceEventBus()
graph.wire_trace(bus)   # attach to all agents in the compiled graph
pyagent apply     customer-support.yaml          # load and validate
pyagent simulate  customer-support.yaml main "I need a refund"
pyagent dashboard --blueprint customer-support.yaml

Full Stack Example

import asyncio
from pyagent_blueprint import load_blueprint, BlueprintCompiler
from pyagent_providers import ProviderRegistry, AnthropicLLM
from pyagent_trace.events import TraceEventBus
from pyagent_context import ContextLedger, ContextItem, TrustLevel

# Pillar 1 โ€” Blueprint
spec  = load_blueprint("customer-support.yaml")

# Pillar 2 โ€” Execution
registry = ProviderRegistry()
registry.register("anthropic", AnthropicLLM)
graph = BlueprintCompiler(provider_registry=registry).compile(spec)

# Pillar 3 โ€” Context & Memory
ledger = ContextLedger()
ledger.append(ContextItem("Customer tier: premium", source="crm", trust=TrustLevel.VERIFIED))
graph.wire_context(ledger)

# Pillar 4 โ€” Observability
bus = TraceEventBus()
graph.wire_trace(bus)

# Run
result = asyncio.run(graph.run("main", "I was charged twice this month"))
print(result.output)

What's Included

pyagent-all
โ”œโ”€โ”€ ๐Ÿ“‹ Blueprint
โ”‚   โ””โ”€โ”€ pyagent-blueprint     YAML spec โ†’ RuntimeGraph
โ”œโ”€โ”€ โšก Execution
โ”‚   โ”œโ”€โ”€ pyagent-patterns      18 orchestration patterns
โ”‚   โ”œโ”€โ”€ pyagent-providers     multi-provider registry + routing
โ”‚   โ”œโ”€โ”€ pyagent-router        difficulty-aware model selection
โ”‚   โ””โ”€โ”€ pyagent-compress      inter-agent compression + budgets
โ”œโ”€โ”€ ๐Ÿง  Context & Memory
โ”‚   โ””โ”€โ”€ pyagent-context       three-tier memory + trust + redaction
โ””โ”€โ”€ ๐Ÿ“Š Observability
    โ”œโ”€โ”€ pyagent-trace          TraceEventBus + OTel + cost tracking
    โ””โ”€โ”€ pyagent-studio         CLI + web dashboard + governance

โ†’ Full documentation at pyagent.org

The PyAgent ecosystem

PyAgent is a production stack for multi-agent LLM systems. Each package is independent โ€” install only what you need, or get everything with pip install pyagent-all.

Package What it gives you
pyagent-blueprint Declarative multi-agent blueprints โ€” compile, validate, and diff agent systems from YAML
pyagent-patterns Reusable multi-agent design patterns โ€” Supervisor, Pipeline, ReAct, and 15 more
pyagent-router Difficulty-aware model routing โ€” cost-efficient model selection per task
pyagent-compress Token-efficient agent compression โ€” inter-agent token budgets
pyagent-providers Multi-provider orchestration โ€” fallback chains and capability negotiation
pyagent-context Stateful agent memory โ€” trust-aware, three-tier context ledger
pyagent-trace Multi-agent observability & tracing โ€” pattern-aware OpenTelemetry spans
pyagent-studio Agent control plane dashboard โ€” live traces, cost, and governance

Learn the concepts: The Orchestrator-Worker pattern ยท Engineering a resilient multi-agent harness ยท Agent Experience Optimization (AXO)

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_all-0.2.4.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

pyagent_all-0.2.4-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file pyagent_all-0.2.4.tar.gz.

File metadata

  • Download URL: pyagent_all-0.2.4.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyagent_all-0.2.4.tar.gz
Algorithm Hash digest
SHA256 526c836340f1aa700a8d69318d59e42123b01a0cf81cfa4046cff603bebb21d5
MD5 6d1648f6b7d3f5b05317a25f7cd77cd9
BLAKE2b-256 bdd42e161dec18603dafb937447938f9b371e187ed11338e1cd89be2052e5d53

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyagent_all-0.2.4.tar.gz:

Publisher: publish.yml on pyagent-core/pyagent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyagent_all-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: pyagent_all-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyagent_all-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8217ac7bc0da9a90f6f5e6f774a3e81f2e44722ec665491c16884d728b94337f
MD5 0459b6d58bcaced6a80dbc7a35b3a23a
BLAKE2b-256 cae9efd5609386eaa4645fc9b5942d86645d4542f6f1415732f50b24cdfa41b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyagent_all-0.2.4-py3-none-any.whl:

Publisher: publish.yml on pyagent-core/pyagent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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