Skip to main content

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

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
File Size Uploaded Provenance Actions
flowra-0.0.99.tar.gz 1.0 MB Without provenance Details for flowra-0.0.99.tar.gz

Built distribution (wheel)

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

Total release size: 1.3 MB

Release files / flowra-0.0.99.tar.gz

Download URL flowra-0.0.99.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
3d5a9c06f5bb024c509ff2eea8bd45381761855d163b4bd5f628dd25fe22d6dc
BLAKE2b-256 checksum
How to use checksums
865b2b4aec7d600535a361c3d150b42ac7473918418a76f3fb7168c116dc49a9
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-py3-none-any.whl

Download URL flowra-0.0.99-py3-none-any.whl
Size 258.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec1fad108246b90b06bb5ecb8e878ebfb8f6b8e2b8675b740e686a5e1c4cc87e
BLAKE2b-256 checksum
How to use checksums
76e16811455d11690ad2cbd2350fa782cc5e960ac768c0eeb1fe5d586c958508
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

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

0.0.99 This release

2 release files No provenance

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