AI Briefing
KO

OptMem: Agent Memory Without a Database

·2026.08.30 18:30

Key point

The open-source tool 'OptMem' has been released, managing persistent memory for AI agents using text logs and binary summary trees without embeddings or vector databases.

1 / 2

Details

OptMem, released by Victor Taelin, is a tool that manages persistent memory for AI coding agents using only text logs and a binary merge tree, without using embedding models or vector databases. It reduces the operational complexity and opacity of existing vector search methods, providing a simple structure that humans can directly read and modify.

Core Structure and Working Principle

OptMem consists of a text log (LOG.txt) where memories are appended line by line, and a binary summary tree (TREE) generated based on it. Recent memories are kept as raw text, while older memories are compressed into summaries by merging adjacent items. The summaries serve only as a cache, while the original text is preserved in the log, allowing restoration of the original text when needed.

  • Storage Method: A fixed-width text log where the position itself acts as an identifier, enabling fast retrieval without a separate index.
  • Performance: For 1 million memories (608MB), outputting the full history summary (wake) takes 0.03 seconds.
  • Dependencies: Composed of a single Python 3 file, requiring no external libraries or databases.

Key Features and Usage

Installation is completed with a single script line, and integration is done by pasting a prompt block into the agent's AGENTS.md or CLAUDE.md. The main commands are as follows:

  • memo wake: Outputs the top-level summary of the tree at the start of a session to grasp the full history.
  • memo note "...": Records a new memory as a single line (max 280 bytes).
  • memo recall <regex>: Searches the entire record literally using a regular expression.
  • memo nap: Processes pending merge operations to update the tree.

Features and Limitations

OptMem is optimized for single-user environments. It is stored in a local directory and includes prompt instructions prohibiting memo execution to prevent sub-agents from creating duplicate records. Therefore, it is not suitable for environments requiring team sharing or semantic search, and it does not find similar concepts with different expressions. Instead, it remains in text file format for high transparency, and parallel writing (verified with 8 concurrent processes) is supported even in native Windows environments.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.