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.100

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

Built distribution (wheel)

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

Total release size: 1.3 MB

Release files / flowra-0.0.100.tar.gz

Download URL flowra-0.0.100.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
6b102012514713f898f2d19d1a9c8fed507a50d1f6760f31e0fc7406740adad1
BLAKE2b-256 checksum
How to use checksums
75ea11084205e64a922f5cc25b788545db183967ba9cd5f25af39230127a7fad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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.100-py3-none-any.whl

Download URL flowra-0.0.100-py3-none-any.whl
Size 259.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8872bd0f956dbc478630ec7365db6becad55b21d2691f59d2d63119db8ce35a
BLAKE2b-256 checksum
How to use checksums
11efd653e24d0ad138e5650ad9efa2f2d6a2d9952f8159b5bd7c4ce231fc9905
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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.100

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.100 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