|
2 | 2 | <img src="assets/lerim.png" alt="Lerim Logo" width="160"> |
3 | 3 | </p> |
4 | 4 |
|
5 | | -<h3 align="center">Persistent memory for coding agents.</h3> |
| 5 | +<h3 align="center">Background memory agent for coding workflows.</h3> |
6 | 6 |
|
7 | 7 | <p align="center"> |
8 | 8 | <a href="https://pypi.org/project/lerim/"><img src="https://img.shields.io/pypi/v/lerim?style=flat-square&color=blue" alt="PyPI version"></a> |
|
14 | 14 |
|
15 | 15 | <p align="center"><a href="https://lerim.dev/">lerim.dev</a> · <a href="https://docs.lerim.dev/">docs</a> · <a href="https://pypi.org/project/lerim/">pypi</a></p> |
16 | 16 |
|
17 | | -## Summary |
| 17 | +# Lerim |
18 | 18 |
|
19 | | -Lerim is a memory layer for coding agents. |
20 | | -It watches agent sessions, extracts durable memories with PydanticAI, and saves them as plain markdown in `.lerim/memory/`. |
| 19 | +Lerim watches coding-agent sessions and builds reusable project memory automatically. |
21 | 20 |
|
22 | | -Why teams use it: |
| 21 | +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. |
23 | 22 |
|
24 | | -- Keep project decisions and reasoning across sessions. |
25 | | -- Share context between different coding agents. |
26 | | -- Ask questions against past work with `lerim ask`. |
27 | | -- Keep data local and file-based. |
| 23 | +Supported session adapters today: **Claude Code, Codex CLI, Cursor, and OpenCode**. |
28 | 24 |
|
29 | | -Supported session adapters today: Claude Code, Codex CLI, Cursor, and OpenCode. |
| 25 | +## Why Lerim |
30 | 26 |
|
31 | | -## How to use |
| 27 | +Coding agents are useful, but they forget too much. |
32 | 28 |
|
33 | | -Prerequisites: Python 3.10+ and Docker (recommended). |
| 29 | +A typical workflow looks like this: |
34 | 30 |
|
35 | | -Install and bootstrap: |
| 31 | +- you work with an agent |
| 32 | +- important decisions get made |
| 33 | +- the session ends |
| 34 | +- the next session starts with less context |
| 35 | +- the same reasoning gets repeated again |
36 | 36 |
|
37 | | -```bash |
38 | | -pip install lerim |
39 | | -lerim init |
40 | | -lerim project add . |
41 | | -lerim up |
42 | | -``` |
| 37 | +Lerim fixes that. |
43 | 38 |
|
44 | | -If you want a local Docker build instead of pulling from GHCR: |
| 39 | +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. |
45 | 40 |
|
46 | | -```bash |
47 | | -lerim up --build |
48 | | -``` |
| 41 | +## What makes Lerim different |
49 | 42 |
|
50 | | -Use `--build` from a source checkout (local `Dockerfile` available). For normal PyPI installs, use `lerim up`. |
| 43 | +Many tools give you memory infrastructure. |
51 | 44 |
|
52 | | -Daily flow: |
| 45 | +Lerim is different because it is **workflow-native**. |
53 | 46 |
|
54 | | -```bash |
55 | | -lerim sync |
56 | | -lerim maintain |
57 | | -lerim ask "Why did we choose this approach?" |
58 | | -``` |
| 47 | +It does not only store memory. |
| 48 | +It actively works on your coding workflow. |
59 | 49 |
|
60 | | -These commands call the running Lerim service (`lerim up` or `lerim serve`). |
| 50 | +Lerim is built around three jobs: |
61 | 51 |
|
62 | | -Quick validation flow before release: |
| 52 | +1. **Extract** memory from coding-agent sessions |
| 53 | +2. **Consolidate** memory over time |
| 54 | +3. **Track** project stream status as work evolves |
63 | 55 |
|
64 | | -```bash |
65 | | -lerim down |
66 | | -lerim up --build |
67 | | -lerim sync |
68 | | -lerim maintain |
69 | | -lerim ask "What are the latest important memories?" |
70 | | -``` |
| 56 | +That means Lerim is not just a database, vector store, or memory SDK. |
71 | 57 |
|
72 | | -## Runtime model |
| 58 | +It is a **background memory agent**. |
73 | 59 |
|
74 | | -Lerim runs three PydanticAI-based agent flows: |
| 60 | +## What you get |
75 | 61 |
|
76 | | -- `sync`: indexes sessions and extracts memories. |
77 | | -- `maintain`: merges duplicates, archives low-value items, refreshes memory quality. |
78 | | -- `ask`: answers questions with memory context and citations. |
| 62 | +With Lerim, you can: |
79 | 63 |
|
80 | | -Memories are markdown files under project scope (`<repo>/.lerim/memory/`) with fallback in `~/.lerim/memory/`. |
| 64 | +- keep project decisions across sessions |
| 65 | +- preserve reasoning and implementation context |
| 66 | +- share memory across different coding agents |
| 67 | +- ask questions against past work |
| 68 | +- keep memory local and file-based |
| 69 | + |
| 70 | +Memories are stored as plain markdown in: |
| 71 | + |
| 72 | +`<repo>/.lerim/memory/` |
| 73 | + |
| 74 | +with fallback storage under: |
| 75 | + |
| 76 | +`~/.lerim/memory/` |
| 77 | + |
| 78 | +## Quick start |
| 79 | + |
| 80 | +Prerequisites: |
| 81 | + |
| 82 | +- Python 3.10+ |
| 83 | +- Docker recommended |
| 84 | + |
| 85 | +Install Lerim: |
| 86 | + |
| 87 | +`pip install lerim` |
| 88 | + |
| 89 | +Start the service: |
| 90 | + |
| 91 | +`lerim up` |
| 92 | + |
| 93 | +Check that it is running: |
| 94 | + |
| 95 | +`lerim status` |
| 96 | + |
| 97 | +Or watch live activity: |
| 98 | + |
| 99 | +`lerim status --live` |
| 100 | + |
| 101 | +## Basic workflow |
| 102 | + |
| 103 | +A simple daily flow looks like this: |
| 104 | + |
| 105 | +`lerim sync` |
| 106 | +`lerim maintain` |
| 107 | +`lerim ask "Why did we choose this approach?"` |
| 108 | + |
| 109 | +These commands use the running Lerim service started with `lerim up` or `lerim serve`. |
| 110 | + |
| 111 | +## What the commands do |
| 112 | + |
| 113 | +### `lerim up` |
| 114 | + |
| 115 | +Starts Lerim in the background. |
| 116 | + |
| 117 | +This is the command you run when you want Lerim to begin watching your workflow and processing memory tasks. |
| 118 | + |
| 119 | +### `lerim status` |
| 120 | + |
| 121 | +Shows service health and current status. |
| 122 | + |
| 123 | +Useful for checking whether Lerim is up and connected. |
| 124 | + |
| 125 | +### `lerim status --live` |
| 126 | + |
| 127 | +Shows live status updates. |
| 128 | + |
| 129 | +This is the best command for demos because it makes background extraction visible. |
| 130 | + |
| 131 | +### `lerim sync` |
| 132 | + |
| 133 | +Indexes sessions and extracts candidate memories from recent work. |
| 134 | + |
| 135 | +### `lerim maintain` |
| 136 | + |
| 137 | +Improves memory quality over time by merging duplicates, archiving weak items, and refreshing useful memories. |
| 138 | + |
| 139 | +### `lerim ask` |
| 140 | + |
| 141 | +Lets you ask questions against accumulated project memory. |
| 142 | + |
| 143 | +Example: |
| 144 | + |
| 145 | +`lerim ask "Why did we choose SQLite for local metadata?"` |
| 146 | + |
| 147 | +## Demo flow |
| 148 | + |
| 149 | +A strong demo flow for Lerim is: |
| 150 | + |
| 151 | +1. Use a coding agent in a small test repo |
| 152 | +2. Make one or two clear project decisions |
| 153 | +3. Start Lerim with `lerim up` |
| 154 | +4. Watch live extraction with `lerim status --live` |
| 155 | +5. Show generated memory under `.lerim/memory/` |
| 156 | +6. Ask Lerim a question about the earlier session |
| 157 | + |
| 158 | +Example: |
| 159 | + |
| 160 | +`pip install lerim` |
| 161 | +`lerim up` |
| 162 | +`lerim status --live` |
| 163 | +`lerim ask "What are the latest important memories?"` |
81 | 164 |
|
82 | 165 | ## Configuration |
83 | 166 |
|
84 | | -`lerim init` can set this up for you. |
85 | | -API keys are read from environment variables (stored in `~/.lerim/.env` by default). |
| 167 | +`lerim init` can help with setup. |
86 | 168 |
|
87 | | -```bash |
88 | | -# ~/.lerim/.env |
89 | | -MINIMAX_API_KEY=your-key |
90 | | -# add provider keys you use: |
91 | | -# OPENROUTER_API_KEY, OPENAI_API_KEY, MINIMAX_API_KEY, ZAI_API_KEY |
92 | | -``` |
| 169 | +API keys are read from environment variables, stored by default in: |
93 | 170 |
|
94 | | -Default provider example (MiniMax): |
| 171 | +`~/.lerim/.env` |
95 | 172 |
|
96 | | -```toml |
97 | | -[roles.agent] |
98 | | -provider = "minimax" |
99 | | -model = "MiniMax-M2.7" |
100 | | -fallback_models = ["zai:glm-4.7"] |
101 | | -``` |
| 173 | +Example: |
102 | 174 |
|
103 | | -## Commands |
| 175 | +`MINIMAX_API_KEY=your-key` |
| 176 | +`OPENROUTER_API_KEY=your-key` |
| 177 | +`OPENAI_API_KEY=your-key` |
| 178 | +`ZAI_API_KEY=your-key` |
104 | 179 |
|
105 | | -Most-used commands: |
| 180 | +Example provider config: |
106 | 181 |
|
107 | | -```bash |
108 | | -lerim status |
109 | | -lerim status --live |
110 | | -lerim logs --follow |
111 | | -lerim queue |
112 | | -lerim queue --failed |
113 | | -lerim unscoped --limit 20 |
114 | | -lerim memory list --limit 20 |
115 | | -``` |
| 182 | +`[roles.agent]` |
| 183 | +`provider = "minimax"` |
| 184 | +`model = "MiniMax-M2.7"` |
| 185 | +`fallback_models = ["zai:glm-4.7"]` |
| 186 | + |
| 187 | +## Most-used commands |
| 188 | + |
| 189 | +`lerim status` |
| 190 | +`lerim status --live` |
| 191 | +`lerim logs --follow` |
| 192 | +`lerim queue` |
| 193 | +`lerim queue --failed` |
| 194 | +`lerim unscoped --limit 20` |
| 195 | +`lerim memory list --limit 20` |
116 | 196 |
|
117 | 197 | Setup and management: |
118 | 198 |
|
119 | | -```bash |
120 | | -lerim connect auto |
121 | | -lerim project list |
122 | | -lerim project remove <name> |
123 | | -lerim skill install |
124 | | -``` |
| 199 | +`lerim connect auto` |
| 200 | +`lerim project list` |
| 201 | +`lerim project remove <name>` |
| 202 | +`lerim skill install` |
125 | 203 |
|
126 | 204 | Alternative to Docker: |
127 | 205 |
|
128 | | -```bash |
129 | | -lerim serve |
130 | | -``` |
| 206 | +`lerim serve` |
| 207 | + |
| 208 | +## How Lerim works |
| 209 | + |
| 210 | +Lerim runs three agent flows: |
| 211 | + |
| 212 | +- `sync` for indexing sessions and extracting memories |
| 213 | +- `maintain` for improving memory quality over time |
| 214 | +- `ask` for answering questions with memory context and citations |
| 215 | + |
| 216 | +This makes Lerim useful not only as storage, but as an ongoing background process for project memory. |
| 217 | + |
| 218 | +## Who Lerim is for |
131 | 219 |
|
132 | | -## Web UI |
| 220 | +Lerim is for developers who: |
133 | 221 |
|
134 | | -Web UI is not bundled in this repo yet. |
135 | | -Use `lerim dashboard` for current status and CLI alternatives. |
| 222 | +- use coding agents regularly |
| 223 | +- work across multiple sessions |
| 224 | +- switch between different coding tools |
| 225 | +- want local, reusable, project-level memory |
| 226 | +- want memory continuity without vendor lock-in |
| 227 | + |
| 228 | +## What Lerim is not |
| 229 | + |
| 230 | +Lerim is not just a vector store. |
| 231 | + |
| 232 | +Lerim is not only a memory SDK. |
| 233 | + |
| 234 | +Lerim is not tied to one coding assistant. |
| 235 | + |
| 236 | +It is a background memory agent for coding workflows. |
136 | 237 |
|
137 | 238 | ## Docs |
138 | 239 |
|
139 | | -- Full docs: [docs.lerim.dev](https://docs.lerim.dev/) |
140 | | -- CLI reference: [`src/lerim/skills/cli-reference.md`](src/lerim/skills/cli-reference.md) |
141 | | -- Package source map: [`src/lerim/README.md`](src/lerim/README.md) |
| 240 | +- Website: https://lerim.dev |
| 241 | +- Docs: https://docs.lerim.dev |
| 242 | +- PyPI: https://pypi.org/project/lerim/ |
142 | 243 |
|
143 | 244 | ## Development |
144 | 245 |
|
145 | | -```bash |
146 | | -uv venv && source .venv/bin/activate |
147 | | -uv pip install -e '.[test]' |
148 | | -tests/run_tests.sh unit |
149 | | -tests/run_tests.sh quality |
150 | | -``` |
| 246 | +`uv venv && source .venv/bin/activate` |
| 247 | +`uv pip install -e '.[test]'` |
| 248 | +`tests/run_tests.sh unit` |
| 249 | +`tests/run_tests.sh quality` |
151 | 250 |
|
152 | 251 | ## Contributing |
153 | 252 |
|
154 | 253 | Contributions are welcome. |
155 | 254 |
|
| 255 | +If you want to help, good starting points are: |
| 256 | + |
| 257 | +- session adapters and adding more agents |
| 258 | +- extraction quality |
| 259 | +- memory consolidation quality |
| 260 | +- docs and demo examples |
| 261 | + |
| 262 | + |
156 | 263 | - Read the [Contributing Guide](https://docs.lerim.dev/contributing/getting-started/) |
157 | 264 | - Browse [open issues](https://github.com/lerim-dev/lerim-cli/issues) |
158 | 265 | - Agent adapter PRs are especially appreciated -- see `src/lerim/adapters/` for examples |
0 commit comments