Skip to content
Pods and Prompts

LLM AI Agents

One memory, on your own laptop

Every AI tool keeps its own memory of me. deep-memory keeps one memory on my laptop, built from what happens on my screen, and gives it to whichever AI tool I am working in.

5 min read

The problem

I tell ChatGPT that I use uv for Python. The next day I tell Claude the same thing. Then Cursor. Each AI tool keeps its own memory, none can read the others, and none saw the hour I spent in a terminal before I opened the chat.

My context exists. It is just split across companies, in stores I cannot read, edit or move.

The idea

deep-memory keeps one memory on my laptop and gives it to whichever AI tool I am working in.

It does not import from each provider. It records the one place everything passes through: my screen. A ChatGPT answer in a browser tab and a Claude Code session in a terminal are both just text in a focused window, so both end up in the same memory.

Architecture

Architecture: screen text is captured, distilled into Markdown memories on the laptop, and served to the AI harness

  • Capture daemon (Rust). Reads the text of the focused window and stores it in a SQLite file. Secrets are redacted before anything touches disk.
  • Memory service (Python). A local model, run through Ollama, turns the raw text into Markdown memories.
  • AI harness. Claude Code gets a short digest when a session starts and can search the rest through MCP tools. Any MCP client can do the same.

Everything lives in ~/.deepmem/. Nothing leaves the machine.

The flow

Flow: capture, distill into an episode, consolidate daily into facts, then serve to Claude Code

How the memory is distilled

Raw screen text is huge and repetitive. It is reduced in steps, and only the last two use a model.

Distillation: raw frames become sessions, then windows per project, then an episode, then facts and preferences

Example. Say I spend 25 minutes picking a database for a notes app: two docs pages, a question to ChatGPT, a quick test in a terminal. That is a few hundred captures. Five idle minutes later it becomes one episode file (illustrative):

The user compared SQLite and Postgres for a notes app and set up SQLite.

## Decisions
- Use SQLite, because the app has a single user.

## Open items
- Backups are not set up yet.

Once a day, episodes are merged into facts.md and preferences.md. The model does not rewrite these files. It returns operations (add, replace, confirm, remove) and the code applies them, so a bad reply cannot wipe the file.

Example. Say facts.md holds "the default model is qwen3-vl:4b". A later episode shows I switched to qwen3-vl:8b. The model returns one replace, and the line becomes:

- The default model is qwen3-vl:8b. (sources: 2026-11-14T101005; confirmed: 2026-11-14)

One fact, with the episode it came from. Not two facts that disagree. If I end a line with (pinned), the model can never change it.

How it helps

Example 1: no more repeating myself. This is what Claude Code was handed at the start of a new session in this repository. It is real, and I wrote none of it:

[deep-memory] Recorded on this computer about work in the project "deep-memory".

Preferences:
- Commit messages follow the format 'feat: <description>' for new features.
Facts:
- The daemon supports pausing/resuming capture via the Ctrl+Option+Cmd+P shortcut.

The agent already knows my commit format and how the pause shortcut works.

Example 2: finding something I only saw. I ask "what was that page about global hotkeys?" The agent calls recall("global hotkey") and gets the matching memories, then the raw screen text with the app, window title and URL.

Example 3: work stays at work. An agent working in my website's repository sees only that project's memories. It cannot read deep-memory, or anything personal.

We own our data

The memory is a folder of Markdown files on my disk, so ownership is not a promise in a privacy policy.

  • A memory is wrong? I open the file and fix it.
  • I looked at something private? deepmem forget --last 1h removes the captures and the memories made from them.
  • I never want my bank recorded? I add bank.com to the blocklist. Password fields and private browsing windows are skipped by default.
  • I switch AI provider? The memory stays where it is. It was never theirs.

Two honest limits: secret detection is pattern based, and the files rely on FileVault for encryption.

Next: websites that ask, instead of track

This part is not built yet. It is where the design points.

Today a website personalises by collecting data about me and keeping it. If my memory is on my laptop, that can be reversed: the site asks my machine one narrow question, and I decide whether it gets an answer.

Future: a website asks the laptop one scoped question and receives only the answer after the user allows it

Example. A docs site asks "which languages does this person use?" I click allow, it receives "Rust, Python", and it shows me the right code samples. It gets one answer. It gets no history, no profile and nothing to store.

What is missing is a permission model per site and a consent prompt. Those are hard problems, but they are problems about a file on my disk, which is a better place to start than a profile I cannot see.

Try it

deep-memory is open source and runs on macOS. Install steps are in the README.

No comments yet

Leave a comment

Related posts