Prerequisites
Before you begin, make sure you have:- Python 3.10 or higher
- Docker installed (recommended)
- An LLM API key (OpenRouter, OpenAI, or Anthropic)
Get started in 5 steps
Set up API keys
Lerim needs an LLM provider for extraction and querying. Set at least one API key:
OpenRouter is the default provider. It gives you access to multiple models including GPT-5-nano (used for extraction) and Grok-4.1-fast (used for agents).
Initialize and add a project
Run the interactive setup wizard:This will:Now add your first project:This registers the current directory and creates a
- Detect your installed coding agents (Claude Code, Codex, Cursor, OpenCode)
- Ask which agents you want to connect
- Write the config to
~/.lerim/config.toml - Check for Docker availability
.lerim/ folder for project-specific memories.Start the Lerim service
Start Lerim as a Docker service:Output:This starts a Docker container that:Open the dashboard in your browser:
- Runs the sync + maintain daemon loop
- Serves the dashboard at
http://localhost:8765 - Exposes the HTTP API for CLI commands
The first time you run
lerim up, it will pull the Docker image from the registry. This may take a minute.Teach your agent about Lerim
Install the Lerim skill so your coding agent knows how to query past context:Check lerim for any relevant memories about [topic you’re working on].Your agent will run
lerim ask or lerim memory search to pull in past decisions and learnings before it starts working.
Force a sync
By default, Lerim syncs sessions automatically in the background. To trigger a manual sync:Run memory maintenance
Lerim automatically maintains memories in the background, but you can trigger it manually:- Merge duplicate memories
- Archive low-value entries
- Consolidate related memories
- Apply time-based decay
Managing the service
Running without Docker
If you prefer not to use Docker, run Lerim directly:lerim ask, lerim sync, lerim status, etc. as usual.
What’s happening in the background?
- Session indexing: Lerim watches your agent session stores (e.g.,
~/.claude/projects/,~/Library/Application Support/Cursor/User/globalStorage/) - Extraction: When new sessions are detected, Lerim extracts decision and learning candidates using DSPy pipelines
- Deduplication: Candidates are compared against existing memories to avoid duplicates
- Storage: New memories are written as markdown files to
.lerim/memory/(project scope) or~/.lerim/memory/(global scope) - Refinement: The maintain loop periodically merges duplicates, archives low-value entries, and applies time decay
Next steps
CLI reference
Master all Lerim commands
Configuration
Customize model providers, tracing, and more
Memory model
Understand how memories are stored and structured
Dashboard
Explore the web UI features
Having issues? Check the troubleshooting guide or open an issue on GitHub.