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) -> NonePersist a named artifact inside the current checkpoint.
paramnamestrArtifact name (unique within the checkpoint).
paramvalueAnyThe value to persist. Must be serializable.
paramtypestr= 'output'Artifact type for categorization (one of "prompt",
"response", "context", "input", "output",
"blob").
paramtagslist[str] | None= NoneOptional tags for filtering and discovery.
Returns
Nonefuncload(exec_id, name) -> AnyLoad a named artifact from a previous execution.
paramexec_idstrThe execution ID to load from.
paramnamestrThe artifact name to retrieve.
Returns
typing.AnyThe materialized artifact value.