Kitaru

artifacts

Artifact helpers for explicit named artifacts.

kitaru.save() persists a named artifact inside a checkpoint. kitaru.load() retrieves a named artifact from a previous execution.

Both are valid only inside a checkpoint.

Example

from kitaru import checkpoint

@checkpoint
def research(topic: str) -> str:
    context = gather_sources(topic)
    kitaru.save("sources", context, type="context")
    return summarize(context)

# In a later execution:
@checkpoint
def refine(exec_id: str) -> str:
    old_sources = kitaru.load(exec_id, "sources")
    return improve(old_sources)
funcsave(name, value, *, type='output', tags=None) -> None

Persist a named artifact inside the current checkpoint.

paramnamestr

Artifact name (unique within the checkpoint).

paramvalueAny

The value to persist. Must be serializable.

paramtypestr
= 'output'

Artifact type for categorization (one of "prompt", "response", "context", "input", "output", "blob").

paramtagslist[str] | None
= None

Optional tags for filtering and discovery.

Returns

None
funcload(exec_id, name) -> Any

Load a named artifact from a previous execution.

paramexec_idstr

The execution ID to load from.

paramnamestr

The artifact name to retrieve.

Returns

typing.Any

The materialized artifact value.