Introduction
Python SDK for durable execution of multi-agent systems.
MultiRun
Python SDK for durable execution of multi-agent systems.
MultiRun makes building and scaling multi-agent systems as easy as deploying a web service. This SDK provides:
- Transactional steps with automatic retry and replay
- Durable checkpoints for failure recovery
- Budget controls for tokens, cost, steps, and sub-agents
- Framework adapters for LangGraph (CrewAI and AutoGen planned)
Install
pip install multirun
# With LangGraph support
pip install multirun[langgraph]Minimal example
import asyncio
import multirun
from multirun import run, step
from multirun.models import Budget
multirun.init("http://localhost:8989", api_key="your-api-key")
@step(retry=3, checkpoint=True)
async def call_llm(prompt: str) -> str:
return f"Response to: {prompt}"
@run(budget=Budget(max_tokens=10000, max_cost_usd=0.10))
async def my_agent(query: str) -> dict:
response = await call_llm(query)
return {"result": response}
async def main():
async with multirun.get_client():
result = await my_agent("What is the weather?")
print(result)
asyncio.run(main())SDK structure
| Module | Purpose |
|---|---|
multirun | Client, init(), init_local(), get_client() |
multirun.decorators | @run, @step, @checkpoint, @agent |
multirun.context | RunContext, AgentContext, StepContext |
multirun.models | Run, Step, Budget, Checkpoint, Policy, Agent |
multirun.exceptions | MultiRunError and subclasses |
multirun.adapters | LangGraph integration |
multirun.transport | Transport protocol, HTTP and local backends |
Next steps
- Getting Started — init, first run, decorator vs. client usage
- Decorators —
@run,@step,@checkpoint,@agentreference - Configuration — env vars and
MultiRunConfig - Examples — annotated walkthroughs