Model or dataset
VictorTaelin/OptMem avatar
VictorTaelin/OptMem

OptMem: one Python file, one appended log, and 426 tokens of markdown

Permanent memory for AI agents. A 426-token prompt, a script, plug and play.

2,458 stars157 forksPythonLicense varies

At a glance

What is it?
OptMem gives an agent a permanent memory directory that no model or vendor can take away. What this repository actually ships is a single dependency-free Python file, an installer that pipes a remote script into a shell, and a prompt block you paste into your agent instructions by hand.
Who is it for?
OptMem fits one narrow job and does it with very little: a dependency-free script, an append-only log, and text the agent is asked to obey. Read it if you want durable notes that survive compaction and a model switch, and if you are willing to paste a prompt block into your agent instructions and run `memo nap` by hand.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 115 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • VictorTaelin/OptMem2,458 ★ · +940
Star history
Repository2026-09-112026-11-22
VictorTaelin/OptMem1.5k2.5k

940 Stars in the last 72 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Install is one curl line piped into sh

The whole install is one line, and it hands a remote script to a shell:

sh
curl -fsSL https://raw.githubusercontent.com/VictorTaelin/OptMem/main/install.sh | sh

The branch in that URL is `main`, so what runs is whatever the branch holds at the moment you run it. Nothing in the line pins a commit, and no checksum or signature is called for. What comes back is text rather than a binary: the installer prints a `## Memory` block, and the instruction is to paste it at the top of an agent's `AGENTS.md` or `CLAUDE.md`. Running the same line a second time is how you update, so the same fetch doubles as the upgrade path. The tool lands at `~/.optmem/memo`, and adding `~/.optmem` to `PATH` is what lets you type `memo`. No uninstall line, no package manager entry and no version marker appear anywhere in that flow.

Position is identity, so the log is append only

The storage model is a plain text file with a strict rule. Every memory is one line in `memory/LOG.txt`, the log is append only, and no line is ever edited. Records are fixed width, and that single property is what makes a position act as an identifier: the stated consequence is that every lookup is one seek instead of a scan. The file offers one scaling figure, at a million memories, 608 MB, `wake` takes 0.03s. That number is the project's own, presented without a test setup, and it describes the read path only. Summaries live separately in `memory/TREE/`, which the file calls a cache that can be rebuilt from the log alone. So of everything under `~/.optmem/`, the log is the only part you cannot regenerate.

The prompt hardcodes two paths, and MEMORY_DIR can move one of them

Two paths in this design are fixed in prose and one of them is movable in the environment. The block printed by the installer names the tool as `~/.optmem/memo` and the data as `~/.optmem/memory`, and the commands section repeats the same location for `memo config`. Setting `$MEMORY_DIR` moves `memory/` elsewhere, and the file suggests a synced folder or a git repo as the destination. So the text an operator pastes into `AGENTS.md` can name a directory that is not where the data actually lives, and the printed block never reads that variable. What the block does state is the durability argument in two sentences: OptMem outlives every session, compaction, model and vendor change, and without it you do not know who you are or what was decided and tried.

Merges surface only inside the output of note

Consolidation is not automatic and the file is explicit about it: merges arrive one at a time, in the output of `note`, and nothing ever runs in the background. `memo nap` is the command that answers the merges that came due, which makes it the only point at which a summary in the tree is actually rewritten. That has a recovery path worth knowing. `memo forget <lo>-<hi>` drops a bad summary, and the next nap rebuilds it from the log, so a wrong merge costs one nap rather than the underlying memories. The corollary is less comfortable: whether a nap is owed is only visible in the output of a later `note`, so a summary can stay wrong for as long as nobody records anything. No daemon, scheduler or timer is involved, because none is installed.

recall takes a regex while zoom and forget take positional ranges

The read side of the tool speaks two different languages. `memo recall <regex>` searches every memory ever recorded, word for word, and nothing states a cap on how much it prints or how results are paged. `memo zoom <lo>-<hi>` and `memo forget <lo>-<hi>` instead take ranges, which is the positional view made explicit: a range is a span of record positions, not a name, a tag or a date. Writing is the narrowest operation in the set, since `memo note "..."` takes a single line of at most 280 bytes. That limit is the practical ceiling on one record, and the 280 byte figure is the only size constraint stated anywhere in the file.

The integration is markdown, and the copy shown stops mid sentence

Nothing in this project is wired by code. What the installer prints is a markdown block, and the file calls that block the whole of the integration.

markdown
## Memory

Your memory is OptMem:
- The tool is `~/.optmem/memo`
- Your memories are in `~/.optmem/memory`

OptMem outlives every session, compaction, model and vendor change.
Without it you do not know who you are, or what was decided and tried.

The startup rule that follows is phrased as mandatory: run `~/.optmem/memo wake` before any other tool call, in every session, then do exactly what it prints, to the end of its output. The rule for while working is phrased the same way, and the copy in this file ends partway through its own sentence, on the words `or something worth ke`, with no closing condition under it. The block the installer prints therefore continues past what is shown. A rule that depends on the output of the tool it describes cannot fail loudly, because an agent that ignores it leaves no trace except a memory that was never written.

No releases, no LICENSE file, and a WINDOWS.md nobody links

Three maintenance facts sit next to each other in the root and none of them agree. The repository publishes no GitHub releases, so there is no tag to pin that install line to and the only version figure advertised anywhere is the 426 token prompt size. The root has no `LICENSE` file, and no license is recorded for the project either, so the terms for copying the script or reprinting the prompt are not stated in it at all. And `WINDOWS.md` sits in the root without being linked or described, while the only install path given is a POSIX pipeline ending in `sh`. Two more root entries, `anim/` and `test.py`, are not explained by the usage text either. The last push to the repository is dated 2026-07-31, and 11 issues are open.

sh
memo config                  # show the sizes
memo config WAKE_LINES=300   # how many lines wake prints (96 ≈ 8k tokens)
memo config WAKE_LINES=      # back to the default

Those three lines are the entire tuning surface. `WAKE_LINES` is described as a reading budget rather than a storage budget: change it in either direction and nothing is recomputed.

Editorial conclusion

OptMem fits one narrow job and does it with very little: a dependency-free script, an append-only log, and text the agent is asked to obey. Read it if you want durable notes that survive compaction and a model switch, and if you are willing to paste a prompt block into your agent instructions and run `memo nap` by hand. Before adopting it, check three things for yourself: the root of this repository has no LICENSE file and the metadata records no license either, so reuse terms are unstated; the install line runs whatever `main` holds right now with no commit pinned, so read `install.sh` before piping it to a shell; and the printed prompt names `~/.optmem/memory` while `$MEMORY_DIR` can move that directory, so make sure the two agree on your machine.

Frequently asked questions

What does OptMem install, and where does it put the tool?

One curl line pipes install.sh into a shell. The tool lands at ~/.optmem/memo, adding ~/.optmem to PATH lets you type memo, and the installer prints a markdown block to paste into AGENTS.md or CLAUDE.md.

How does OptMem store the memories an agent records?

Every memory is one line in memory/LOG.txt, append only and never edited. Summaries live in memory/TREE/ and are called a cache that can be rebuilt from the log alone, so the log is the only part you cannot regenerate.

What does memo nap do in OptMem?

It answers the merges that came due. Merges arrive one at a time in the output of memo note, and the file states that nothing ever runs in the background.

How large can an OptMem memory log grow?

The file states that at a million memories, 608 MB, wake takes 0.03s, because records are fixed width so that position is identity and every lookup is one seek.

Is OptMem covered by an open source license?

The repository root has no LICENSE file and its metadata records no license, so reuse terms for the script and the prompt are not stated anywhere in the project.

Official sources

  1. Issues
  2. README
  3. VictorTaelin/OptMem on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/victortaelin-optmem.svg)](https://hysenlabs.com/projects/victortaelin-optmem)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/victortaelin-optmem.svg)](https://hysenlabs.com/projects/victortaelin-optmem)

Was this useful?