Search and retrieve past decisions and learnings from your coding agent sessions
Lerim extracts decisions and learnings from your agent sessions and stores them as plain markdown files. You can query these memories directly from the CLI or teach your agents to query them automatically.
The fastest way to find memories is keyword search using ripgrep under the hood:
lerim memory search "authentication pattern"
This searches across memory titles, bodies, and tags (case-insensitive):
/Users/you/work/my-app/.lerim/memory/decisions/auth-bearer-tokens.md4:title: "Auth pattern: bearer tokens"5:We chose bearer tokens over session cookies because our API is stateless./Users/you/work/my-app/.lerim/memory/learnings/jwt-refresh.md3:JWT refresh tokens expire after 7 days. Document this in the API guide.
For questions that need synthesis across multiple memories, use lerim ask:
lerim ask "What auth pattern do we use?"
Output:
We use bearer tokens for API authentication. JWTs are issued on login and refreshed every 7 days. This was chosen over session cookies because the backend is stateless.Related decisions:- auth-bearer-tokens.md: Initial auth pattern selection- jwt-refresh.md: Token lifecycle and expiration policy
lerim ask requires a running Lerim server (lerim up or lerim serve). It queries the HTTP API to retrieve and synthesize memories.
Check lerim for any relevant memories about [topic you're working on].
Your agent will:
Run lerim memory search or lerim ask
Read the results
Use that context to inform its responses
Avoid repeating past mistakes or reinventing solutions
Agents should use memory search by default (it’s faster and doesn’t require the server). Use ask only when synthesis across multiple memories is needed.
Memories are stored as markdown files with YAML frontmatter:
---id: auth-bearer-tokenstitle: "Auth pattern: bearer tokens"created: 2026-02-15T14:23:00Zupdated: 2026-02-15T14:23:00Zsource: claude-abc123confidence: 0.9tags: [auth, api, security]---We chose bearer tokens over session cookies because our API is stateless.JWTs are issued on login with a 7-day expiration. Refresh tokens are storedin httpOnly cookies.**Alternatives considered:**- Session cookies: Requires server-side session store- OAuth2: Overkill for internal API**Related:**- See jwt-refresh.md for token lifecycle