---
title: "Victor Taelin's OptMem Gives AI Agents Permanent Memory Without a Database"
subtitle: "Victor Taelin's OptMem gives any coding agent persistent memory using an append-only log, a binary merge tree of summaries, and a 426-token prompt."
url: "https://alphasignal.ai/news/victor-taelin-s-optmem-gives-ai-agents-permanent-memory-without-a-database"
author: "AlphaSignal Newsroom"
author_url: "https://alphasignal.ai/editorial-team"
company: "AlphaSignal"
company_url: "https://alphasignal.ai/company/alphasignal"
published: "2026-07-31T02:19:57.000Z"
updated: "2026-08-22T02:49:46.601Z"
type: "Repo"
topics:
  - "Agents"
  - "Open Source"
subtopics:
  - "Agent Frameworks"
  - "Memory"
  - "Tool Use"
upvotes: 14
source_url: "https://github.com/VictorTaelin/OptMem"
comments: 0
truncated: true
---

# Victor Taelin's OptMem Gives AI Agents Permanent Memory Without a Database

> Victor Taelin's OptMem gives any coding agent persistent memory using an append-only log, a binary merge tree of summaries, and a 426-token prompt.

Every AI coding agent has the same amnesia problem. The context window is its whole world, and that world ends the moment the session closes. Victor Taelin, the author of HVM and Kind, got tired of the usual patches (notes files, vector stores, memory servers) and shipped his own fix: [OptMem](https://github.com/VictorTaelin/OptMem), a permanent memory layer for agents that amounts to a text file and a Python script.

The pitch is unusually minimal. [OptMem](https://moclaw.ai/blog/what-is-optmem) ships as a 426-token prompt block and a single Python file with no dependencies. You paste the prompt into your `AGENTS.md` or `CLAUDE.md`, and the agent starts writing one-line notes to an append-only log on disk. No vector database, no embeddings, no server, no daemon.

## The two-file trick

The core design splits the memory problem in half. Every entry is appended to `LOG.txt` and never edited or deleted, so nothing is ever forgotten. What the agent actually reads on wake-up is a fixed-size document: `memo wake` prints a bounded number of lines, with recent memories verbatim and older ones progressively compressed. At a hundred million memories it is still the same number of lines.

The compression cache lives in a `TREE/` directory as a binary merge tree over the log. A block is an aligned power-of-two range of memories compressed into a single line, and each block is built from its two halves. Entries #0 and #1 fuse into block `0-1`, that pair fuses with `2-3` into `0-3`, and so on. Every node, no matter how many raw entries it covers, is one line of at most 280 characters.

_Preview only. Full text requires an AlphaSignal Pro account._

## Sources

- [VictorTaelin/OptMem GitHub repository](https://github.com/VictorTaelin/OptMem)
- [OptMem: Permanent Memory in 426 Tokens](https://moclaw.ai/blog/what-is-optmem)
- [Builder Releases OptMem For Infinite AI Agent Memory](https://digg.com/tech/8d2l5808)
- [Victor Taelin announcement on X](https://twitter.com/VictorTaelin/status/2081453432318132603)
