Async-first orchestration library for multi-agent and data pipelines
Project description
PenguiFlow
Async-first orchestration library for typed, reliable, concurrent workflows — from deterministic data pipelines to LLM agents.
Why PenguiFlow
- Graph runtime: run async node graphs with bounded queues (backpressure).
- Reliability controls: per-node timeouts + retries, plus per-trace cancellation and deadlines (envelope mode).
- Streaming: emit partial output (
StreamChunk) and a final answer with deterministic correlation. - Planner (ReactPlanner): JSON-first tool orchestration with pause/resume (HITL), parallel fan-out + joins, and trajectory logging.
- Tool integrations: native + ToolNode (MCP / UTCP / HTTP) with auth and resilience patterns.
Concepts at a glance
- Flow: a directed graph (runtime) you
run(),emit()into, andfetch()results from. - Node: an async function +
NodePolicy(validation, retries, timeout). - Message (recommended for production):
Message(payload=..., headers=Headers(tenant=...), trace_id=...)enabling trace correlation, cancellation, deadlines, and streaming. - StateStore (optional): durability/audit/event persistence for distributed and “ops-ready” deployments.
Install
Requirements: Python 3.11+
pip install penguiflow
Common extras:
pip install "penguiflow[planner]" # ReactPlanner + ToolNode integrations
pip install "penguiflow[a2a-server]" # A2A HTTP+JSON server bindings
pip install "penguiflow[a2a-client]" # A2A client bindings
If you use uv:
uv pip install penguiflow
Quickstart
1) Minimal typed flow (runtime)
from __future__ import annotations
import asyncio
from pydantic import BaseModel
from penguiflow import ModelRegistry, Node, NodePolicy, create
class In(BaseModel):
text: str
class Out(BaseModel):
upper: str
async def to_upper(msg: In, _ctx) -> Out:
return Out(upper=msg.text.upper())
async def main() -> None:
node = Node(to_upper, name="to_upper", policy=NodePolicy(validate="both"))
registry = ModelRegistry()
registry.register("to_upper", In, Out)
flow = create(node.to())
flow.run(registry=registry)
await flow.emit(In(text="hello"))
result: Out = await flow.fetch()
await flow.stop()
print(result.upper)
if __name__ == "__main__":
asyncio.run(main())
2) ReactPlanner via CLI (fastest path)
uv run penguiflow new my-agent --template react
cd my-agent
uv sync
uv run penguiflow dev --project-root .
Documentation (canonical)
- Docs site (MkDocs): https://hurtener.github.io/penguiflow/
- Source docs in repo: docs/
Suggested starting points (in-repo sources):
- Getting started: docs/getting-started/quickstart.md
- Core runtime: docs/core/flows-and-nodes.md, docs/core/messages-and-envelopes.md
- Planner: docs/planner/overview.md
- Tool integrations: docs/tools/configuration.md
- Deployment runbooks: docs/deployment/production-deployment.md
- Observability runbooks: docs/observability/metrics-and-alerts.md
- CLI: docs/cli/overview.md
Stability, versioning, and public API
PenguiFlow follows a 2.x line and aims to follow SemVer with a clear public surface.
- Changelog: CHANGELOG.md
- Versioning & deprecations: VERSIONING.md
- Public API surface: docs/reference/public-api.md
Contributing, security, and support
- Contributing: CONTRIBUTING.md
- Code of Conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Support: SUPPORT.md
License
MIT — see LICENSE.
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 penguiflow-2.12.2.tar.gz.
File metadata
- Download URL: penguiflow-2.12.2.tar.gz
- Upload date:
- Size: 4.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df68217c7e387e58876ffa6dcd5306d3f983b7e944311c1f38869215b0137c34
|
|
| MD5 |
5e86a8e4ca8a413575e937aff23b26f2
|
|
| BLAKE2b-256 |
2aad2ba0f0ae5d34502742267d353bc4b504142bfc4878c708bc6da4699938bb
|
Provenance
The following attestation bundles were made for penguiflow-2.12.2.tar.gz:
Publisher:
ci.yml on hurtener/penguiflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
penguiflow-2.12.2.tar.gz -
Subject digest:
df68217c7e387e58876ffa6dcd5306d3f983b7e944311c1f38869215b0137c34 - Sigstore transparency entry: 983749953
- Sigstore integration time:
-
Permalink:
hurtener/penguiflow@54b94de81c61eb860be04f9f43be4cb24a73b912 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/hurtener
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@54b94de81c61eb860be04f9f43be4cb24a73b912 -
Trigger Event:
push
-
Statement type:
File details
Details for the file penguiflow-2.12.2-py3-none-any.whl.
File metadata
- Download URL: penguiflow-2.12.2-py3-none-any.whl
- Upload date:
- Size: 4.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e6432d97c3c7a66914ad296469c273ef958b78b831259e84304c94e743c4469
|
|
| MD5 |
792e7a4014cef032c9b56ec44708296a
|
|
| BLAKE2b-256 |
50b0ab2d056fa21796830f3af92b29ac503ac0a45d714c579664d8f4d491e9c8
|
Provenance
The following attestation bundles were made for penguiflow-2.12.2-py3-none-any.whl:
Publisher:
ci.yml on hurtener/penguiflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
penguiflow-2.12.2-py3-none-any.whl -
Subject digest:
4e6432d97c3c7a66914ad296469c273ef958b78b831259e84304c94e743c4469 - Sigstore transparency entry: 983749961
- Sigstore integration time:
-
Permalink:
hurtener/penguiflow@54b94de81c61eb860be04f9f43be4cb24a73b912 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/hurtener
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@54b94de81c61eb860be04f9f43be4cb24a73b912 -
Trigger Event:
push
-
Statement type: