Metadata-Version: 2.4
Name: stroma
Version: 0.1.1
Summary: Framework-agnostic agent reliability primitives for enforcing contracts, checkpointing, tracing, and execution.
License-Expression: MIT
Project-URL: Homepage, https://github.com/jengroff/stroma
Project-URL: Repository, https://github.com/jengroff/stroma
Project-URL: Issues, https://github.com/jengroff/stroma/issues
Keywords: agents,reliability,contracts,checkpointing,tracing,llm
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Typing :: Typed
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.0
Provides-Extra: redis
Requires-Dist: redis>=5.0; extra == "redis"
Provides-Extra: langgraph
Requires-Dist: langgraph>=0.2; extra == "langgraph"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: ty; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.6.1; extra == "docs"
Requires-Dist: mkdocs-material; extra == "docs"
Requires-Dist: mkdocstrings[python]; extra == "docs"
Dynamic: license-file

# Stroma

**Reliability primitives for agent pipelines.**

```python
from pydantic import BaseModel
from stroma import StromaRunner

class Input(BaseModel):
    value: int

class Output(BaseModel):
    result: int

runner = StromaRunner.quick()

@runner.node("double", input=Input, output=Output)
async def double(state: Input) -> dict:
    return {"result": state.value * 2}

result = await runner.run([double], Input(value=5))
print(result.final_state)  # result=10
```

## Install

```bash
pip install stroma
```

Optional extras:

```bash
pip install stroma[redis]       # Redis-backed checkpointing
pip install stroma[langgraph]   # LangGraph adapter
```

## What You Get

- **Contracts** — Pydantic-based input/output validation at every node boundary
- **Failure classification** — automatic categorization of errors as recoverable, terminal, or ambiguous
- **Retry policies** — configurable retries with jittered backoff per failure class
- **Checkpointing** — save and resume pipelines across crashes (in-memory or Redis)
- **Cost tracking** — enforce token, dollar, and latency budgets across your pipeline
- **Execution tracing** — full record of every node attempt, with diffing and JSON export
- **LangGraph adapter** — apply contracts to existing LangGraph graphs
- **Framework-agnostic** — works with any async Python code, no framework lock-in

## Documentation

Full documentation including a tutorial and API reference is available at the [docs site](https://jengroff.github.io/stroma).

## Development

```bash
pip install -e ".[dev]"
uv run pytest tests/ -v --cov=stroma --cov-fail-under=90
```

## License

MIT
