lil memory

Your AI memory as a folder of Markdown files. Works with any model. No account, no cloud, no company in the middle.

lil memory is a small local MCP server. Every AI client you connect (Claude Desktop, Claude Code, and others) reads and writes the same memories. The memories are plain files in a folder you own, so you can read and edit them in Obsidian or any text editor.

[ Quickstart | Usage | File format | Tools | CLI | Security | Source ]


Quickstart

You need uv. Then:

  1. Create the vault at ~/lil-memory:
    uvx lil-memory init
  2. Connect a client (claude-desktop or claude-code):
    uvx lil-memory install claude-desktop
  3. Restart the client and talk to it:

Open ~/lil-memory in Obsidian to see and edit your memories. Run lil-memory doctor if something does not work.

Usage

You do not call lil memory yourself; your AI client does. Just ask in plain words:

Edits you make in Obsidian show up in searches within about 2 seconds. To keep the vault somewhere else, pass --vault PATH or set $LIL_MEMORY_VAULT.

File format

One memory is one Markdown file. Its folder is its scope.

~/lil-memory/
├── global/prefers-british-spelling.md
├── projects/acme-site/deploys-to-cloudflare.md
└── .lil-memory/          # search index and trash; safe to delete the index
---
id: 01J9XK3M7Q2R8S5T6V7W8X9Y0Z
type: preference
status: active
tags:
  - writing
source: claude-desktop 1.0
created: 2026-10-05T09:12:00Z
updated: 2026-10-05T09:12:00Z
---
Prefers British spelling and short paragraphs in client-facing copy.

The full format is in SPEC.md. Other tools can implement it without reading the code.

Tools

What the connected AI can use:

NameWhat it does
rememberSave one memory. Also returns up to 3 similar existing memories.
recallFull-text search over active memories, filtered by scope, type or tags.
getFetch one memory by id, title or path.
updateReplace a memory with new content; the old one is kept as superseded.
forgetMove a memory to the trash.
list_scopesList folders with their number of memories.
memory://profileResource: all your global preferences, the "who is this user" card.
load_contextPrompt: your profile plus the latest memories in one scope.

CLI

lil-memory init [path]           create a vault (default ~/lil-memory)
lil-memory install <client>      add to claude-desktop or claude-code
lil-memory serve                 run the MCP server over stdio
lil-memory serve --http          run at a secret URL on 127.0.0.1 (--port, --rotate)
lil-memory reindex               rebuild the search index from the files
lil-memory doctor                check FTS5, the vault and client installs

Every command takes --vault PATH.

Security

lil-memory serve --http                         # prints http://127.0.0.1:8765/mcp/<secret>
cloudflared tunnel --url http://127.0.0.1:8765  # or any other tunnel

In ChatGPT, turn on developer mode in the settings, then add https://<tunnel-host>/mcp/<secret> as a custom connector with no authentication.

The trade-off: anyone who has that URL can read, change and forget all of your memories. A URL leaks more easily than a password, for example through screenshots, shell history or the tunnel provider. OpenAI also stores it in your connector settings and sees every memory ChatGPT reads. HTTP mode only runs while you keep serve --http open. lil-memory serve --http --rotate replaces the secret, and the old URL stops working immediately. It is good practice to rotate the URL once in a while, and right away if you think it has leaked.


lil memory is MIT licensed.