Metadata-Version: 2.4
Name: state-mesh
Version: 0.1.1
Summary: Async-native agentic pipeline runtime for Python backend engineers
Project-URL: Homepage, https://github.com/statemesh-123/state-mesh-agent-runtime
Project-URL: Repository, https://github.com/statemesh-123/state-mesh-agent-runtime
Project-URL: Issues, https://github.com/statemesh-123/state-mesh-agent-runtime/issues
Author-email: Jayaprabha & Meghala <statemesh@gmail.com>
License: MIT
Keywords: agent,async,llm,pipeline,runtime
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.11
Requires-Dist: anyio>=4.0
Requires-Dist: fastapi>=0.100
Requires-Dist: mcp>=1.0
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: httpx; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: otel
Requires-Dist: opentelemetry-api>=1.20; extra == 'otel'
Requires-Dist: opentelemetry-sdk>=1.20; extra == 'otel'
Provides-Extra: postgres
Requires-Dist: asyncpg>=0.29; extra == 'postgres'
Provides-Extra: redis
Requires-Dist: redis>=5.0; extra == 'redis'
Provides-Extra: toxicity
Requires-Dist: detoxify>=0.5; extra == 'toxicity'
Description-Content-Type: text/markdown

# 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

```bash
pip install state-mesh
pip install "state-mesh[redis]"   # Redis backend
pip install "state-mesh[otel]"    # OpenTelemetry
```

## Quickstart

```python
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
