recall-agents 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. recall_agents-0.1.0/.gitignore +9 -0
  2. recall_agents-0.1.0/CHANGELOG.md +40 -0
  3. recall_agents-0.1.0/LICENSE +21 -0
  4. recall_agents-0.1.0/PKG-INFO +288 -0
  5. recall_agents-0.1.0/README.md +261 -0
  6. recall_agents-0.1.0/pyproject.toml +55 -0
  7. recall_agents-0.1.0/src/recall/__init__.py +3 -0
  8. recall_agents-0.1.0/src/recall/__main__.py +5 -0
  9. recall_agents-0.1.0/src/recall/chats/__init__.py +1 -0
  10. recall_agents-0.1.0/src/recall/chats/indexer.py +70 -0
  11. recall_agents-0.1.0/src/recall/chats/projects.py +113 -0
  12. recall_agents-0.1.0/src/recall/chats/redact.py +30 -0
  13. recall_agents-0.1.0/src/recall/chats/sources/__init__.py +80 -0
  14. recall_agents-0.1.0/src/recall/chats/sources/claude.py +59 -0
  15. recall_agents-0.1.0/src/recall/chats/sources/codex.py +83 -0
  16. recall_agents-0.1.0/src/recall/chats/sources/cursor.py +189 -0
  17. recall_agents-0.1.0/src/recall/chats/store.py +262 -0
  18. recall_agents-0.1.0/src/recall/chats/transcript.py +85 -0
  19. recall_agents-0.1.0/src/recall/cli.py +252 -0
  20. recall_agents-0.1.0/src/recall/config.py +47 -0
  21. recall_agents-0.1.0/src/recall/evals.py +153 -0
  22. recall_agents-0.1.0/src/recall/integrations/__init__.py +1 -0
  23. recall_agents-0.1.0/src/recall/integrations/agents.py +199 -0
  24. recall_agents-0.1.0/src/recall/integrations/scheduler.py +100 -0
  25. recall_agents-0.1.0/src/recall/integrations/skill/SKILL.md +31 -0
  26. recall_agents-0.1.0/src/recall/keys.py +84 -0
  27. recall_agents-0.1.0/src/recall/llm/__init__.py +87 -0
  28. recall_agents-0.1.0/src/recall/llm/agent_cli.py +193 -0
  29. recall_agents-0.1.0/src/recall/llm/anthropic_api.py +68 -0
  30. recall_agents-0.1.0/src/recall/llm/base.py +94 -0
  31. recall_agents-0.1.0/src/recall/llm/client.py +101 -0
  32. recall_agents-0.1.0/src/recall/llm/ollama.py +56 -0
  33. recall_agents-0.1.0/src/recall/llm/openai_compat.py +90 -0
  34. recall_agents-0.1.0/src/recall/memory/__init__.py +1 -0
  35. recall_agents-0.1.0/src/recall/memory/consolidate.py +248 -0
  36. recall_agents-0.1.0/src/recall/memory/context.py +142 -0
  37. recall_agents-0.1.0/src/recall/memory/digest.py +73 -0
  38. recall_agents-0.1.0/src/recall/memory/dream.py +206 -0
  39. recall_agents-0.1.0/src/recall/memory/extract.py +205 -0
  40. recall_agents-0.1.0/src/recall/memory/notes.py +275 -0
  41. recall_agents-0.1.0/src/recall/memory/prompts/__init__.py +19 -0
  42. recall_agents-0.1.0/src/recall/memory/prompts/consolidate.md +9 -0
  43. recall_agents-0.1.0/src/recall/memory/prompts/extract.md +24 -0
  44. recall_agents-0.1.0/src/recall/memory/routing.py +67 -0
  45. recall_agents-0.1.0/src/recall/onboarding.py +241 -0
  46. recall_agents-0.1.0/src/recall/paths.py +13 -0
  47. recall_agents-0.1.0/src/recall/server.py +97 -0
@@ -0,0 +1,9 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.db
4
+ *.db-*
5
+ dist/
6
+ build/
7
+ *.egg-info/
8
+ .DS_Store
9
+ .ruff_cache/
@@ -0,0 +1,40 @@
1
+ # Changelog
2
+
3
+ All notable changes to recall are listed here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
+
6
+ ## [Unreleased]
7
+
8
+ ## [0.1.0] - 2026-10-08
9
+
10
+ First public release.
11
+
12
+ ### Added
13
+
14
+ - A local SQLite search index of the chat history from Claude Code, Codex and Cursor,
15
+ including older Cursor chats.
16
+ - `recall search`, `recall show` and `recall recent` for chat history.
17
+ - Memory notes, kept up to date by a nightly `recall dream` run. Notes cover preferences,
18
+ facts, decisions, lessons and open threads, and each one links to the chats it came from.
19
+ Notes are plain markdown with YAML frontmatter, in a git repository at `~/.agents/memory`.
20
+ Each run is one commit.
21
+ - A choice of model for memory: a local model (Ollama, LM Studio or llama.cpp), your ChatGPT
22
+ plan through the Codex CLI, your Claude plan through Claude Code, an API key for OpenAI,
23
+ Anthropic or OpenRouter, or any OpenAI-compatible server.
24
+ - API keys stored in the OS keychain, never in `config.toml`.
25
+ - Secrets are redacted before chats are indexed.
26
+ - Model output is checked against a JSON schema and retried with backoff. Every model call is
27
+ logged. Runs are capped with `--max-minutes` and `--max-calls`.
28
+ - Open threads expire after 14 days, and weak single-source notes fade after six months.
29
+ - An MCP server (`recall serve`) with six read-only tools: `search_chats`, `read_chat`,
30
+ `recent_chats`, `memory_search`, `read_note` and `project_memory`.
31
+ - A `/recall` skill, and a Claude Code session-start hook that loads your working preferences
32
+ and the current project's memory.
33
+ - `recall install` and `recall uninstall` for the MCP server, skill and hook. Each agent
34
+ config file is backed up before it changes.
35
+ - A nightly memory schedule through launchd on macOS or systemd on Linux (`recall schedule`).
36
+ - `recall setup`, a guided first run, and `recall model` to change the model later.
37
+ - `recall eval search` and `recall eval memory` to measure search and extraction quality.
38
+
39
+ [Unreleased]: https://github.com/alirng/recall/compare/v0.1.0...HEAD
40
+ [0.1.0]: https://github.com/alirng/recall/releases/tag/v0.1.0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ali Rangwala
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,288 @@
1
+ Metadata-Version: 2.5
2
+ Name: recall-agents
3
+ Version: 0.1.0
4
+ Summary: One searchable memory of your Claude Code, Codex and Cursor chats, exposed to every agent over MCP.
5
+ Project-URL: Homepage, https://github.com/alirng/recall
6
+ Project-URL: Issues, https://github.com/alirng/recall/issues
7
+ Project-URL: Changelog, https://github.com/alirng/recall/blob/main/CHANGELOG.md
8
+ Author: Ali Rangwala
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: agents,chat-history,claude-code,cli,codex,cursor,llm,mcp,memory,model-context-protocol
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Topic :: Software Development
20
+ Requires-Python: >=3.11
21
+ Requires-Dist: jsonschema>=4.20
22
+ Requires-Dist: mcp<3,>=2.3
23
+ Requires-Dist: pyyaml>=6
24
+ Provides-Extra: anthropic
25
+ Requires-Dist: anthropic>=1; extra == 'anthropic'
26
+ Description-Content-Type: text/markdown
27
+
28
+ # recall
29
+
30
+ **One memory for all your coding agents.**
31
+
32
+ [![CI](https://github.com/alirng/recall/actions/workflows/ci.yml/badge.svg)](https://github.com/alirng/recall/actions/workflows/ci.yml)
33
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
34
+ ![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue.svg)
35
+ ![Status: alpha](https://img.shields.io/badge/status-alpha-orange.svg)
36
+
37
+ Your coding agents forget everything between sessions, and none of them knows what you told
38
+ the others. recall reads the chat history that Claude Code, Codex and Cursor already keep on
39
+ your machine, and gives every agent two things:
40
+
41
+ - **Search across every chat.** "Find the Cursor chat where we planned the auth refactor"
42
+ works in any agent, whichever tool the chat happened in.
43
+ - **Memory.** A small set of plain markdown notes, rewritten nightly: how you like to work,
44
+ what each project needs, what was decided, what went wrong, and what is still open. Each
45
+ note links to the chats it came from.
46
+
47
+ It runs on your machine. You choose the model that writes the memories: a local one that
48
+ keeps everything private, your ChatGPT or Claude subscription, or your own API key or server.
49
+
50
+ ```text
51
+ you › what did we decide about retries in the payments service?
52
+ agent › Searching your past chats… In "Payment webhook retries" (Codex, 2 Oct) you settled
53
+ on exponential backoff capped at 5 attempts, and a dead-letter queue for the rest.
54
+ Memory also notes: "Never retry card captures; they are not idempotent."
55
+ ```
56
+
57
+ ## Contents
58
+
59
+ [Install](#install) · [Quick start](#quick-start) · [Choosing a model](#choosing-a-model) ·
60
+ [How agents use it](#how-agents-use-it) · [How it works](#how-it-works) ·
61
+ [Memory notes](#memory-notes) · [Commands](#commands) · [FAQ](#faq) ·
62
+ [Contributing](#contributing)
63
+
64
+ ## Install
65
+
66
+ Requirements: macOS or Linux, Python 3.11+, and at least one of Claude Code, Codex or Cursor.
67
+
68
+ ```bash
69
+ uv tool install git+https://github.com/alirng/recall
70
+ # or: pipx install git+https://github.com/alirng/recall
71
+ ```
72
+
73
+ A PyPI release (`recall-agents`) is coming; the command is `recall` either way.
74
+
75
+ ## Quick start
76
+
77
+ ```bash
78
+ recall setup
79
+ ```
80
+
81
+ Setup asks a few questions and does the rest:
82
+
83
+ ```text
84
+ 1. Agents finds Claude Code, Codex and Cursor; import from all of them or some
85
+ 2. Model picks who writes your memories, then tests it with a live call
86
+ 3. Index reads your chat history into a local search index
87
+ 4. Connect adds the MCP tools, the /recall skill and a Claude Code session hook
88
+ 5. Schedule updates memory nightly (launchd on macOS, systemd on Linux)
89
+ 6. First run starts in the background, newest chats first
90
+ ```
91
+
92
+ Then ask any agent about an earlier conversation, or just start working: Claude Code opens
93
+ each session with your preferences and the current project's notes already loaded.
94
+
95
+ ## Choosing a model
96
+
97
+ recall distils chats with a language model. Pick the one that fits your privacy and budget:
98
+
99
+ | Option | What it uses | Where chat excerpts go |
100
+ | --- | --- | --- |
101
+ | **Local model** | Ollama, LM Studio or llama.cpp on this machine | nowhere: they stay on this machine |
102
+ | **ChatGPT** | your ChatGPT plan, through the Codex CLI | OpenAI, under your plan's data terms |
103
+ | **Claude** | your Claude plan, through Claude Code | Anthropic, under your plan's data terms |
104
+ | **API key** | OpenAI, Anthropic or OpenRouter | that provider, billed to your key |
105
+ | **Your server** | any OpenAI-compatible endpoint, such as vLLM or Ollama on another box | your server |
106
+
107
+ Change it any time with `recall model`. The choice is saved in `~/.agents/recall/config.toml`:
108
+
109
+ ```toml
110
+ [model]
111
+ provider = "local" # local | chatgpt | claude | openai | anthropic | openrouter | custom
112
+ name = "qwen3:4b"
113
+ server = "ollama" # local only
114
+ base_url = "http://localhost:11434" # local and custom
115
+ api_key = "keychain" # env:NAME, keychain or file; never the key itself
116
+ ```
117
+
118
+ Whichever you pick, every call is validated against a strict JSON schema, retried with
119
+ backoff, cached, logged, and capped by time and call budgets. recall's own calls never show
120
+ up in your chat history, and the subscription CLIs run with your MCP servers, hooks and
121
+ plugins switched off.
122
+
123
+ For a local model, smaller is kinder to your laptop: a 4B model suits 16 GB of memory.
124
+
125
+ ## How agents use it
126
+
127
+ | Agent | History import | MCP tools | `/recall` skill | Memory at session start |
128
+ | --- | --- | --- | --- | --- |
129
+ | Claude Code | yes | yes | yes | automatic, via a session-start hook |
130
+ | Codex | yes | yes | yes | on request, via the `project_memory` tool |
131
+ | Cursor | yes, including older chats | yes | yes | on request, via the `project_memory` tool |
132
+
133
+ - **Automatic:** the session-start hook loads your working preferences and the current
134
+ project's notes, capped at 6,000 characters.
135
+ - **On demand:** six read-only MCP tools: `search_chats`, `read_chat`, `recent_chats`,
136
+ `memory_search`, `read_note` and `project_memory`.
137
+ - **Explicit:** type `/recall what did we decide about auth` in any agent with skills.
138
+
139
+ Agents treat notes and transcripts as background, not instructions: the current request and
140
+ the code win when they disagree.
141
+
142
+ ## How it works
143
+
144
+ ```text
145
+ Claude Code ─┐ ┌─ dream (nightly) ──────────────────────────┐
146
+ Codex ───────┼─ parse & clean ─ redact ─ SQLite ──┤ digest → extract → consolidate → notes │
147
+ Cursor ──────┘ (FTS5) │ (batched) (per project) (git) │
148
+ └────────────────────────────────────────────┘
149
+ ↓ search_chats, read_chat ↓ MEMORY.md indexes
150
+ MCP server · /recall skill · CLI session-start hook · memory_search
151
+ ```
152
+
153
+ 1. **Index.** Each agent's history is parsed into your turns and the agent's turns. Tool
154
+ output and text the tools inject (system reminders, plan-mode boilerplate) are dropped,
155
+ and secrets are redacted before anything is stored. Headless runs and subagents stay
156
+ searchable but are never mined for memory. Clones and worktrees of one repo share a
157
+ project, keyed on the git remote.
158
+ 2. **Digest.** Each chat shrinks to your words plus the start and end of each agent reply,
159
+ which is where agents say what they will do and what they did.
160
+ 3. **Extract.** The model proposes candidate memories (`preference`, `fact`, `decision`,
161
+ `lesson`, `open`), each with a supporting quote. A quote that can't be found in the chat
162
+ demotes the candidate to low confidence.
163
+ 4. **Consolidate.** Per project, oldest first, candidates are folded into notes: create,
164
+ update, supersede (newer facts win) or discard. Every operation is validated before a
165
+ file changes. Open threads expire after 14 days.
166
+ 5. **Commit.** The `MEMORY.md` indexes are rebuilt, and the run becomes one git commit in
167
+ `~/.agents/memory`.
168
+
169
+ Each step resumes where the last run stopped, so a crash or a spent budget only delays the
170
+ rest until the next night.
171
+
172
+ ## Memory notes
173
+
174
+ ```text
175
+ ~/.agents/memory/
176
+ MEMORY.md how you work, and your projects
177
+ global/<note>.md cross-project preferences
178
+ projects/<repo>/MEMORY.md what an agent loads when it starts in that repo
179
+ projects/<repo>/<note>.md facts, decisions, lessons, open threads
180
+ archive/ superseded and expired notes
181
+ ```
182
+
183
+ A note is plain markdown with a little YAML:
184
+
185
+ ```markdown
186
+ ---
187
+ id: run-migrations-through-make-3f2a
188
+ type: lesson
189
+ scope: project
190
+ confidence: high
191
+ last_seen: '2026-09-30'
192
+ sources: [codex:0192f…, claude:7c41e…]
193
+ ---
194
+ Run database migrations with `make migrate`, never by hand: the Makefile also seeds
195
+ the audit tables. Why: two hand-run migrations left staging without audit rows.
196
+ ```
197
+
198
+ The files are the source of truth. Edit them, and recall keeps your edits; delete one, and
199
+ it is never learned again. The folder is a git repository, so `git log` shows what each
200
+ night changed and `git revert` undoes it. It also opens as an Obsidian vault, though nothing
201
+ requires Obsidian. Why markdown rather than a vector or graph store:
202
+ [docs/research/agent-memory-prior-art.md](docs/research/agent-memory-prior-art.md).
203
+
204
+ ## Commands
205
+
206
+ | Command | Does |
207
+ | --- | --- |
208
+ | `recall setup` | the guided first run |
209
+ | `recall model [--show]` | choose, or show, the model that writes memories |
210
+ | `recall search <words>` · `show <id>` · `recent` | chat history |
211
+ | `recall dream [--max-minutes N] [--max-calls N]` | update memory now |
212
+ | `recall memory [search <words> \| show <id>]` | browse notes |
213
+ | `recall context [--cwd DIR]` | print the memory block an agent gets at session start |
214
+ | `recall install` · `uninstall [--only mcp,skill,hook]` | connect to agents (every config file is backed up first) |
215
+ | `recall schedule enable \| disable \| status` | the nightly run |
216
+ | `recall eval search \| memory` | quality checks |
217
+
218
+ Environment: `RECALL_HOME` moves the index, config and logs (default `~/.agents/recall`);
219
+ `RECALL_MEMORY` moves the notes (default `~/.agents/memory`).
220
+
221
+ ### Uninstall
222
+
223
+ ```bash
224
+ recall uninstall && recall schedule disable
225
+ uv tool uninstall recall-agents
226
+ rm -rf ~/.agents/recall # the index, config and logs
227
+ # ~/.agents/memory holds your notes; keep it or delete it
228
+ ```
229
+
230
+ ## FAQ
231
+
232
+ **Does recall send my chats anywhere?**
233
+ Only to the model you choose, and only digests of chats, after secrets are redacted. With a
234
+ local model nothing leaves your machine. recall has no telemetry. See [SECURITY.md](SECURITY.md).
235
+
236
+ **What does it cost?**
237
+ With a local model, nothing but electricity. With a subscription it uses your plan's
238
+ allowance; the nightly run is capped (80 model calls by default), and a first backfill of a
239
+ few thousand chats spreads across several nights. With an API key, a small model such as
240
+ Claude Haiku costs cents per night for typical use.
241
+
242
+ **How is this different from Claude Code's or Codex's own memory?**
243
+ Each tool's memory only knows that tool's chats and lives in its own format. recall spans
244
+ all of them, keeps memory as plain files you own, and links every note to its source chats.
245
+
246
+ **Can I use it with only one agent?**
247
+ Yes. Search and memory work with any one of Claude Code, Codex or Cursor.
248
+
249
+ **Windows?**
250
+ Not yet. The chat parsers are portable, but file locking, the nightly scheduler and key
251
+ storage need Windows equivalents. Contributions welcome.
252
+
253
+ **Will memory pick up something wrong?**
254
+ Sometimes. Every note carries its sources and a confidence level, newer chats supersede
255
+ older notes, and you can edit or delete any note. Treat memory as a well-informed colleague's
256
+ notes, not as ground truth.
257
+
258
+ ## Quality
259
+
260
+ There are no unit tests by design. recall is checked with evals that drive the real
261
+ pipeline, plus an end-to-end smoke test in CI:
262
+
263
+ ```bash
264
+ recall eval search # hand-written and auto-generated "find that chat" queries
265
+ recall eval memory --fresh # extraction against hand-labelled chats; average several runs
266
+ ```
267
+
268
+ On one developer's 2,700 chats, search finds the intended chat first 80–100% of the time and
269
+ in the top five 97–100% of the time. Memory extraction quality depends on the model. Small
270
+ hosted models find roughly half to three quarters of hand-labelled memories, with very little
271
+ junk. Single runs vary by ±12 points, so compare averages.
272
+
273
+ ## Contributing
274
+
275
+ Contributions are welcome, especially new agent sources (opencode, Gemini CLI, Copilot CLI,
276
+ Goose and more are mapped out in
277
+ [docs/research/agent-storage-and-integration.md](docs/research/agent-storage-and-integration.md))
278
+ and new model providers. See [CONTRIBUTING.md](CONTRIBUTING.md) to get set up, and
279
+ [SECURITY.md](SECURITY.md) to report a vulnerability privately. Please never include real
280
+ chat content in issues or pull requests.
281
+
282
+ **Roadmap:** more agents and chat-export imports, a Codex session-start hook, a "remember
283
+ this" write path from any agent, usefulness evals that replay tasks with and without memory,
284
+ and a Claude Code plugin package.
285
+
286
+ ## License
287
+
288
+ [MIT](LICENSE)
@@ -0,0 +1,261 @@
1
+ # recall
2
+
3
+ **One memory for all your coding agents.**
4
+
5
+ [![CI](https://github.com/alirng/recall/actions/workflows/ci.yml/badge.svg)](https://github.com/alirng/recall/actions/workflows/ci.yml)
6
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7
+ ![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue.svg)
8
+ ![Status: alpha](https://img.shields.io/badge/status-alpha-orange.svg)
9
+
10
+ Your coding agents forget everything between sessions, and none of them knows what you told
11
+ the others. recall reads the chat history that Claude Code, Codex and Cursor already keep on
12
+ your machine, and gives every agent two things:
13
+
14
+ - **Search across every chat.** "Find the Cursor chat where we planned the auth refactor"
15
+ works in any agent, whichever tool the chat happened in.
16
+ - **Memory.** A small set of plain markdown notes, rewritten nightly: how you like to work,
17
+ what each project needs, what was decided, what went wrong, and what is still open. Each
18
+ note links to the chats it came from.
19
+
20
+ It runs on your machine. You choose the model that writes the memories: a local one that
21
+ keeps everything private, your ChatGPT or Claude subscription, or your own API key or server.
22
+
23
+ ```text
24
+ you › what did we decide about retries in the payments service?
25
+ agent › Searching your past chats… In "Payment webhook retries" (Codex, 2 Oct) you settled
26
+ on exponential backoff capped at 5 attempts, and a dead-letter queue for the rest.
27
+ Memory also notes: "Never retry card captures; they are not idempotent."
28
+ ```
29
+
30
+ ## Contents
31
+
32
+ [Install](#install) · [Quick start](#quick-start) · [Choosing a model](#choosing-a-model) ·
33
+ [How agents use it](#how-agents-use-it) · [How it works](#how-it-works) ·
34
+ [Memory notes](#memory-notes) · [Commands](#commands) · [FAQ](#faq) ·
35
+ [Contributing](#contributing)
36
+
37
+ ## Install
38
+
39
+ Requirements: macOS or Linux, Python 3.11+, and at least one of Claude Code, Codex or Cursor.
40
+
41
+ ```bash
42
+ uv tool install git+https://github.com/alirng/recall
43
+ # or: pipx install git+https://github.com/alirng/recall
44
+ ```
45
+
46
+ A PyPI release (`recall-agents`) is coming; the command is `recall` either way.
47
+
48
+ ## Quick start
49
+
50
+ ```bash
51
+ recall setup
52
+ ```
53
+
54
+ Setup asks a few questions and does the rest:
55
+
56
+ ```text
57
+ 1. Agents finds Claude Code, Codex and Cursor; import from all of them or some
58
+ 2. Model picks who writes your memories, then tests it with a live call
59
+ 3. Index reads your chat history into a local search index
60
+ 4. Connect adds the MCP tools, the /recall skill and a Claude Code session hook
61
+ 5. Schedule updates memory nightly (launchd on macOS, systemd on Linux)
62
+ 6. First run starts in the background, newest chats first
63
+ ```
64
+
65
+ Then ask any agent about an earlier conversation, or just start working: Claude Code opens
66
+ each session with your preferences and the current project's notes already loaded.
67
+
68
+ ## Choosing a model
69
+
70
+ recall distils chats with a language model. Pick the one that fits your privacy and budget:
71
+
72
+ | Option | What it uses | Where chat excerpts go |
73
+ | --- | --- | --- |
74
+ | **Local model** | Ollama, LM Studio or llama.cpp on this machine | nowhere: they stay on this machine |
75
+ | **ChatGPT** | your ChatGPT plan, through the Codex CLI | OpenAI, under your plan's data terms |
76
+ | **Claude** | your Claude plan, through Claude Code | Anthropic, under your plan's data terms |
77
+ | **API key** | OpenAI, Anthropic or OpenRouter | that provider, billed to your key |
78
+ | **Your server** | any OpenAI-compatible endpoint, such as vLLM or Ollama on another box | your server |
79
+
80
+ Change it any time with `recall model`. The choice is saved in `~/.agents/recall/config.toml`:
81
+
82
+ ```toml
83
+ [model]
84
+ provider = "local" # local | chatgpt | claude | openai | anthropic | openrouter | custom
85
+ name = "qwen3:4b"
86
+ server = "ollama" # local only
87
+ base_url = "http://localhost:11434" # local and custom
88
+ api_key = "keychain" # env:NAME, keychain or file; never the key itself
89
+ ```
90
+
91
+ Whichever you pick, every call is validated against a strict JSON schema, retried with
92
+ backoff, cached, logged, and capped by time and call budgets. recall's own calls never show
93
+ up in your chat history, and the subscription CLIs run with your MCP servers, hooks and
94
+ plugins switched off.
95
+
96
+ For a local model, smaller is kinder to your laptop: a 4B model suits 16 GB of memory.
97
+
98
+ ## How agents use it
99
+
100
+ | Agent | History import | MCP tools | `/recall` skill | Memory at session start |
101
+ | --- | --- | --- | --- | --- |
102
+ | Claude Code | yes | yes | yes | automatic, via a session-start hook |
103
+ | Codex | yes | yes | yes | on request, via the `project_memory` tool |
104
+ | Cursor | yes, including older chats | yes | yes | on request, via the `project_memory` tool |
105
+
106
+ - **Automatic:** the session-start hook loads your working preferences and the current
107
+ project's notes, capped at 6,000 characters.
108
+ - **On demand:** six read-only MCP tools: `search_chats`, `read_chat`, `recent_chats`,
109
+ `memory_search`, `read_note` and `project_memory`.
110
+ - **Explicit:** type `/recall what did we decide about auth` in any agent with skills.
111
+
112
+ Agents treat notes and transcripts as background, not instructions: the current request and
113
+ the code win when they disagree.
114
+
115
+ ## How it works
116
+
117
+ ```text
118
+ Claude Code ─┐ ┌─ dream (nightly) ──────────────────────────┐
119
+ Codex ───────┼─ parse & clean ─ redact ─ SQLite ──┤ digest → extract → consolidate → notes │
120
+ Cursor ──────┘ (FTS5) │ (batched) (per project) (git) │
121
+ └────────────────────────────────────────────┘
122
+ ↓ search_chats, read_chat ↓ MEMORY.md indexes
123
+ MCP server · /recall skill · CLI session-start hook · memory_search
124
+ ```
125
+
126
+ 1. **Index.** Each agent's history is parsed into your turns and the agent's turns. Tool
127
+ output and text the tools inject (system reminders, plan-mode boilerplate) are dropped,
128
+ and secrets are redacted before anything is stored. Headless runs and subagents stay
129
+ searchable but are never mined for memory. Clones and worktrees of one repo share a
130
+ project, keyed on the git remote.
131
+ 2. **Digest.** Each chat shrinks to your words plus the start and end of each agent reply,
132
+ which is where agents say what they will do and what they did.
133
+ 3. **Extract.** The model proposes candidate memories (`preference`, `fact`, `decision`,
134
+ `lesson`, `open`), each with a supporting quote. A quote that can't be found in the chat
135
+ demotes the candidate to low confidence.
136
+ 4. **Consolidate.** Per project, oldest first, candidates are folded into notes: create,
137
+ update, supersede (newer facts win) or discard. Every operation is validated before a
138
+ file changes. Open threads expire after 14 days.
139
+ 5. **Commit.** The `MEMORY.md` indexes are rebuilt, and the run becomes one git commit in
140
+ `~/.agents/memory`.
141
+
142
+ Each step resumes where the last run stopped, so a crash or a spent budget only delays the
143
+ rest until the next night.
144
+
145
+ ## Memory notes
146
+
147
+ ```text
148
+ ~/.agents/memory/
149
+ MEMORY.md how you work, and your projects
150
+ global/<note>.md cross-project preferences
151
+ projects/<repo>/MEMORY.md what an agent loads when it starts in that repo
152
+ projects/<repo>/<note>.md facts, decisions, lessons, open threads
153
+ archive/ superseded and expired notes
154
+ ```
155
+
156
+ A note is plain markdown with a little YAML:
157
+
158
+ ```markdown
159
+ ---
160
+ id: run-migrations-through-make-3f2a
161
+ type: lesson
162
+ scope: project
163
+ confidence: high
164
+ last_seen: '2026-09-30'
165
+ sources: [codex:0192f…, claude:7c41e…]
166
+ ---
167
+ Run database migrations with `make migrate`, never by hand: the Makefile also seeds
168
+ the audit tables. Why: two hand-run migrations left staging without audit rows.
169
+ ```
170
+
171
+ The files are the source of truth. Edit them, and recall keeps your edits; delete one, and
172
+ it is never learned again. The folder is a git repository, so `git log` shows what each
173
+ night changed and `git revert` undoes it. It also opens as an Obsidian vault, though nothing
174
+ requires Obsidian. Why markdown rather than a vector or graph store:
175
+ [docs/research/agent-memory-prior-art.md](docs/research/agent-memory-prior-art.md).
176
+
177
+ ## Commands
178
+
179
+ | Command | Does |
180
+ | --- | --- |
181
+ | `recall setup` | the guided first run |
182
+ | `recall model [--show]` | choose, or show, the model that writes memories |
183
+ | `recall search <words>` · `show <id>` · `recent` | chat history |
184
+ | `recall dream [--max-minutes N] [--max-calls N]` | update memory now |
185
+ | `recall memory [search <words> \| show <id>]` | browse notes |
186
+ | `recall context [--cwd DIR]` | print the memory block an agent gets at session start |
187
+ | `recall install` · `uninstall [--only mcp,skill,hook]` | connect to agents (every config file is backed up first) |
188
+ | `recall schedule enable \| disable \| status` | the nightly run |
189
+ | `recall eval search \| memory` | quality checks |
190
+
191
+ Environment: `RECALL_HOME` moves the index, config and logs (default `~/.agents/recall`);
192
+ `RECALL_MEMORY` moves the notes (default `~/.agents/memory`).
193
+
194
+ ### Uninstall
195
+
196
+ ```bash
197
+ recall uninstall && recall schedule disable
198
+ uv tool uninstall recall-agents
199
+ rm -rf ~/.agents/recall # the index, config and logs
200
+ # ~/.agents/memory holds your notes; keep it or delete it
201
+ ```
202
+
203
+ ## FAQ
204
+
205
+ **Does recall send my chats anywhere?**
206
+ Only to the model you choose, and only digests of chats, after secrets are redacted. With a
207
+ local model nothing leaves your machine. recall has no telemetry. See [SECURITY.md](SECURITY.md).
208
+
209
+ **What does it cost?**
210
+ With a local model, nothing but electricity. With a subscription it uses your plan's
211
+ allowance; the nightly run is capped (80 model calls by default), and a first backfill of a
212
+ few thousand chats spreads across several nights. With an API key, a small model such as
213
+ Claude Haiku costs cents per night for typical use.
214
+
215
+ **How is this different from Claude Code's or Codex's own memory?**
216
+ Each tool's memory only knows that tool's chats and lives in its own format. recall spans
217
+ all of them, keeps memory as plain files you own, and links every note to its source chats.
218
+
219
+ **Can I use it with only one agent?**
220
+ Yes. Search and memory work with any one of Claude Code, Codex or Cursor.
221
+
222
+ **Windows?**
223
+ Not yet. The chat parsers are portable, but file locking, the nightly scheduler and key
224
+ storage need Windows equivalents. Contributions welcome.
225
+
226
+ **Will memory pick up something wrong?**
227
+ Sometimes. Every note carries its sources and a confidence level, newer chats supersede
228
+ older notes, and you can edit or delete any note. Treat memory as a well-informed colleague's
229
+ notes, not as ground truth.
230
+
231
+ ## Quality
232
+
233
+ There are no unit tests by design. recall is checked with evals that drive the real
234
+ pipeline, plus an end-to-end smoke test in CI:
235
+
236
+ ```bash
237
+ recall eval search # hand-written and auto-generated "find that chat" queries
238
+ recall eval memory --fresh # extraction against hand-labelled chats; average several runs
239
+ ```
240
+
241
+ On one developer's 2,700 chats, search finds the intended chat first 80–100% of the time and
242
+ in the top five 97–100% of the time. Memory extraction quality depends on the model. Small
243
+ hosted models find roughly half to three quarters of hand-labelled memories, with very little
244
+ junk. Single runs vary by ±12 points, so compare averages.
245
+
246
+ ## Contributing
247
+
248
+ Contributions are welcome, especially new agent sources (opencode, Gemini CLI, Copilot CLI,
249
+ Goose and more are mapped out in
250
+ [docs/research/agent-storage-and-integration.md](docs/research/agent-storage-and-integration.md))
251
+ and new model providers. See [CONTRIBUTING.md](CONTRIBUTING.md) to get set up, and
252
+ [SECURITY.md](SECURITY.md) to report a vulnerability privately. Please never include real
253
+ chat content in issues or pull requests.
254
+
255
+ **Roadmap:** more agents and chat-export imports, a Codex session-start hook, a "remember
256
+ this" write path from any agent, usefulness evals that replay tasks with and without memory,
257
+ and a Claude Code plugin package.
258
+
259
+ ## License
260
+
261
+ [MIT](LICENSE)
@@ -0,0 +1,55 @@
1
+ [project]
2
+ name = "recall-agents"
3
+ version = "0.1.0"
4
+ description = "One searchable memory of your Claude Code, Codex and Cursor chats, exposed to every agent over MCP."
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ license = "MIT"
8
+ license-files = ["LICENSE"]
9
+ authors = [{ name = "Ali Rangwala" }]
10
+ keywords = ["mcp", "model-context-protocol", "claude-code", "codex", "cursor", "llm", "agents", "memory", "chat-history", "cli"]
11
+ classifiers = [
12
+ "Development Status :: 3 - Alpha",
13
+ "Environment :: Console",
14
+ "Intended Audience :: Developers",
15
+ "Operating System :: MacOS",
16
+ "Operating System :: POSIX :: Linux",
17
+ "Programming Language :: Python :: 3 :: Only",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Topic :: Software Development",
20
+ ]
21
+ dependencies = ["mcp>=2.3,<3", "pyyaml>=6", "jsonschema>=4.20"]
22
+
23
+ [project.urls]
24
+ Homepage = "https://github.com/alirng/recall"
25
+ Issues = "https://github.com/alirng/recall/issues"
26
+ Changelog = "https://github.com/alirng/recall/blob/main/CHANGELOG.md"
27
+
28
+ [project.optional-dependencies]
29
+ anthropic = ["anthropic>=1"]
30
+
31
+ [project.scripts]
32
+ recall = "recall.cli:main"
33
+
34
+ [build-system]
35
+ requires = ["hatchling>=1.27"] # PEP 639 license metadata
36
+ build-backend = "hatchling.build"
37
+
38
+ [tool.hatch.build.targets.wheel]
39
+ packages = ["src/recall"]
40
+
41
+ [tool.hatch.build.targets.sdist]
42
+ # The published source holds the package and its license; research notes and agent
43
+ # instructions stay in the repository.
44
+ include = ["src/recall", "README.md", "LICENSE", "CHANGELOG.md", "pyproject.toml"]
45
+
46
+ [tool.ruff]
47
+ line-length = 120
48
+ target-version = "py311"
49
+
50
+ [tool.ruff.lint]
51
+ select = ["E", "F", "W", "I", "B", "UP", "SIM", "RUF"]
52
+ ignore = [
53
+ "RUF001", "RUF002", "RUF003", # typographic characters in prose are intentional
54
+ "SIM905", # word lists read better as one split() string
55
+ ]