Kitaru by ZenML Open source · Apache 2.0

Ask “what if?” about your agent’s real runs

Change one thing. Replay. See what would have happened.

Kitaru turns the model/tool calls and steps your primitives or adapters expose into replayable checkpoints. Replay an execution ID with one input or checkpoint override and see what would have happened. No production reruns.

Lightweight, wraps your existing agent

uv init --bare && uv add kitaru && uv run kitaru init
THE SAME MOVE, EVERY TIME

One recorded execution.
A different question each time.

Replay the run. Change one thing. Read the answer off a diff. Nothing reruns in production.

fail

Search tool times out?

lookup_mode="timeout"
mock

Tool returns something else?

overrides={"checkpoint.lookup_order": stale_order}
degrade

Retriever gets worse?

overrides={"checkpoint.retrieve": degraded_docs}
drop

Ignore the reranker?

overrides={"checkpoint.rerank": []}
swap

Run on a cheaper model?

model="fast"
POWERED BY DURABLE EXECUTION

Keep your agent SDK. Make its runs replayable.

Wrap the calls and steps your SDK exposes, and Kitaru stores them as replayable checkpoints. That durable record is what replay reads back, so a what-if is faithful, not a guess.

Before agent.py
from pydantic_ai import Agent

agent = Agent(
    "openai:gpt-5-mini",
    system_prompt="You are a compliance reviewer.",
    tools=[search_docs, fetch_policy],
)

result = await agent.run(task)
With Kitaru agent.py
from kitaru.adapters.pydantic_ai import KitaruAgent
from pydantic_ai import Agent

agent = KitaruAgent(Agent(
    "openai:gpt-5-mini",
    system_prompt="You are a compliance reviewer.",
    tools=[search_docs, fetch_policy],
))

result = await agent.run(task)
THE WHAT-IF WORKFLOW

Find a cheaper model without touching production.

Same question every time: can it run cheaper, and does it survive a flaky tool result? Replay the runs you already have, change one thing, read the diff.

Start from Kitaru-recorded executions

Wrap your agent so model/tool calls and steps exposed through Kitaru primitives or adapters become replayable checkpoints.

01 Replay

Start from execution IDs

200 real executions whose Kitaru-visible steps and model/tool calls are already checkpointed. Production stays untouched.

exec_ids = cohort.exec_ids
02 Change one thing

Cheaper model, flaky tool

Replay from the decision point with a cheaper model, or replace a recorded lookup result. Production stays exactly as it was.

replay(id, from_="decide", model="fast")
03 Diff

See what would have happened

Compare each candidate to its source execution: cost, changed outputs, first divergence. The decision now has evidence.

cheap.llm_usage_summary
The diff

Same 200 executions. Cheap model. Order lookup result replaced.

−61% median cost
196 / 200 outputs identical
4 to review

Illustrative numbers. Tool-level detail depends on the primitives or adapter boundaries your agent exposes to Kitaru.

SEE THE CODE

Every what-if is one replay call.

Swap a model input, replace a checkpoint result, or replay with a test-mode flow input: one replay API, one change at a time. Hover any line to see what it does.

whatif.py
import kitaru
 
client = kitaru.KitaruClient()
# your agent exposes replayable checkpoints through Kitaru
source = support_agent.run(ticket)
result = source.wait()
 
# reproduce faithfully, then change ONE thing
baseline = client.executions.replay(
source.exec_id, from_="decide",
)
cheaper = client.executions.replay(
source.exec_id, from_="decide", model="glm-5.4",
)
faked = client.executions.replay(
source.exec_id, from_="lookup_order",
overrides={"checkpoint.lookup_order": stale_order},
)
timeout = client.executions.replay(
source.exec_id, from_="lookup_order", lookup_mode="timeout",
)
 
usage = cheaper.llm_usage_summary
support_agent.run()

Run in production. Keep the returned handle: it carries the execution ID that replay needs.

replay(from_="decide")

Reproduce from a checkpoint with no change. Earlier checkpoints reuse recorded outputs. The faithful baseline.

model="glm-5.4"

Pass a different flow input for this replay. Same execution history, cheaper model choice.

overrides=checkpoint...

Replace one recorded checkpoint result. Kitaru replays the consumers of that changed value.

lookup_mode="timeout"

Use a flow input your agent already understands to run the replay against a timeout path.

llm_usage_summary

Inspect shipped execution metadata, checkpoints, and artifacts to compare the source execution and replay.

AGENT-DRIVEN EXPERIMENTATION

Don’t run the experiments. Let your agent hill-climb.

Kitaru exposes replay and diff over an MCP server and a CLI. Point your coding agent at it: it replays a run, changes one thing, reads the diff, and tries the next idea, climbing toward a cheaper, safer version while you watch.

Drive it from
Claude Code Codex Cursor Gemini CLI or any harness that speaks MCP
agent · kitaru mcp
replay #4127 · from_="decide" · model="gpt-5-mini"
81% cheaper, but skipped the escalation ✗
replay #4127 · from_="decide" · model="fast"
78% cheaper, decisions match ✓
kept this variant, opening a PR

A few replays, no human in the loop. The diff is the agent’s reward signal.

FROM LAPTOP TO CLOUD

From laptop session to enterprise runtime.

Run the same agent flow locally, then move it to Kubernetes, SageMaker, Vertex AI, or AzureML with artifacts in your own bucket.

uv init --bare && uv add kitaru && uv run kitaru init
Kitaru dashboard showing an execution with its checkpoints, logs, and cost
Checkpoints, artifacts, replay, and logs ship with the server.

Change one thing. Replay the run.
See what would have happened.

uv init --bare && uv add kitaru && uv run kitaru init

Open source (Apache 2.0). Ask what-if about a real run. No rerunning in production.