📈 GH Trending Explorer 🎲 Surprise me

← all repos

supermemoryai / memoryrepo

git clone https://github.com/supermemoryai/memoryrepo.git

An agent whose long-term memory is a git repo of markdown

+1
stars, 24h · #9,825
+~7
stars, 7 days · #10,473
+101
stars, 30 days · #4,880
102
★ total · +7% this week
10
forks · 1 open issues

Star history (as recorded here)

2026-10-20 · 100 ★ 2026-10-22 · 102 ★
LanguageTypeScript
LicenseMIT
Created2026-10-06 (16d ago)
Last push16d ago
Watchers0
OwnerOrganization

Links

README excerpt
# markdown memory
An AI agent whose long-term memory is **a git repo of markdown**: an LLM wiki it reads, writes, and tidies up itself.
- **`MEMORY.md`** is the entry point. It's loaded into every conversation, kept short, and links out to topic files (`people/priya.md`, `projects/…`, `preferences/…`).
- **One fact per line, with provenance:** `- Priya moved to Pune [source: thread/ab12cd34#m9; added: 2026-10-05]`. Files link to each other with `[[people/priya]]`.
- **The agent remembers as it goes.** It greps the repo and follows links to recall, and every memory write is a commit, pushed immediately.
- **Notes, too.** Besides chatting, you can write notes in a block editor (`/` commands, task lists, drag handle; the editor experience follows notty). Notes are stored as markdown. The next dream reads new or edited notes and folds what's durable into memory, citing `note/ `.
- **Dreaming** is a periodic background agent. It adds patterns across conversations, merges duplicates, removes outdated entries, and opens the cited conversation to resolve contradictions.
- **Everything is inspectable:** a file tree, rendered notes with backlinks, an Obsidian-style graph, full commit history with diffs, a live dream log, and the cost of every turn and dream.
The technique follows Cognition's agent memory repo, applied to personal memory.
## How it works
 [code] 
**Chat turn** (`src/server/chat-agent.ts`, `src/server/memory.ts`)
- The model sees `MEMORY.md` in its system prompt and has four tools:
 - `bash`: a sandboxed, read-only shell over the repo (just-bash, so `rg`, `grep`, `find` and `cat` all work)
 - `memory_write`, `memory_edit`, `memory_delete`: each one is a git commit, pushed immediately
- Writes are optimistic, like `git push`. If a file the agent is changing was modified since it read it (by another conversation, or by a dream), the write is rejected and the current version comes back so the agent can merge. Writes to *different* files rebase cleanly.
**Dreaming** (`dream()` in `src/server/memory.ts`)
- A coding-agent loop over a writable copy of the repo, plus an `/inbox` of new chat messages and new or edited notes since the last dream.
- Tools: `bash`, `write_file`, `read_source` (opens the conversation or note behind a `[source: …]`) and `commit`.
- The result is pushed as one commit. If chat wrote while the dream ran, the dream's edits are rebased on top. A same-file conflict drops the dream and the next run retries.
- Runs on a Durable Object alarm every 4 hours, but only if there are new messages. The UI also has a **Dream now** button.
**Storage**
- Each user's memory is a Cloudflare Artifacts git repo, which you can clone with plain `git`.
- Reads go through the Artifacts Worker binding; writes use isomorphic-git inside the Durable Object.
- Chat history, the thread list, the cost ledger and a full-text index (SQLite FTS5) live in the Durable Objects' SQLite.
## Models
Open-weight models only, through OpenRouter. Pick the chat model a