Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Flowra

PyPI Python License CI

Flow infra for building stateful, persistent LLM agents with tool use, parallel execution, and crash recovery. Requires Python 3.13+.

Features

  • State machine agents — define agents as Agent[Spec, Result] classes with @step methods, a single entry point, and typed spec/result contracts
  • Persistent state — Scalar[T] and MutableList[T] with incremental dirty-tracking and pluggable storage (in-memory, file-based, or custom)
  • Tool integration — @tool decorator for local functions, MCP server support, DI into tool handlers, agents as tools for LLM-driven delegation
  • LLM abstraction — provider-agnostic LLMProvider interface with immutable message types and real-time streaming (ships AnthropicVertexProvider, AnthropicFoundryProvider, AnthropicBedrockProvider, OpenAIProvider, AzureOpenAIProvider, OpenAIResponsesProvider, GoogleVertexProvider)
  • Decisions — DecisionProvider: predicate, choice and score questions answered with probabilities instead of text (ships OpenAIDecisionProvider, AzureOpenAIDecisionProvider, TypeSafeProvider)
  • Agents as tools — @agent_tool decorator exposes an agent as a tool the LLM can call autonomously; sub-agent runs its own system prompt and tool loop
  • Cooperative interrupts — InterruptToken for graceful cancellation across the entire execution tree, by rules that keep a simple agent right without handling them
  • Pre-built agents — ChatAgent (multi-turn chat with session history) and TurnAgent (single-turn LLM tool loop with hooks and caching)

Installation

# Base package (no LLM providers)
pip install flowra

# With specific providers
pip install flowra[anthropic]
pip install flowra[bedrock]
pip install flowra[openai]
pip install flowra[google]

# All providers
pip install flowra[providers]

Quick start

import asyncio

from flowra.agent import AgentRuntime, InMemorySessionStorage
from flowra.lib import LLMConfig
from flowra.lib.chat import ChatAgent, ChatConfig, ChatResult, ChatSpec
from flowra.llm import SystemMessage, TextBlock
from flowra.llm.providers.openai import OpenAIProvider


async def main() -> None:
    async with OpenAIProvider(api_key="sk-...") as provider:
        config = ChatConfig(
            llm_config=LLMConfig(provider=provider, model="gpt-4o"),
            system=[SystemMessage(blocks=[TextBlock(text="You are a helpful assistant.")])],
        )

        runtime = AgentRuntime(
            agents={"chat": ChatAgent},
            storage=InMemorySessionStorage(),
            services={ChatConfig: config},
        )

        while True:
            user_input = input("You: ")
            if not user_input:
                break

            result = await runtime.run(agent=ChatAgent, spec=ChatSpec.text(user_input))

            if isinstance(result, ChatResult) and result.response:
                print(f"Assistant: {result.response}")


asyncio.run(main())

Package structure

flowra/
├── llm/        # LLM abstraction (messages, blocks, provider interface)
├── tools/      # Tool definition, registration, execution
├── agent/      # Agent framework + execution engine + persistence
├── lib/        # Pre-built agents (ChatAgent, TurnAgent, hooks, caching)
└── ext/        # Tracing integrations (MLflow, OpenTelemetry)

Documentation

  • Getting Started — from installation to a working chatbot with tools in 5 minutes
  • Architecture — package structure, dependency graph, data flow
  • Working with LLMs — providers, streaming, structured output, caching, extended thinking
  • Tools — tool groups, MCP servers, service injection
  • Agents — custom agents, state machines, control flow, parallel execution
  • Interrupts — how an interrupt travels through the agent tree: the principles and rules every agent and building block follows
  • Patterns — multi-agent patterns: router, pipeline, race, fan-out
  • Observability — hooks, spans, MLflow and OTel integrations

Development

make deps      # install dependencies (uv sync)
make check     # lint + test
make chat      # run interactive console chat example

Metadata

Release files for flowra 0.0.99.dev119

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flowra 0.0.99.dev119
File Size Uploaded Provenance Actions
flowra-0.0.99.dev119.tar.gz 1.0 MB Without provenance Details for flowra-0.0.99.dev119.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flowra 0.0.99.dev119
File Interpreter ABI Platform Actions
flowra-0.0.99.dev119-py3-none-any.whl Python 3 none any Details for flowra-0.0.99.dev119-py3-none-any.whl

Total release size: 1.3 MB

Release files / flowra-0.0.99.dev119.tar.gz

Download URL flowra-0.0.99.dev119.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
76e048a22a66ba57e99e6fd115b6a23f434ca6980d7341f99e981d15bbdc4588
BLAKE2b-256 checksum
How to use checksums
760492adc30b3a1e578c18732b4839421b70109e06a45edb1c584b7e4be7629e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / flowra-0.0.99.dev119-py3-none-any.whl

Download URL flowra-0.0.99.dev119-py3-none-any.whl
Size 257.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7207d87ed88b809511edf729af4a07d5400d1caf949f7854c7682547f609e3bf
BLAKE2b-256 checksum
How to use checksums
a1abf045106ff282120a3e2ebb09dae81d815688cf3c305d018ff1ed3f9828d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for flowra 0.0.99.dev119

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page