Revert name to OptMem

This commit is contained in:
victortaelin 2026-07-26 14:35:22 -03:00
parent 15130b9cad
commit bd2a799500
8 changed files with 31 additions and 31 deletions

View file

@ -1,4 +1,4 @@
# AmalgaMem # OptMem
How do you make an AI agent remember its whole life? How do you make an AI agent remember its whole life?
@ -9,9 +9,9 @@ How do you make an AI agent remember its whole life?
grow with age; a memory that scrolls past it might as well not exist. grow with age; a memory that scrolls past it might as well not exist.
Most agent memories pick one: keep everything (and drown), or keep a small Most agent memories pick one: keep everything (and drown), or keep a small
curated file (and forget). AmalgaMem does both. *At once.* curated file (and forget). OptMem does both. *At once.*
[![watch the animation](anim/poster.png)](anim/amalgamem.mp4) [![watch the animation](anim/poster.png)](anim/optmem.mp4)
*↑ click to watch: 3 minutes, the whole idea.* *↑ click to watch: 3 minutes, the whole idea.*
@ -93,8 +93,8 @@ a memory.
## Setup ## Setup
```sh ```sh
git clone https://github.com/VictorTaelin/AmalgaMem ~/AmalgaMem git clone https://github.com/VictorTaelin/OptMem ~/OptMem
~/AmalgaMem/memo init ~/OptMem/memo init
``` ```
`memo init` creates `~/memory` — this machine's identity — and prints a `memo init` creates `~/memory` — this machine's identity — and prints a
@ -105,31 +105,31 @@ everything else on its own. The block:
```markdown ```markdown
## Memory ## Memory
Your memory is AmalgaMem: the tool is `~/AmalgaMem/memo`, the data is `~/memory`. Your memory is OptMem: the tool is `~/OptMem/memo`, the data is `~/memory`.
It survives every new session, every compaction and every change of It survives every new session, every compaction and every change of
model or vendor. Without it you do not know who you are, or what was model or vendor. Without it you do not know who you are, or what was
already decided and tried. already decided and tried.
Run `~/AmalgaMem/memo wake` before any other tool call, in every session. It prints Run `~/OptMem/memo wake` before any other tool call, in every session. It prints
in numbered parts, each ordering the next; run every one until a part in numbered parts, each ordering the next; run every one until a part
says `You are awake.` Do not stop early: part 1 is your distant past, says `You are awake.` Do not stop early: part 1 is your distant past,
the last part is this week. If wake refuses because compressions are the last part is this week. If wake refuses because compressions are
pending, do them and run `~/AmalgaMem/memo wake` again. pending, do them and run `~/OptMem/memo wake` again.
While you work: While you work:
- `~/AmalgaMem/memo note "<one line, max 280 chars>"` the moment something happens, - `~/OptMem/memo note "<one line, max 280 chars>"` the moment something happens,
you learn something, or something changes -- if and only if it is new you learn something, or something changes -- if and only if it is new
to you, important, and lasting in effect. That covers a task worth to you, important, and lasting in effect. That covers a task worth
real effort, a fact or insight your user teaches you, anything you real effort, a fact or insight your user teaches you, anything you
learn about their life (even indirectly), and work of yours that learn about their life (even indirectly), and work of yours that
lands. Never write what you already know: no redundant memories, ever. lands. Never write what you already know: no redundant memories, ever.
- If `~/AmalgaMem/memo note` returns a compression, do it before your next action. - If `~/OptMem/memo note` returns a compression, do it before your next action.
- `~/AmalgaMem/memo recall <regex>` when a memory is too vague. - `~/OptMem/memo recall <regex>` when a memory is too vague.
- Before your context ends, run `~/AmalgaMem/memo sleep` and answer each prompt - Before your context ends, run `~/OptMem/memo sleep` and answer each prompt
until it prints `Nothing left to compress.` until it prints `Nothing left to compress.`
- Never create, edit or delete anything under `~/memory`. Only the tool - Never create, edit or delete anything under `~/memory`:
writes there. only the tool writes there.
Parallel sessions on this machine are all you, and may all write Parallel sessions on this machine are all you, and may all write
memories. A subagent is not: it must never run `memo`, because it cannot memories. A subagent is not: it must never run `memo`, because it cannot
@ -139,7 +139,7 @@ subagent. Do not run memo.` If your own first message is a task brief
from another agent, you are that subagent: skip this section. from another agent, you are that subagent: skip this section.
``` ```
That is the whole integration. AmalgaMem is just prompts and scripts: no That is the whole integration. OptMem is just prompts and scripts: no
daemon, no database, no embeddings, no API. It works the same under Claude daemon, no database, no embeddings, no API. It works the same under Claude
Code, Codex, pi, or a human at a shell. Code, Codex, pi, or a human at a shell.
@ -227,7 +227,7 @@ ever rewritten.
## Limitations ## Limitations
AmalgaMem is honest about what it is. Recency is the only axis: an important OptMem is honest about what it is. Recency is the only axis: an important
old fact fades into its block like everything else, and the defence is old fact fades into its block like everything else, and the defence is
rehearsal — noting it again refreshes it. `recall` is regex over plain text, rehearsal — noting it again refreshes it. `recall` is regex over plain text,
not semantic search; the memory context is what tells you what to search not semantic search; the memory context is what tells you what to search

View file

@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>AmalgaMem — how it works</title> <title>OptMem — how it works</title>
<style> <style>
body { margin:0; background:#f2f4f6; display:flex; flex-direction:column; body { margin:0; background:#f2f4f6; display:flex; flex-direction:column;
align-items:center; font-family:Menlo,ui-monospace,monospace; color:#5b6672; } align-items:center; font-family:Menlo,ui-monospace,monospace; color:#5b6672; }

View file

@ -1,5 +1,5 @@
"use strict"; "use strict";
// AmalgaMem explainer. // OptMem explainer.
// Rules: a screen is EITHER one sentence OR one picture, never both. // Rules: a screen is EITHER one sentence OR one picture, never both.
// One new thing per beat, held long enough to read it out loud twice. // One new thing per beat, held long enough to read it out loud twice.
// Pacing lives here: [kind, seconds, ...]; "co" = continue, no cut to white. // Pacing lives here: [kind, seconds, ...]; "co" = continue, no cut to white.
@ -33,7 +33,7 @@ const BEATS = [
"(Hermes caps it at 2,200 characters)"], "(Hermes caps it at 2,200 characters)"],
["prune", 5.2], ["prune", 5.2],
["say", "_PROBLEM:_", "you cannot tell *today*", "what will matter in a *year*"], ["say", "_PROBLEM:_", "you cannot tell *today*", "what will matter in a *year*"],
["say", "+OUR ANSWER:+", "AmalgaMem +deletes nothing+"], ["say", "+OUR ANSWER:+", "OptMem +deletes nothing+"],
["say", "two memories +merge+ into one", punch], ["say", "two memories +merge+ into one", punch],
["merge", 6.8], ["merge", 6.8],
["say", "the result is a memory too", "it just holds *less detail*"], ["say", "the result is a memory too", "it just holds *less detail*"],
@ -50,7 +50,7 @@ const BEATS = [
["say", "the *memory context* +never grows+", "and *you* choose its size"], ["say", "the *memory context* +never grows+", "and *you* choose its size"],
["say", "nothing is ever deleted", "the originals are all +still there+"], ["say", "nothing is ever deleted", "the originals are all +still there+"],
["recall", 6.8], ["recall", 6.8],
["say", "nothing to run, nothing to host", "AmalgaMem is just some prompts and scripts", ["say", "nothing to run, nothing to host", "OptMem is just some prompts and scripts",
"it works in any harness, any environment", "just point your *AGENTS.md* to it, and done"], "it works in any harness, any environment", "just point your *AGENTS.md* to it, and done"],
["end", 6.5], ["end", 6.5],
]; ];
@ -648,13 +648,13 @@ S.recall = (u, dur) => {
}; };
S.end = (u, dur) => { S.end = (u, dur) => {
T("AmalgaMem", W/2, 284, 58, INK, "center", true); T("OptMem", W/2, 284, 58, INK, "center", true);
cx.globalAlpha = ease((u - 0.6)/0.5); cx.globalAlpha = ease((u - 0.6)/0.5);
T("an append-only log + a binary merge tree", W/2, 356, 23, GREEN, "center"); T("an append-only log + a binary merge tree", W/2, 356, 23, GREEN, "center");
T("detail fades with age \u00b7 nothing is deleted", W/2, 396, 23, DIM, "center"); T("detail fades with age \u00b7 nothing is deleted", W/2, 396, 23, DIM, "center");
cx.globalAlpha = ease((u - 1.6)/0.5); cx.globalAlpha = ease((u - 1.6)/0.5);
T("~600 lines of Python \u00b7 no database \u00b7 no embeddings", W/2, 462, 19, FAINT, "center"); T("~600 lines of Python \u00b7 no database \u00b7 no embeddings", W/2, 462, 19, FAINT, "center");
T("github.com/VictorTaelin/AmalgaMem", W/2, 508, 21, "#1a5fd0", "center"); T("github.com/VictorTaelin/OptMem", W/2, 508, 21, "#1a5fd0", "center");
cx.globalAlpha = 1; cx.globalAlpha = 1;
}; };

View file

@ -1,4 +1,4 @@
// Renders the AmalgaMem animation to PNG frames. Usage: // Renders the OptMem animation to PNG frames. Usage:
// node video.js all frames at 30fps into frames/ // node video.js all frames at 30fps into frames/
// node video.js 3 9 26 40 single stills at those seconds into shots/ // node video.js 3 9 26 40 single stills at those seconds into shots/
const { createCanvas } = require("canvas"); const { createCanvas } = require("canvas");
@ -24,5 +24,5 @@ if (args.length) {
fs.writeFileSync(`frames/${String(f).padStart(5, "0")}.png`, cv.toBuffer("image/png")); fs.writeFileSync(`frames/${String(f).padStart(5, "0")}.png`, cv.toBuffer("image/png"));
if (f % 300 === 0) console.log(`${f}/${N}`); if (f % 300 === 0) console.log(`${f}/${N}`);
} }
console.log("done. now: ffmpeg -framerate 30 -i frames/%05d.png -c:v libx264 -pix_fmt yuv420p -crf 18 amalgamem.mp4"); console.log("done. now: ffmpeg -framerate 30 -i frames/%05d.png -c:v libx264 -pix_fmt yuv420p -crf 18 optmem.mp4");
} }

View file

@ -1,4 +1,4 @@
"""Block math for AmalgaMem. """Block math for OptMem.
A BLOCK is an aligned power-of-two range of memories, [lo, hi), written as one A BLOCK is an aligned power-of-two range of memories, [lo, hi), written as one
line of at most ENTRY_CHARS characters. Blocks form a binary merge tree over line of at most ENTRY_CHARS characters. Blocks form a binary merge tree over

10
memo
View file

@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
"""AmalgaMem: a permanent, append-only memory for AI agents. """OptMem: a permanent, append-only memory for AI agents.
memo init create this machine's memory, print the setup block. memo init create this machine's memory, print the setup block.
memo wake [part [T]] read your memory. Run first, every session. memo wake [part [T]] read your memory. Run first, every session.
@ -319,7 +319,7 @@ def next_nap(d, T):
# ---------------------------------------------------------------- commands # ---------------------------------------------------------------- commands
CONFIG = """\ CONFIG = """\
# AmalgaMem sizes for this memory. Uncomment a line to override it; an # OptMem sizes for this memory. Uncomment a line to override it; an
# absent line tracks the tool's default. # absent line tracks the tool's default.
# #
# WAKE_LINES=208 # the memory context: how many lines wake prints (~16k tokens) # WAKE_LINES=208 # the memory context: how many lines wake prints (~16k tokens)
@ -331,7 +331,7 @@ CONFIG = """\
TEMPLATE = """\ TEMPLATE = """\
## Memory ## Memory
Your memory is AmalgaMem: the tool is `{tool}`, the data is `{data}`. Your memory is OptMem: the tool is `{tool}`, the data is `{data}`.
It survives every new session, every compaction and every change of It survives every new session, every compaction and every change of
model or vendor. Without it you do not know who you are, or what was model or vendor. Without it you do not know who you are, or what was
already decided and tried. already decided and tried.
@ -354,8 +354,8 @@ While you work:
- `{memo} recall <regex>` when a memory is too vague. - `{memo} recall <regex>` when a memory is too vague.
- Before your context ends, run `{memo} sleep` and answer each prompt - Before your context ends, run `{memo} sleep` and answer each prompt
until it prints `Nothing left to compress.` until it prints `Nothing left to compress.`
- Never create, edit or delete anything under `{data}`. Only the tool - Never create, edit or delete anything under `{data}`:
writes there. only the tool writes there.
Parallel sessions on this machine are all you, and may all write Parallel sessions on this machine are all you, and may all write
memories. A subagent is not: it must never run `memo`, because it cannot memories. A subagent is not: it must never run `memo`, because it cannot

View file

@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
"""AmalgaMem invariants, checked against a synthetic life of 5000 memories. """OptMem invariants, checked against a synthetic life of 5000 memories.
Uses a fake compressor (join + truncate) so the run is deterministic and free. Uses a fake compressor (join + truncate) so the run is deterministic and free.
""" """