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.1.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.1-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file state_mesh-0.1.1.tar.gz.

File metadata

  • Download URL: state_mesh-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 09f994a56bedfa70275ae087eda0c759461bc8fa2dd1cf22b84a904ddf7be76d
MD5 1ed1d437db5d50218af836b254ba19e6
BLAKE2b-256 2739762d04628f7b7d995a24fdf1872e858905df8d8919538657bdc2cf38f429

See more details on using hashes here.

File details

Details for the file state_mesh-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: state_mesh-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef8fcc522f06371021e73c8c6299d7c0215b2ecf3a964693d32dbae04b8e5464
MD5 b4294530a979f2f391f163437fc8b51d
BLAKE2b-256 7dca4d215d55847dcb95e334edc8e225269bc3962255b06f4d1252e554d61981

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