Skip to main content

Async-first orchestration library for multi-agent and data pipelines

Project description

PenguiFlow

PenguiFlow logo

CI Status PyPI version Docs Benchmarks License

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, and fetch() 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)

Suggested starting points (in-repo sources):

Stability, versioning, and public API

PenguiFlow follows a 2.x line and aims to follow SemVer with a clear public surface.

Contributing, security, and support

License

MIT — see LICENSE.

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

penguiflow-3.10.0a3.tar.gz (4.6 MB view details)

Uploaded Source

Built Distribution

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

penguiflow-3.10.0a3-py3-none-any.whl (4.6 MB view details)

Uploaded Python 3

File details

Details for the file penguiflow-3.10.0a3.tar.gz.

File metadata

  • Download URL: penguiflow-3.10.0a3.tar.gz
  • Upload date:
  • Size: 4.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for penguiflow-3.10.0a3.tar.gz
Algorithm Hash digest
SHA256 273cf64c4e368f8968d09e73aa6e4c8951d9bcd2b75a794acdb1325c555f4b1b
MD5 22a060c07c034fed644a385c80884bfd
BLAKE2b-256 2df114a523c419a6c1edcf00e72c485ec93466c3fc89f0bd79f90c02fdf31f94

See more details on using hashes here.

Provenance

The following attestation bundles were made for penguiflow-3.10.0a3.tar.gz:

Publisher: publish-prerelease.yml on hurtener/penguiflow

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

File details

Details for the file penguiflow-3.10.0a3-py3-none-any.whl.

File metadata

  • Download URL: penguiflow-3.10.0a3-py3-none-any.whl
  • Upload date:
  • Size: 4.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for penguiflow-3.10.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 5949ac3370d15d4aea1d10d1cd6e35a19d778e0ac68ffa3e95e5cefbdf111eb8
MD5 0e2d8a9794b034811acfcc4bb23505fa
BLAKE2b-256 b11a60daf0e42446b0c777a6a4cebdcbe4697e15939c1009d15a22c1d9df6ff9

See more details on using hashes here.

Provenance

The following attestation bundles were made for penguiflow-3.10.0a3-py3-none-any.whl:

Publisher: publish-prerelease.yml on hurtener/penguiflow

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