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
One recorded execution.
A different question each time.
Replay the run. Change one thing. Read the answer off a diff. Nothing reruns in production.
Search tool times out?
lookup_mode="timeout" Tool returns something else?
overrides={"checkpoint.lookup_order": stale_order} Retriever gets worse?
overrides={"checkpoint.retrieve": degraded_docs} Ignore the reranker?
overrides={"checkpoint.rerank": []} Run on a cheaper model?
model="fast" 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.
from agents import Runner
from agents.sandbox import SandboxAgent, Manifest
agent = SandboxAgent(
name="Compliance Reviewer",
model="gpt-5-mini",
default_manifest=manifest,
)
result = await Runner.run(agent, task) from kitaru.adapters.openai_agents import KitaruRunner, OpenAIRunRequest
from agents.sandbox import SandboxAgent, Manifest
agent = SandboxAgent(
name="Compliance Reviewer",
model="gpt-5-mini",
default_manifest=manifest,
)
runner = KitaruRunner(agent, checkpoint_strategy="calls")
result = await runner.run(OpenAIRunRequest.start(task)) from claude_agent_sdk import query, ClaudeAgentOptions
options = ClaudeAgentOptions(
system_prompt="You are a compliance reviewer.",
allowed_tools=[],
)
async for msg in query(prompt=task, options=options):
process(msg) from kitaru import flow
from claude_agent_sdk import ClaudeAgentOptions
from kitaru.adapters.claude_agent_sdk import ClaudeRunRequest, ClaudeRunResult, KitaruClaudeRunner
runner = KitaruClaudeRunner(
name="compliance_review",
options_factory=lambda request: ClaudeAgentOptions(
system_prompt="You are a compliance reviewer.",
allowed_tools=[],
max_turns=request.max_turns,
),
)
@flow
def review(task: str) -> ClaudeRunResult:
return runner.run_sync(ClaudeRunRequest.start(task, max_turns=3)) 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) 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) from anthropic import Anthropic
client = Anthropic()
def my_agent(task: str) -> str:
plan = analyze(client, task)
# crash here? everything above is lost.
result = execute(client, plan)
return result from kitaru import flow, checkpoint
from anthropic import Anthropic
client = Anthropic()
@flow
def my_agent(task: str) -> str:
plan = checkpoint(analyze)(client, task)
result = checkpoint(execute)(client, plan)
return result 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.
Wrap your agent so model/tool calls and steps exposed through Kitaru primitives or adapters become replayable checkpoints.
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 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") 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 Same 200 executions. Cheap model. Order lookup result replaced.
Illustrative numbers. Tool-level detail depends on the primitives or adapter boundaries your agent exposes to Kitaru.
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.
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.
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.
A few replays, no human in the loop. The diff is the agent’s reward signal.
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
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.