For the complete documentation index, see llms.txt. This page is also available as Markdown.

Welcome to Kitaru

The runtime for production AI agents. Run, replay, improve.

Kitaru is the runtime for production AI agents: run, replay, improve. It records every model call and tool call as a durable checkpoint, then lets you re-execute a real run faithfully with one thing changed — a different model, a different prompt — and diff the result against the original. Because the baseline reproduces, the difference you see is your change, not replay noise.

The harness you already picked (PydanticAI, OpenAI Agents SDK, LangGraph, Claude Agent SDK, raw Python) keeps owning how the agent thinks. Kitaru owns the run record and the replay loop. A Kitaru flow is a dynamic ZenML pipeline, so agents run on the same stacks, server, and dashboard as your ZenML pipelines.

Run, replay, improve

  • Run (durable). Every @checkpoint is a durable unit of work; its output is persisted automatically, and every model and tool call is recorded. If a flow fails partway, replaying it reuses recorded results instead of re-running expensive work.

  • Replay (the differentiator). Re-execute a recorded run from any checkpoint. A plain rerun with no change reproduces the original — that is your baseline. Replay again with one input overridden and diff the two. This re-executes the real run from a checkpoint; it is not re-scoring saved outputs like an eval.

  • Improve. Apply the same change across a cohort of recent runs, measure cost, latency, and quality, and keep the winner.

Kitaru is self-host-first: a single-service server on your own Kubernetes, artifacts in your own S3/GCS/Azure Blob. No mandatory SaaS control plane in the path of your agent's data. See Harness, Runtime, Platform for where Kitaru fits.

The replay loop

import kitaru
from kitaru import checkpoint, flow

@checkpoint
def research(topic: str) -> str:
    return kitaru.llm(f"Summarize {topic} in two sentences.")

@checkpoint
def draft_report(summary: str) -> str:
    return kitaru.llm(f"Write a short report based on: {summary}")

@flow
def research_agent(topic: str) -> str:
    summary = research(topic)
    return draft_report(summary)

if __name__ == "__main__":
    # Run, then replay from a checkpoint with one input changed.
    run = research_agent.run(topic="Why do agents need durable execution?").wait()

    baseline = research_agent.replay(run.exec_id, at="draft_report")
    variant = research_agent.replay(
        run.exec_id,
        at="draft_report",
        flow_overrides={"model": "anthropic/claude-opus-4"},
    )
    # baseline reproduces the original; diff variant against it to isolate your change.

run(...) returns a handle; .wait() blocks for the result and exposes .exec_id. replay(exec_id, at="<checkpoint>", flow_overrides={...}) re-executes from that checkpoint, overriding flow inputs such as the model or prompt profile. The same loop is available over the CLI and the MCP server so a coding agent can drive it.

See the Quickstart to install and run this yourself.

Where ZenML fits

Kitaru is built by the team behind ZenML, the open-source framework for production ML and LLM pipelines, and runs on the same foundations. Each project works on its own — you can use Kitaru without ever touching ZenML. If you use both, they compose rather than coexist: a Kitaru flow is a dynamic ZenML pipeline under the hood, so your agents and pipelines run on the same stacks, persist artifacts to the same stores, and show up in the same server and dashboard. If your work is ML pipelines rather than agents, start with the ZenML docs — and if you want the narrative tutorial for agents, the Agents guide sits alongside ZenML's Starter, Production, and LLMOps guides in the shared Learn section.

Runtime primitives

These are the primitives Kitaru adds on top of your existing Python agent code. You keep your harness and your control flow; Kitaru records the run and makes it replayable.

  • Replay and override: Re-execute any run from any checkpoint — to recover from a failure, or with overrides (a different model or parameter) to isolate the effect of a change before you ship it. Use invocation overrides when you need to change one recorded checkpoint, tool, or model call instead of every call with the same checkpoint name.

  • Durable execution: Wrap steps in @checkpoint and your agent picks up where it left off without re-running expensive work

  • Wait and resume: Add kitaru.wait() and let agents pause for a human, another system, or later input; after the polling timeout, compute is released and the run resumes when input lands

  • Artifact lineage: Every checkpoint output is written to your object store as a typed, versioned artifact — step through runs, diff outputs across runs, and trace a bad final output back to the exact step that produced it

  • Execution management: KitaruClient lets you inspect, replay, retry, resume, and cancel executions from code or CLI

  • Tracked LLM calls: Use kitaru.llm() and every call gets automatic secret resolution, prompt/response capture, and token/latency logging

  • Persistent data: kitaru.save() / kitaru.load() let agents store and retrieve files, objects, and results across executions

  • Structured observability: kitaru.log() attaches key-value metadata to any checkpoint or flow for debugging and the UI

  • Runtime configuration: kitaru.configure() sets your model, log store, and stack defaults in one call

  • Framework and infrastructure portability: Keep your Python control flow, use your preferred framework, and run locally or on remote stacks — Kubernetes, Vertex AI, SageMaker, AzureML

Next steps

Last updated

Was this helpful?