Skip to main content

Overview

Subcommands for managing the memory store directly. Memories are stored as markdown files in .lerim/memory/.

Subcommands

  • search - Search memories by keyword
  • list - List recent memory items
  • add - Create a new memory manually
  • reset - Destructive wipe of memory data

Full-text keyword search across memory titles, bodies, and tags. Matches are case-insensitive.

Syntax

lerim memory search <query> [--limit N] [--project NAME] [--json]

Parameters

query
string
required
Search string to match against memory title, body, and tags.
--limit
integer
default:"20"
Maximum results to return.
--project
string
Filter results to a specific project. Note: Not yet implemented.
--json
boolean
default:"false"
Output structured JSON instead of human-readable text.

Examples

# Search for database-related memories
lerim memory search 'database migration'

# Limit results
lerim memory search pytest --limit 5

# JSON output
lerim memory search 'auth' --json
Output:
.lerim/memory/decisions/auth-bearer-tokens.md
12:We chose bearer token authentication over session cookies

.lerim/memory/learnings/api-security.md
8:Bearer tokens simplify API authentication for mobile clients

list

Display a list of stored memories (decisions and learnings), ordered by recency.

Syntax

lerim memory list [--limit N] [--project NAME] [--json]

Parameters

--limit
integer
default:"50"
Maximum items to display.
--project
string
Filter to a specific project. Note: Not yet implemented.
--json
boolean
default:"false"
Output structured JSON with file paths.

Examples

# List all recent memories
lerim memory list

# Limit to 10 items
lerim memory list --limit 10

# JSON output for scripting
lerim memory list --json
Output:
/home/user/project/.lerim/memory/decisions/use-postgres.md
/home/user/project/.lerim/memory/learnings/async-patterns.md
/home/user/project/.lerim/memory/decisions/api-versioning.md
...

add

Manually create a single memory record from CLI flags. Writes a markdown file to .lerim/memory/{decisions,learnings}/.

Syntax

lerim memory add --title <title> --body <body> [OPTIONS]

Parameters

--title
string
required
Short descriptive title for the memory.
--body
string
required
Full body content of the memory.
--primitive
string
default:"learning"
Primitive type: decision (a choice made) or learning (an insight gained).Choices: decision, learning
--kind
string
default:"insight"
Semantic kind label.Common values: insight, procedure, friction, pitfall, preference
--confidence
float
default:"0.7"
Confidence score from 0.0 to 1.0.
--tags
string
Comma-separated tags for categorization (e.g. python,testing,ci).

Examples

# Add a simple learning
lerim memory add --title "Use uv for deps" --body "uv is faster than pip"

# Add a decision with metadata
lerim memory add \
  --title "API auth pattern" \
  --body "Use bearer tokens for stateless auth" \
  --primitive decision \
  --confidence 0.9 \
  --tags auth,api,security

# Add a friction point
lerim memory add \
  --title "Slow integration tests" \
  --body "Integration suite takes 5min to run" \
  --kind friction \
  --confidence 0.9 \
  --tags ci,testing,performance
Output:
Added memory: use-uv-for-deps -> /home/user/project/.lerim/memory/learnings/use-uv-for-deps.md

reset

Irreversibly delete memory/, workspace/, and index/ under the selected scope, then recreate canonical empty folders.
This is a destructive operation. All memories, workspaces, and index data will be permanently deleted.

Syntax

lerim memory reset --yes [--scope SCOPE]

Parameters

--yes
boolean
required
Required safety flag to confirm destructive reset. Without this, the command refuses to run.
--scope
string
default:"both"
What to reset:
  • project - Reset <repo>/.lerim/ only
  • global - Reset ~/.lerim/ only (includes sessions DB)
  • both - Reset both project and global roots (default)

Scope behavior

  • project: Resets <repo>/.lerim/ only (memories, workspace, index)
  • global: Resets ~/.lerim/ only (includes sessions DB in index/)
  • both: Resets both locations
The sessions DB lives in global index/, so --scope project alone does NOT reset the session queue. Use global or both for a full wipe.

Examples

# Wipe everything (both scopes)
lerim memory reset --yes

# Reset project data only
lerim memory reset --scope project --yes

# Fresh start with re-sync
lerim memory reset --yes && lerim sync --max-sessions 5
Output:
Memory reset completed:
- /home/user/project/.lerim: removed=45
- /home/user/.lerim: removed=128

What gets deleted

  • memory/ - All decisions, learnings, summaries, and archived items
  • workspace/ - All sync and maintain run artifacts
  • index/ - Session database and indexing data

What gets recreated

Canonical folder structure:
.lerim/
  memory/
    decisions/
    learnings/
    summaries/
    archived/
      decisions/
      learnings/
  workspace/
  index/

Exit codes

  • 0: Success
  • 1: Error - operation failed
  • 2: Usage error - invalid arguments or missing --yes flag

lerim ask

Ask questions using memory

lerim sync

Extract new memories from sessions

Build docs developers (and LLMs) love