Flowra
Flow infra for building stateful, persistent LLM agents with tool use, parallel execution, and crash recovery. Requires Python 3.12+.
Features
- State machine agents — define agents as
Agent[Spec, Result]classes with@stepmethods, a single entry point, and typed spec/result contracts - Persistent state —
Scalar[T]andMutableList[T]with incremental dirty-tracking and pluggable storage (in-memory, file-based, or custom) - Tool integration —
@tooldecorator for local functions, MCP server support, DI into tool handlers, agents as tools for LLM-driven delegation - LLM abstraction — provider-agnostic
LLMProviderinterface with immutable message types and real-time streaming (shipsAnthropicVertexProvider,AnthropicFoundryProvider,OpenAIProvider,AzureOpenAIProvider,OpenAIResponsesProvider,GoogleVertexProvider) - Agents as tools —
@agent_tooldecorator exposes an agent as a tool the LLM can call autonomously; sub-agent runs its own system prompt and tool loop - Cooperative interrupts —
InterruptTokenfor graceful cancellation across the entire execution tree - Pre-built agents —
ChatAgent(multi-turn chat with session history) andTurnAgent(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[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)
Documentation
- Getting Started — from installation to a working chatbot with tools in 5 minutes
- 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
- 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.79
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flowra-0.0.79.tar.gz | 688.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flowra-0.0.79-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 858.1 kB
Release files / flowra-0.0.79.tar.gz
| Download URL | flowra-0.0.79.tar.gz |
|---|---|
| Size | 688.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f1415bd88d7f358f812e4b7b73f535d3947f1eb8f53a4e3b31ee959064b8b271
|
|
BLAKE2b-256 checksum How to use checksums |
056f14b07d9ba70b12450858ee7b50c376666abd9b18b4c3b5f6e59c8b11290b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.79-py3-none-any.whl
| Download URL | flowra-0.0.79-py3-none-any.whl |
|---|---|
| Size | 169.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5ef3bbf614a945be384273803ac6c8570c8890be3cd08903e3db9630021014da
|
|
BLAKE2b-256 checksum How to use checksums |
1b803d7bbd2acd9661b21b22a5398cc8f5a9d7c0a696cb44684b7258a0294f51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|