lerim memory¶
Manage the memory store directly — search, list, add, and reset memories.
Overview¶
The memory command group provides direct access to the memory store. Memories are stored as markdown files in .lerim/memory/ within each registered project. Use these subcommands to search, browse, manually create, or wipe memories.
Note
Subcommands that read memory (search, list) require a running server. Start it with lerim up (Docker) or lerim serve (direct).
memory search¶
Full-text keyword search across memory titles, bodies, and tags.
| Parameter | Default | Description |
|---|---|---|
query |
(required) | Search string to match against memories |
--project |
(auto) | Target project name |
--limit |
20 |
Maximum results to return |
memory list¶
List stored memories (decisions and learnings), ordered by recency.
| Parameter | Default | Description |
|---|---|---|
--project |
(auto) | Target project name |
--limit |
50 |
Maximum items to display |
--json |
off | Output structured JSON |
memory add¶
Manually create a memory record. Useful for codifying decisions or learnings that didn't come from an agent session.
| Parameter | Default | Description |
|---|---|---|
--title |
(required) | Short descriptive title |
--body |
(required) | Full body content |
--primitive |
learning |
Type: decision or learning |
--kind |
insight |
Kind: insight, procedure, friction, pitfall, preference |
--confidence |
0.7 |
Confidence score (0.0 to 1.0) |
--tags |
(none) | Comma-separated tags (e.g. python,testing,ci) |
# Add a simple learning
lerim memory add --title "Use uv for deps" --body "uv is faster than pip"
# Add a decision
lerim memory add --title "API auth" --body "Use bearer tokens" --primitive decision
# Full options
lerim memory add \
--title "Slow integration tests" \
--body "Integration suite takes 5 min" \
--kind friction \
--confidence 0.9 \
--tags ci,testing
memory reset¶
Irreversibly delete memory/, workspace/, and index/ under the selected scope.
| Parameter | Default | Description |
|---|---|---|
--yes |
(required) | Safety flag -- command refuses to run without it |
--scope |
both |
What to reset: project, global, or both |
Danger
This operation is irreversible. All memories, workspace artifacts, and index data within the selected scope will be permanently deleted.
Warning
--scope project alone does not reset the session queue. The sessions DB lives in ~/.lerim/index/sessions.sqlite3. Use --scope global or --scope both to fully reset.
lerim memory reset --yes # wipe everything
lerim memory reset --scope project --yes # project data only
lerim memory reset --yes && lerim sync --max-sessions 5 # fresh start
Exit codes¶
| Code | Meaning |
|---|---|
0 |
Success |
1 |
Runtime failure (server not running, write error) |
2 |
Usage error (missing required flags) |
Related commands¶
-
lerim ask
Query memories with natural language
-
lerim sync
Extract memories from agent sessions
-
lerim maintain
Offline memory refinement and deduplication
-
lerim status
Check memory counts and server state