Give Your AI a Memory
persistent memory and shared context across AIs
The Problem
AI doesn't remember you. Every new session starts from zero. You re-explain the project, the decisions, the constraints, the way you like things done. And if you work across more than one AI (a coding agent here, an assistant there), they don't share anything. They each know a sliver of the picture.
Humans don't have unlimited energy, and AI doesn't have unlimited memory. The gap between sessions is where all the context and all the trust leaks out.
The usual "fix" is to paste a giant wall of context into every chat. That doesn't scale, and it's not the same as the AI actually knowing you.
The Solution
I gave my AIs a shared, persistent memory, and the pieces are public so you can borrow them.
Three layers, smallest to deepest:
- Session logs — every coding session writes a short narrative summary to a file, so the next session (in any tool: Claude Code, Cursor, OpenCode) picks up where the last left off. Public gist.
- brain-sync — two different Claudes bridge their memory through a Slack channel, so what one learns, the other can read. Public gist.
- A knowledge graph — Memgraph + Typesense + a nightly local-model extraction job + an auto-recall hook that surfaces the relevant memory every turn, automatically. This is the deep version that runs my whole setup.
The point isn't one clever tool. It's a pattern: capture context as you go, store it somewhere durable, surface the right slice at the right moment.
Technical Stack
A mix of public, pokeable pieces and a deeper private system:
- File-based session logs — plain markdown, no dependencies, works with any AI terminal
- brain-sync — a Slack channel as a shared memory bus between two agents
- Memgraph — a knowledge graph of people, projects, decisions, and how they connect
- Typesense — fast keyword + semantic search over memory, fused with RRF (reciprocal rank fusion, a way of blending results from multiple search methods into one ranked list)
- Local-model extraction (nightly) — a local LLM reads new transcripts and updates the graph, so nothing leaves my hardware
- Auto-recall hook — intercepts each prompt and injects the memory that matters, without me asking
The gists run on their own. The graph is the "and then it got serious" version of the same idea.
Impact
The result is AI that shows up already knowing the project: the decisions, the people, the constraints, instead of asking to be re-briefed every session.
I also taught a Maven Lightning Lesson on exactly this, "Two Claudes, One Context," if you want the walkthrough instead of the code. The public gists are the take-home version.
For a team, the payoff is the same: less time re-briefing, more consistency in what the AI produces, and memory that compounds instead of resetting.
THE RECEIPTS
Pick your depth
| layer | what it does | public? |
|---|---|---|
| Session logs | context across sessions and tools | gist |
| brain-sync | shared memory between two AIs via Slack | gist |
| Knowledge graph | auto-recall of the right memory every turn | described |
Start with a file. End with a graph. Same instinct: don't let context die at the end of the chat.