Lerim watches coding-agent sessions and builds reusable project memory automatically.
It helps your coding workflow keep memory across sessions and across tools, without vendor lock-in. Instead of losing decisions, reasoning, and project context every time a session ends, Lerim extracts and consolidates that memory in the background and stores it locally as plain markdown.
Supported session adapters today: Claude Code, Codex CLI, Cursor, and OpenCode.
Coding agents are useful, but they forget too much.
A typical workflow looks like this:
- you work with an agent
- important decisions get made
- the session ends
- the next session starts with less context
- the same reasoning gets repeated again
Lerim fixes that.
It runs as a background memory agent for coding workflows. It watches sessions, extracts durable project memory, consolidates it over time, and lets you inspect or query what the workflow has learned.
Many tools give you memory infrastructure.
Lerim is different because it is workflow-native.
It does not only store memory.
It actively works on your coding workflow.
Lerim is built around three jobs:
- Extract memory from coding-agent sessions
- Consolidate memory over time
- Track project stream status as work evolves
That means Lerim is not just a database, vector store, or memory SDK.
It is a background memory agent.
With Lerim, you can:
- keep project decisions across sessions
- preserve reasoning and implementation context
- share memory across different coding agents
- ask questions against past work
- keep memory local and file-based
Memories are stored as plain markdown in:
<repo>/.lerim/memory/
with fallback storage under:
~/.lerim/memory/
Prerequisites:
- Python 3.10+
- Docker recommended
Install Lerim:
pip install lerim
Start the service:
lerim up
Check that it is running:
lerim status
Or watch live activity:
lerim status --live
Starts Lerim in the background.
This is the command you run when you want Lerim to begin watching your workflow and processing memory tasks.
Shows service health and current status.
Useful for checking whether Lerim is up and connected.
Shows live status updates.
This is the best command for demos because it makes background extraction visible.
Indexes sessions and extracts candidate memories from recent work. This is done automatically by the docker container and based on the intervals you set in the config file under ~/.lerim/config.toml file.
Improves memory quality over time by merging duplicates, archiving weak items, and refreshing useful memories. This will also runs based on the interval you set in the ~/.lerim/config.toml file.
Lets you ask questions against accumulated project memory.
Example:
lerim ask "Why did we choose SQLite for local metadata?"
lerim init can help with setup. Then you can override the configs in the ~/.lerim/config.toml file.
API keys are read from environment variables, stored by default in:
~/.lerim/.env
Example:
MINIMAX_API_KEY=your-key
OPENROUTER_API_KEY=your-key`
OPENAI_API_KEY=your-key`
ZAI_API_KEY=your-keyExample provider config:
[roles.agent]
provider = "minimax"
model = "MiniMax-M2.7"
fallback_models = ["zai:glm-4.7"]lerim status
lerim status --live
lerim logs --follow
lerim queue
lerim queue --failed
lerim memory list --limit 20Setup and management:
lerim connect auto
lerim project list
lerim project remove <name>
lerim skill installAlternative to Docker:
lerim serve
Lerim runs three agent flows:
syncfor indexing sessions and extracting memoriesmaintainfor improving memory quality over timeaskfor answering questions with memory context and citations
This makes Lerim useful not only as storage, but as an ongoing background process for project memory.
Lerim is for developers who:
- use coding agents regularly
- work across multiple sessions
- switch between different coding tools
- want local, reusable, project-level memory
- want memory continuity without vendor lock-in
Lerim is not just a vector store.
Lerim is not only a memory SDK.
Lerim is not tied to one coding assistant.
It is a background memory agent for coding workflows.
- Website: https://lerim.dev
- Docs: https://docs.lerim.dev
- PyPI: https://pypi.org/project/lerim/
uv venv && source .venv/bin/activate
uv pip install -e '.[test]'
tests/run_tests.sh unit
tests/run_tests.sh qualityContributions are welcome.
If you want to help, good starting points are:
-
session adapters and adding more agents
-
extraction quality
-
memory consolidation quality
-
docs and demo examples
-
Read the Contributing Guide
-
Browse open issues
-
Agent adapter PRs are especially appreciated -- see
src/lerim/adapters/for examples
