Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

state_mesh-0.1.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

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

Hashes for state_mesh-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a7451a44f5cc135a3783d92ab877a4a345d97a7f54b213626177e9a25a79bc3a
MD5 f9e32cde29d8bc8c8ca292a919a9753d
BLAKE2b-256 66c7805838eaaf15ecd51e0601649ccda97225c406f8f918611f08865b7430d9

See more details on using hashes here.

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

Hashes for state_mesh-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25bef17e43cd8c3f69dcf0da0ee5f651ba789dc731c70250250248dded9c16d7
MD5 3aee95a44a72a43de5219b5b13273c23
BLAKE2b-256 049d96fc7766524d859450d30fd13fdc9b04a2c39a5cd0519cd51b8f65262ae5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page