Skip to content

lerim maintain

Refine existing memories offline (cold path).

Overview

Cold-path: offline memory refinement. Scans existing memories and merges duplicates, archives low-value items, and consolidates related memories. Archived items go to memory/archived/{decisions,learnings}/. Requires a running server (lerim up or lerim serve).

Syntax

lerim maintain [--force] [--dry-run]

Parameters

--force boolean default: off

Force maintenance even if a recent run was completed.

--dry-run boolean default: off

Record a run but skip actual memory changes.

Examples

lerim maintain                # run one maintenance pass
lerim maintain --force        # force maintenance even if recently run
lerim maintain --dry-run      # preview only, no writes

What maintenance does

  1. Scan — Load all existing decision and learning files from memory/
  2. Merge duplicates — Identify and consolidate similar memories
  3. Archive low-value — Move memories with low effective confidence to memory/archived/
  4. Consolidate — Group and strengthen related learnings
  5. Apply decay — Reduce confidence for memories that haven't been accessed recently

Non-destructive

Maintenance is non-destructive — archived memories are moved to memory/archived/ rather than deleted.