Kitaru

kitaru memory compact

Summarize memory values using an LLM and write the result as a new version.

Use --key for single-key mode (defaults to summarizing the current value of that key) or --keys for multi-key mode (summarizes the current value of each listed key). Use --source-mode history with --key to summarize the full non-deleted version history of one key instead. --key and --keys are mutually exclusive. Multi-key mode requires --target-key and supports only --source-mode current. In single-key mode, the summary is written to the source key unless --target-key is specified. Source entries are not deleted; run purge separately if you want to reclaim old history.

Usage

kitaru memory compact [OPTIONS]

Parameters

NameTypeRequiredDefaultDescription
--scopestrNoNoneMemory scope. [required]
--scope-typeLiteral[namespace, flow, execution]NoNoneMemory scope type. [required]
--keystrNoNoneSingle key to compact. Defaults to summarizing the current value; use --source-mode history for full version history.
--keystuple[str, Ellipsis]NoNoneMultiple keys whose current values should be merged into one summary.
--source-modeLiteral[current, history]No"current"Source selection for single-key compaction: current (default) or history. Multi-key compaction supports current only.
--target-keystrNoNoneKey to write the summary into. Defaults to the source key in single-key mode.
--instructionstrNoNoneCustom instruction for the LLM summarization.
--modelstrNoNoneLLM model to use for summarization.
--max-tokensintNoNoneMaximum response tokens for the LLM summarization.
--output, -ostrNo"text"Output format: "text" (default) or "json".

On this page