Async-native agentic pipeline runtime for Python backend engineers
Project description
State-Mesh
Async-native agentic pipeline runtime for Python backend engineers.
Why State-Mesh
- Typed state — Pydantic models flow through every step, no silent dict mutations
- Built-in MCP — register MCP servers once, every step can call any tool
- Production-ready — guardrails, structured output retry, OTel tracing, pipeline resumption out of the box
Features
- Async-first step execution with retry, timeout, and branching
- Parallel step execution with
asyncio.gather - Structured output contracts with automatic LLM retry
- Guard chain — schema, PII, confidence, toxicity guards built in
- MCP tool bus (SSE + stdio transport)
- OpenTelemetry tracing with swappable exporters
- Redis state backend with pipeline resumption
- FastAPI integration —
mount_pipeline,stream_pipeline,pipeline_router - Human-in-the-loop with timeout and fallback
Install
pip install state-mesh
pip install "state-mesh[redis]" # Redis backend
pip install "state-mesh[otel]" # OpenTelemetry
Quickstart
from state_mesh import step, Pipeline, Context, OutputContract
from pydantic import BaseModel
class Result(BaseModel):
summary: str
@step(output_contract=OutputContract(target_schema=Result))
async def summarise(prompt: str) -> str:
return await my_llm(prompt)
pipeline = Pipeline(steps=[summarise], name="summarise")
result = await pipeline.run(Context(state={}))
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
state_mesh-0.1.0.tar.gz
(26.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file state_mesh-0.1.0.tar.gz.
File metadata
- Download URL: state_mesh-0.1.0.tar.gz
- Upload date:
- Size: 26.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7451a44f5cc135a3783d92ab877a4a345d97a7f54b213626177e9a25a79bc3a
|
|
| MD5 |
f9e32cde29d8bc8c8ca292a919a9753d
|
|
| BLAKE2b-256 |
66c7805838eaaf15ecd51e0601649ccda97225c406f8f918611f08865b7430d9
|
File details
Details for the file state_mesh-0.1.0-py3-none-any.whl.
File metadata
- Download URL: state_mesh-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25bef17e43cd8c3f69dcf0da0ee5f651ba789dc731c70250250248dded9c16d7
|
|
| MD5 |
3aee95a44a72a43de5219b5b13273c23
|
|
| BLAKE2b-256 |
049d96fc7766524d859450d30fd13fdc9b04a2c39a5cd0519cd51b8f65262ae5
|