{"slug": "optmem-plug-and-play-infinite-memory-for-any-agent", "title": "OptMem: Plug-and-play infinite memory for any agent", "summary": "OptMem, a plug-and-play infinite memory system for AI agents, is now available as a 333-token prompt and script that integrates by pasting a `## Memory` block into an agent's configuration file. The tool, created by Victor Taelin, provides permanent memory that outlives sessions, models, and vendors, with commands for reading, recording, recalling, and forgetting memories, and can handle a million memories in 0.03 seconds.", "body_md": "Permanent memory for AI agents. A 333-token prompt, a script, plug and play.\n\n```\ncurl -fsSL https://raw.githubusercontent.com/VictorTaelin/OptMem/main/install.sh | sh\n```\n\nIt prints a `## Memory`\n\nblock. Paste that at the top of your agent's\n`AGENTS.md`\n\n(or `CLAUDE.md`\n\n), and you are done. Run the same line again to\nupdate.\n\n`memo wake` |\nread the memory — the first command of every session |\n`memo note \"...\"` |\nrecord one memory: one line, up to 280 chars |\n`memo nap` |\nanswer the merges that came due |\n`memo recall <regex>` |\nsearch every memory ever recorded, word for word |\n`memo forget <lo>-<hi>` |\ndrop a bad summary; the next nap rebuilds it |\n\nMerges arrive one at a time, in the output of `note`\n\n. Nothing ever runs in the\nbackground.\n\n```\n~/.optmem/\n  memo          the tool: one file of Python 3, no dependencies\n  memory/\n    LOG.txt     every memory, one per line, append-only, never edited\n    TREE/       the summaries: a cache, rebuildable from the log alone\n    config      the sizes, written by `memo config`\nmemo config                  # show the sizes\nmemo config WAKE_LINES=300   # how many lines wake prints (208 ≈ 16k tokens)\nmemo config WAKE_LINES=      # back to the default\n```\n\n`WAKE_LINES`\n\nis the only size worth touching, and it is a reading budget, not\na storage budget: change it whenever, in either direction, and nothing is\nrecomputed.\n\nRecords are fixed width, so position *is* identity and every lookup is one\nseek. At a million memories (607 MB), `wake`\n\ntakes 0.03s.\n\nSet `$MEMORY_DIR`\n\nto keep `memory/`\n\nelsewhere — a synced folder, a git repo.\n\nThis is what the installer prints, and the whole of the integration.\n\n```\n## Memory\n\nYour memory is OptMem:\n- The tool is `~/.optmem/memo`\n- Your memories are in `~/.optmem/memory`\n\nOptMem outlives every session, compaction, model and vendor change.\nWithout it you do not know who you are, or what was decided and tried.\n\n### At startup: activating OptMem (mandatory)\n\nRun `~/.optmem/memo wake` before any other tool call, in every session, and\nthen do exactly what it prints, to the end of its output.\n\n### While working: register memories (mandatory)\n\nCall `~/.optmem/memo note \"<1 line, max 280 chars>\"` whenever you learn\nsomething new, or something worth keeping happens. That covers a task\nworth real effort, a fact or insight the user teaches you, anything you\nlearn about their life (even indirectly), any event of lasting effect.\n\nDo not register redundant memories.\n\nIf `~/.optmem/memo note` asks a compression: do it before your next action.\n\nUse `~/.optmem/memo recall <regex>` when a memory you need is too vague.\n\nNever edit or delete anything under `~/.optmem/memory`: the tool manages it.\n\n### If you're a subagent: skip everything above\n\nParallel sessions on this machine are all you, and may all write memories.\nA subagent is not: it must never run `memo`, because it cannot judge what\nis already known, and its notes would arrive duplicated and incorrectly.\nWhen you spawn one, write: `You are a subagent. Don't run memo.`\n```\n\n", "url": "https://wpnews.pro/news/optmem-plug-and-play-infinite-memory-for-any-agent", "canonical_source": "https://github.com/VictorTaelin/OptMem", "published_at": "2026-07-26 19:07:53+00:00", "updated_at": "2026-07-26 19:22:05.771103+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-infrastructure"], "entities": ["OptMem", "Victor Taelin"], "alternates": {"html": "https://wpnews.pro/news/optmem-plug-and-play-infinite-memory-for-any-agent", "markdown": "https://wpnews.pro/news/optmem-plug-and-play-infinite-memory-for-any-agent.md", "text": "https://wpnews.pro/news/optmem-plug-and-play-infinite-memory-for-any-agent.txt", "jsonld": "https://wpnews.pro/news/optmem-plug-and-play-infinite-memory-for-any-agent.jsonld"}}