Kumbara

Keeping a Personal Memory for AI Agents Current

In my last post I described a personal memory layer: local models read my exported conversations, pull out what's worth remembering, store it in an Obsidian vault on my Mac, and serve only what I've approved to my agents over MCP. I ended with a next step: keep those memories up to date without me doing the work.

This post is about that step. The same problem shows up in companies trying to give agents shared knowledge: what to capture, what has already been seen, and who decides what an agent can read.

The problem with "just re-export"

Version one ran on manual exports. Every week or two I'd download my ChatGPT and Claude data, run sync.py, and wait. Two things made that inefficient:

So "incremental" had to mean two things: on the ingest side, knowing which conversations are new, which grew and which are unchanged; and on the extraction side, reading only the messages the model hasn't seen yet.

Here's what the pipeline looks like now. Teal parts are new in this round; a dashed teal border marks existing parts that changed.

Memory pipeline with incremental captureExports, local sessions and assistant saves flow through ingest (with an import ledger) and save filing into the vault; conversations get incremental extraction; everything passes policy and review, then the publish watcher feeds agents. New parts are teal; existing parts that changed have a dashed teal border.Provider exportsChatGPT, ClaudeLocal sessionsClaude Code, Codex · 15 minAssistant savessave_memory, 5 appsIngestnow with an import ledger: source:id + content hashSave filinginbox.py, always privateConversations02-ConversationsExtractionnow only new messagesMemory inbox03-Memories/_inboxStatus reportnow: export age, backlogPolicy + my reviewsaves never auto-approvedPublish watcherapproved onlyAgents readMCP, read tokensNew in this roundExisted, changed in this roundAlready existed
Capture path How it arrives Effort from me
Official exports (ChatGPT, Claude) sync.py picks up the zip from Downloads Click "export" every week or two
Claude Code and Codex sessions A launchd job snapshots idle sessions every 15 minutes None
save_memory Any connected assistant saves one fact mid-chat Say "save this to my vault"
Browser-session pull Built, then shelved —

A word on that last row: I had Claude build a Chrome extension that pulled new chats through my own logged-in session, and it worked. But Anthropic's and OpenAI's consumer terms both prohibit automated extraction, so I dropped it. Should ChatGPT and Claude let you download your own chats through an API? That's a question for another day.

Part 1: Ingest that knows what it has seen

Ingest turns each conversation into one Markdown note. To make it incremental, it needed a reliable answer to one question per conversation: have I seen this exact thing before? Three things got in the way:

  1. Exports bring back everything. Old conversations arrive again with every export, so ingest has to recognise them and do nothing.
  2. The same ID can come from two sources. ChatGPT, Claude, Claude Code and Codex each have their own IDs. The old code keyed conversations by bare ID and stopped the whole import if two collided.
  3. The same conversation can arrive in a different shape. The old check hashed the raw JSON. Any extra field, from a new capture path or a format change, made an unchanged chat look changed.

The fix is an import ledger (the code calls it the manifest): a file with one entry per conversation, recording what ingest has already seen. Two changes matter.

Before: keyed by the bare conversation ID
"023f8dd6-29f9-…": {
"body_hash": "c5cf7c94…",
"render": 2,
"source_hash": "f4ea99e8…"
}
After: keyed by source:id, with a content hash
"claude:023f8dd6-29f9-…": {
"body_hash": "c5cf7c94…", same
"render": 2, same
"source_hash": "f4ea99e8…", same
"content_hash": "123b5341…",
"source": "claude",
"message_count": 2,
"updated_at": "2026-09-04T22:23Z",
"via": "export",
"first_seen": "2026-11-22T17:32Z",
"last_seen": {"export": "2026-11-22T17:32Z"}
}
Key changedNew field

A real entry from my import ledger, before and after the migration. body_hash is what protects notes I edited in Obsidian; it didn't change.

With that in place, every incoming conversation goes through the same short set of questions:

What ingest does with an incoming conversationLook up by source and ID; respect deleted notes; compare content hash; skip older versions; protect edited notes; otherwise re-render.Incoming conversationSeen before?looked up by source:idnoCreate noteyesNote still in the vault?found by frontmatter, not filenamenoStays deletedyesContent changed?content_hash, not raw JSONnoUnchangedyesOlder than what I have?compares updated_atyesSkippednoDid I edit the note?body_hash checkyesConflict copynoRe-render noteNew in this roundSame as before

The two rules I care most about aren't new, but they matter more now that imports happen often. A note I deleted stays deleted: every export contains my entire history, so if ingest recreated missing notes, anything I removed would come back every week. And a note I edited is never overwritten: a new version goes to a conflict folder instead.

Part 2: Extraction that picks up where it left off

The second half is the extraction watermark: one number saved per conversation, recording how many messages the model has already read.

On the next run, extraction hashes the first watermark messages of the current version and compares that with what it stored last time:

The model also gets the two messages just before the watermark, as context. Without them it would see "Add streak reminders before you ship" with no idea what app we're talking about. Anything it tries to cite from those context messages is dropped, so they can't create duplicate memories.

Run 1 · Monday · first time seenno watermark yet → read everything
0MeI'm building a habit tracker app for iPhone.extracted
1AISwiftUI with local notifications would fit well…extracted
2MeYes, let's go with SwiftUI.extracted
watermark = 3
saved: watermark 3 · hash of messages 0–2 = 9c41… · memories: "building a habit tracker", "chose SwiftUI"
Run 2 · Thursday · chat grew to 5 messages→ incremental from 3
1AISwiftUI with local notifications would fit well…context only
2MeYes, let's go with SwiftUI.context only
old watermark = 3
3MeI'll ship to TestFlight by end of month.extracted
4AIAdd streak reminders before you ship…extracted
new watermark = 5
check: hash of messages 0–2 today = 9c41… = stored → the chat only grew
model sees 1–4 · may cite only 3–4 · new memory: "TestFlight by end of month"
Run 3 · Saturday · I edited message 2 in the app→ read everything
0MeI'm building a habit tracker app for iPhone.extracted
1AISwiftUI with local notifications would fit well…extracted
2MeActually, let's use React Native instead.extracted
3MeI'll ship to TestFlight by end of month.extracted
4AIAdd streak reminders before you ship…extracted
watermark = 5
check: hash of messages 0–4 today = 51e0… ≠ stored → history changed, re-read it all
memories that didn't change keep their IDs and aren't written twice · new: "switched to React Native"
Sent, can become a memorySent as context, can't be citedNot sent

A conversation that grows by a few messages a day now costs one short model call instead of a full re-read. That's what made capturing Claude Code and Codex sessions practical: they grow constantly. The first full extraction of 107 sessions took a few hours; after policy and my review, the memories my agents can see went from 328 to 654. Every run since only reads what's new.

Part 3: Saving a memory mid-conversation

Extraction works after the fact. Sometimes I want to say "remember this" in the moment, in whatever app I'm using. That's save_memory, a write tool on the same MCP gateway that serves my memories.

What it does is deliberately small. A save never touches the vault directly. The gateway checks the text (a length cap, rate limits and a check for anything that looks like a credential), drops it in a private queue, and a 15-minute job files it as a private note in my memory inbox. Policy can never auto-approve a save; I approve each one myself.

Each app gets its own write-only token. A leaked token can add notes to my review queue, but it can't read a single memory. I can revoke one app without touching the others, and every call is logged with the token's name.

Each app connects differently, so each gets its own route:

save_memory routes for Claude, ChatGPT and CodexEach app reaches the memory gateway by its own route with its own write-only token: Claude Code and Codex directly, Claude Desktop through mcp-remote, claude.ai through Tailscale Funnel, ChatGPT through OpenAI's MCP tunnel and tunnel-client. Saves then go to a queue, a private inbox note, my approval, and publishing.Claude Codetoken: claude-code-saveCodexapp + CLI: codex-saveClaude Desktoptoken: claude-saveclaude.ai webtoken: claude-web-saveChatGPTweb + desktop: chatgpt-saveDirect HTTPlocal IP/mcpDirect HTTPheader in config.tomlmcp-remote bridgelocal npx processTailscale Funnelpublic URL + headerOpenAI MCP tunneltunnel-client adds tokenMemory gatewaysave_memory onlywrite-only tokensSave queuestate/mcp_inboxInbox noteprivateI approveaccess: approvedPublishedagents can readGoes over the internet (Tailscale or OpenAI); the other routes stay on my Mac

Part 4: The Obsidian connector detour

Partway through, the Grok Bot Mac and iPhone app added a native Obsidian connector that reads an Obsidian folder directly, no server needed. I tried it. Pointed at the approved-only folder, it read fine, but it always has write access, so I had Claude add an inbox folder for its saves. To use it on my phone, I synced the folder to the Obsidian app through iCloud, which meant another copy of my memories to keep in sync. Each fix added a moving part, so I compared the two:

MCP gateway Obsidian connector
What the agent can read Search results, about 5 per query The whole folder
What it can write Only save_memory, checked on the spot Any file; staying in inbox/ relies on an instruction
Revoking a memory Gone on the next request Gone once iCloud syncs to each device
Logging Every read and save, per client None
Works with Claude, ChatGPT, Codex, Grok Bot, any MCP client Only apps with an Obsidian connector

The connector's one real advantage was working while my Mac is asleep, and that was easier to fix at the source: my Mac now never sleeps, restarts after a power cut, and opens Tailscale at login. So I went back to MCP and disconnected the connector.

The connector is more convenient. MCP is more controllable, and control is the point of this project.

Beyond personal memory

The idea isn't only personal. Companies face the same question with agents: what knowledge to keep, how to keep it current, and who decides what an agent sees. LangChain's knowledge factory is one example: a curator agent keeps a company's shared knowledge for its agents up to date, in effect an enterprise memory. The pieces I care most about here, local storage and a human approving what agents can read, are the ones worth carrying over.

The code is on GitHub if you want to follow along or adapt it.