Pyrula
Every step, model call and tool call is journaled, so a run resumes after a crash, reruns with a change and replays as a test.
pip install "pyrula[agents]"pyrula initpyrula dev app.pyThe scaffold talks to a scripted model, so it needs no key, broker or account. Until release, install is a source build (Install).
Run, what-if, case, CI
Section titled “Run, what-if, case, CI”| On your machine | With Pyrula Cloud | |
|---|---|---|
| Run | pyrula dev journals every step, model and tool call. A completed step is never re-run after a crash. |
Every worker’s runs in one timeline (Connect). |
| What-if | pyrula case run --prompt-file or --model: model calls run live, recorded tool results answer the rest. |
Fork a finished run and change its input, a step result, the model or the prompt. Writes denied, budget on (What-if runs). |
| Case | pyrula dev keeps the newest finished run in .pyrula/last/. |
Save a run or a what-if as a case, stored in your fixture store (Saved cases). |
| CI | pytest --pyrula-cases cases: no model call, no network. |
pyrula ci run or the replay-check GitHub Action (Replay checks in CI). |
A safe agent
Section titled “A safe agent”from pyrula.agents import AgentContext, AgentLimits, ToolContext, agent, tool
@tool(read_only=True)async def lookup_order(ctx: ToolContext, order_id: str) -> dict: return {"status": "delivered", "total_cents": 25_000}
@tool(requires_approval=lambda args: args["cents"] > 10_000, approval_timeout=3600)async def refund(ctx: ToolContext, order_id: str, cents: int) -> str: return f"refunded {cents} cents on {order_id}"
@agent(limits=AgentLimits(max_cost_usd=2.50, max_total_tokens=200_000))async def support(ctx: AgentContext, message: str) -> str: return await ctx.llm.run([{"role": "user", "content": message}], tools=[lookup_order, refund])A refund over $100 parks the run until someone approves it, and an hour with no answer denies it
(Approval). Run a
worker for this agent, since pyrula dev
refuses approval_timeout.
The engine
Section titled “The engine”
Agents
@agent and @tool on the durable engine. Anthropic, OpenAI and LiteLLM clients, MCP, an HTTP surface.
Workflows
Steps, timers, signals and children, replayed from an append-only journal on SQLite or Valkey.
Kafka
A pure-Rust client, no librdkafka. Agent output and its offset commit can share one transaction.
Primitives
Rust-backed Either, Option, Try, immutable IList/IMap, serde.
Coming from Pydantic AI, LangGraph, Celery, Temporal or FastAPI? For coding agents: llms.txt.