VictorTaelin/OptMem
A local Python CLI that gives AI agents persistent memory across sessions
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
OptMem pairs a dependency-free, single-file Python 3 CLI at ~/.optmem/memo with an instruction block in the agent's configuration. The intended loop is to load existing memory with memo wake, append durable observations with memo note, and have the agent supply summaries as merges come due. note surfaces merges one at a time, and memo nap handles pending merges. There is no background worker.
The source of truth is LOG.txt, an append-only log of fixed-width records. Record position doubles as identity, so a known record can be located with one seek. TREE/ is a rebuildable cache of one-line summaries over adjacent ranges. The CLI organizes the tree while the host agent generates the summaries. The integration boundary is shell calls and text, not a documented server API, plugin system, or model backend.
Key Capabilities & Differentiators
memo note accepts one line of up to 280 bytes, not 280 characters; that matters for multibyte text. memo wake emits a bounded startup view, with 96 lines estimated at roughly 8,000 tokens. memo config WAKE_LINES=300 raises the output budget without changing storage or recomputing summaries. That makes context use tunable independently of history size, although actual token counts depend on the text and tokenizer.
memo recall <regex> searches the full raw history by text, while memo zoom <a-b> splits a summary range into halves that can be opened down to raw notes. memo forget invalidates a summary for rebuilding on the next nap; it is not raw-note deletion. A reported data point puts wake at 0.03 seconds with one million notes occupying 608 MB. With no hardware or test method specified, treat that as illustrative, not a deployment target or a measure of regex search speed.
Trade-offs & Limitations
Compared with an embedding-backed memory store, OptMem avoids an embedding pipeline and vector index. It is a good fit when an agent mostly needs a compact startup briefing, known-term lookup, or navigation through prior decisions. Regex recall does not match paraphrases by meaning and searches the entire history. Tree navigation depends on the agent preserving useful details in its summaries. The documented workflow also asks subagents not to write, which limits automatic capture from delegated work.
The append-only log and rebuildable cache make the storage model simple to reason about, but they do not solve retention, permissions, or synchronization. Raw-note erasure is not part of the documented workflow. Because the startup prompt encourages acting on memory output, treat stored text as untrusted data and restrict what may be written, shared, or sent to a model. With no specified license, clarify usage and redistribution rights before commercial rollout.
Hardware & Deployment Guide
The documented installation path pipes a remote install.sh into sh, installs the CLI at ~/.optmem/memo, and prints an instruction block for AGENTS.md or CLAUDE.md. It requires Python 3 and a shell for the documented workflow; adding ~/.optmem to PATH is optional. For managed hosts, inspect the installer and pin a reviewed revision instead of running a moving main branch directly. A WINDOWS.md file exists, but its presence alone does not establish native Windows compatibility.
The CLI manages local files without a required database service or model API. Once installed, local file operations do not require network access, but agent-generated summaries inherit the host model's connectivity and cost. $MEMORY_DIR relocates the store, including to a synced folder or Git repository; validate concurrent access and recovery before using either as a shared store. No published release milestone is listed; the documented update path reruns the installer.
LOG.txt uses fixed-width records whose positions serve as IDs.TREE/.recall searches the full history with regex; zoom opens a summary range into two halves.WAKE_LINES changes startup output without rewriting stored records or recomputing summaries.AGENTS.md or CLAUDE.md coordinates shell calls and agent-written summaries.A developer or small team with shell-enabled agents that need to carry decisions, preferences, and prior attempts across sessions, and can maintain short notes and summaries.
You need semantic retrieval, built-in deletion of raw notes, a managed multi-user memory service, or an integration that does not depend on the agent following a prompt.
Quick Start & Installation
curl -fsSL https://raw.githubusercontent.com/VictorTaelin/OptMem/main/install.sh | sh
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/VictorTaelin/OptMem.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about OptMem
What does an agent need to integrate with OptMem?
AGENTS.md or CLAUDE.md, not a provider API. The agent needs shell access and must consistently call memo wake at startup, record notes, and supply summaries when merges come due. Pilot the workflow in the actual agent host and verify that recalled text is treated as context, not authority.Does OptMem need a GPU, and what drives resource usage?
wake output, and retrieval time for whole-history regex searches.What should a commercial or regulated deployment check?
When should I choose OptMem over an embedding-backed memory store?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy