luamemo

development log

Notes from building private, local memory for AI agents.

v0.5.2 · LuaJIT · SQLite · MCP · CLI

What luamemo is

luamemo is a local memory engine for AI coding agents. It runs on your machine as an MCP server and a command line, keeps what an agent decides and learns in one SQLite file per project, and brings it back in later sessions. A new session no longer starts cold.

Chat sessions crash, grow too long and get compacted, and the decisions that mattered go with them. luamemo makes the transcript disposable. The durable part, the decisions, facts and plans, is written down as it happens and searched on demand. It works with Claude Code, VS Code, Claude Desktop and any other MCP client. It also writes a config entry for Cursor, which the project cannot test yet.

What it does

  • RemembersWrites decisions, facts and plans with a kind, tags and an importance, and finds them by words, and by meaning once calibrate has picked a real embedder.
  • FoldsFolds old and related memories into summaries and observations. The originals are archived and reviewed before anything is deleted.
  • SensesFeedback sensing. Corrections, praise and standing rules in the conversation are recognised from patterns, with an optional local model for paraphrases. They re-weight the memories they concern, and a new rule is stored as a decision.
  • Manages the dataTiers, importance and decay decide what stays on top. Memories can be updated, merged, exported as JSON Lines, imported and backed up.
  • Maps the codeOptionally indexes files, symbols and imports, so the agent finds where code lives without grepping.

What it costs your agent

  • 3.9 msto search 1,000 memories, 71 ms at 20,000 and 233 ms at 100,000. Every vector in scope is scored, so search stays exact.
  • ~146 tokensread on average before the right memory arrives, on a 36-question set about a real project (583 bytes at 4 bytes a token, with EmbeddingGemma rather than the built-in embedder). It was in the top 10 every time.
  • 290 B, not 86 KBread to reach the right file through the code map, where grep reads about 86 KB.
  • 13.4 to 18.3 KBsent once per session before the first search: usage rules, tool definitions and the brief. 13.4 KB with the core tools, 18.3 KB with all 27.

These are measurements from luamemo 0.5.x, October 2026, not promises. luamemo is built for real usage, and the benchmarks are a guard against regressions. memo usage reports how your own agent uses memory once the usage log is on. Retrieval is the lever: a miss costs about 22 KB of wrong rows on LoCoMo before the agent searches again. Methods and the other benchmarks are in the repository's eval folder.

Where it is going

luamemo is growing into an AI software-lifecycle tool for data manipulation and memory management. Today it writes, searches, folds, merges, exports and re-weights a project's memory, senses from corrections and praise what deserves to stay on top, and shares team memory over a LAN or VPN. Next is code review by an agent that knows why an abstraction exists and which conventions the team agreed on.

The longer direction is a memory engine for augmentative machine learning: a store that models and agents learn from, as well as read from. That is a goal, not a feature. Today the learning is small and opt-in: a learned reranker and projection that replace the current ranking only when they beat it on held-out data. Ideas are welcome in the issue tracker.