buildingjoshbetter/TrueMemory

The memory your AI should have had from the start. Automatic capture, automatic recall, 100% local. One SQLite file, zero cloud. Works with Claude Code, Claude CLI, Cursor, Codex CLI, Gemini CLI.

371 ★48 forksPythonUpdated 9d ago

What you need to know

Local-first, auto-capturing agent memory system — TrueMemory automatically captures memories from conversations and injects the relevant ones into later sessions, storing everything in a single local SQLite file with no cloud and no API keys (Edge/Base tiers). Backed by a research paper and claims leading scores on LoCoMo/LongMemEval/BEAM-1M.

Install

curl -LsSf https://raw.githubusercontent.com/buildingjoshbetter/TrueMemory/main/install.sh | sh (Claude Code / Claude CLI / Cursor / Codex CLI / Gemini CLI; downloads ~1.5GB of AI models into an isolated env)
Windows PowerShell: irm https://raw.githubusercontent.com/buildingjoshbetter/TrueMemory/main/install.ps1 | iex
Python library: pip install truememory

Usage

  • After installing, quit and reopen your AI tool, then type 'Set up TrueMemory' and pick a tier
  • Lifecycle hooks capture conversations automatically — no manual work needed
  • Python API: from truememory import Memory; m = Memory(); m.add("Prefers dark mode", user_id="alex"); m.search("preferences", user_id="alex")
  • Switch tiers anytime by saying 'switch to Pro' or 'switch to Base'

Key features

  • Automatic capture and injection of memories across sessions; directives (standing instructions) auto-load every session
  • 100% local: one SQLite file at ~/.truememory/memories.db; Edge and Base tiers make zero external calls
  • Three tiers in one install: Edge (CPU-only, 8MB embedding model), Base (fully offline, 600MB model), Pro (adds HyDE query expansion, needs LLM API key)
  • 6-layer retrieval pipeline + reranker; search_deep multi-round agentic search
  • Reported 93.0% LoCoMo / 92.0% LongMemEval / 76.6% (SOTA) BEAM-1M with reproducible benchmark scripts
  • Works via lifecycle hooks with Claude Code, Claude CLI, Cursor, Codex CLI, Gemini CLI, Claude Desktop

Best for

Developers who want zero-config, private, automatic long-term memory for their coding agent without managing a server or cloud account

Caveats

  • Pro tier requires an LLM API key for HyDE query expansion (Pro sends only your search query text to the LLM, never memories)
  • Installer downloads ~1.5GB of local AI models; first run takes 3-5 minutes
  • Anonymous usage telemetry is on by default (never memory content); opt out with TRUEMEMORY_TELEMETRY=off
  • AGPL-3.0: free for personal and research use; commercial use requires a separate license
Platforms: macOS · Linux · WindowsClients: Claude Code · Claude CLI · Cursor · Codex CLI · Gemini CLI · Claude Desktop
Documentation ↗

Reviewed 2026-08-07

Topics

agent-memoryaiai-agentai-agentsai-memoryanthropicclaudeclaude-codedeveloper-toolsembeddingsgenerative-aillmmcpmcp-servermodel-context-protocolpythonragsemantic-searchsqlitevector-search
View on GitHub ↗
Stars
371★
Forks
48
Language
Python
License
AGPL-3.0
Created
2026-03-18
Last push
2026-07-29