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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
--scope | str | No | None | Memory scope. [required] |
--scope-type | Literal[namespace, flow, execution] | No | None | Memory scope type. [required] |
--key | str | No | None | Single key to compact. Defaults to summarizing the current value; use --source-mode history for full version history. |
--keys | tuple[str, Ellipsis] | No | None | Multiple keys whose current values should be merged into one summary. |
--source-mode | Literal[current, history] | No | "current" | Source selection for single-key compaction: current (default) or history. Multi-key compaction supports current only. |
--target-key | str | No | None | Key to write the summary into. Defaults to the source key in single-key mode. |
--instruction | str | No | None | Custom instruction for the LLM summarization. |
--model | str | No | None | LLM model to use for summarization. |
--max-tokens | int | No | None | Maximum response tokens for the LLM summarization. |
--output, -o | str | No | "text" | Output format: "text" (default) or "json". |