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

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

Built distribution (wheel)

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

Total release size: 1.3 MB

Release files / flowra-0.0.101.tar.gz

Download URL flowra-0.0.101.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
e7b0dcbb0e699d8c8b289fe5efa321a724a17aa389cf3b2438a662ccc8b3c9c0
BLAKE2b-256 checksum
How to use checksums
a967ae2e3c43acbc87922c90f53de6c07db9a7368a073efde5da9d436f53096c
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.101-py3-none-any.whl

Download URL flowra-0.0.101-py3-none-any.whl
Size 260.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46b3c0439e306205e631ad15fee4835b0dd124d67d75363b2b828ade3b9130a6
BLAKE2b-256 checksum
How to use checksums
06be5ca54c24d50f81e7509ca82416d8190a065e553815c58b83aec278a411a3
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.101

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