CodeAbra/iai-personal-memory-engine
A local MCP memory engine for verbatim history and contradiction-aware recall
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
This is a single-user, local-first memory layer, not a networked vector database. Host hooks append turns to a session buffer without embedding or engine RPC on the capture path. The background daemon embeds, deduplicates, encrypts, and indexes records, then clusters and consolidates them during idle time. Clients can query the store through MCP over stdio or the iai CLI. Where the host supports it, hooks also inject bounded context at session start and on later turns.
Hippo combines encrypted records, a vector index, and a graph in one store. MOSAIC provides Leiden-family community detection with stable community identities, while Lilli HD provides hyperdimensional representations and structural recall. The Python 3.11/3.12 package depends on NumPy, SciPy, and Numba. Native embedding and graph kernels live in the Rust workspace, whose dependencies include PyO3, Candle, tokenizers, and safetensors. The daemon uses a Unix socket on macOS/Linux and a token-protected ephemeral loopback port on Windows.
Key Capabilities & Differentiators
Episodic memory retains timestamped, write-once fragments; semantic memory summarizes related episodes; procedural memory learns ten bounded behavioral parameters. The local, LLM-free recall path combines semantic similarity, graph evidence, recency, temporal validity, and lexical evidence. A correction closes the old record’s validity interval and links a successor rather than overwriting the original. memory_recall can return both hits and anti_hits. The 15 memory MCP tools cover recall, capture, correction, claim checking, and inspection; iai upload accepts documents, Office files, e-books, code, configuration files, and directories.
The included benchmarks report Rescue@10 after contradiction and historical-verbatim hit@10 of 1.000 each, with a flat-cosine baseline of about 0.71 for historical-verbatim retrieval. With the product embedder, LongMemEval-S reaches R@5 of 0.962 and R@10 of 0.978. On the author’s store, automatic context packs averaged about 350 tokens versus about 2,850 for the agent-search round trip they replaced. That comparison is workload-specific and does not apply to explicit memory_recall, whose default response budget is 1,500 tokens.
Trade-offs & Limitations
Compared with a flat cosine index, versioned records and graph evidence support historical questions and contradiction handling, at the cost of a resident daemon and a more involved storage lifecycle. Against mempalace v3.3.6, the matched all-MiniLM-L6-v2 run ties at 0.966 R@5 and 0.978 R@10. Choose on host integration and historical semantics, not a benchmark lead. Recall is typically weak for roughly the first ten sessions. The default store is English-first, and changing embedding generations requires an explicit migration.
Records use AES-256-GCM at rest, but the transient capture spool and injection caches are plaintext. The store and key both live under ~/.iai-mcp/ and must be backed up together with appropriate access controls. There is no account, telemetry pipeline, or cross-machine sync. Local recall does not make the default installation offline: the REM step can invoke claude -p through an existing Claude subscription, and the version check and first-use model download also use the network. Automatic context injection is a disclosure path to the host and potentially its model provider; encryption at rest does not govern that path.
Hardware & Deployment Guide
The package targets Python 3.11 or 3.12. For Claude Code, install iai-pme, register the marketplace, install iai-memory@iai-pme, and verify with iai-mcp daemon status and iai-mcp doctor. Other hosts can initialize encryption with iai-mcp crypto init, install the background service with iai-mcp daemon install, and install hooks where supported. The macOS/Linux all-in-one source build also requires Git, Node.js 18+, and Rust. Check the daemon after setup: it stays running after the MCP session ends and can be stopped with iai-mcp daemon stop.
New stores default to the native format; upgrades preserve the existing format, and legacy SQLite migration is explicit via iai-mcp migrate-to-lilli. For offline operation, plan local model provisioning before setting IAI_MCP_EMBED_OFFLINE=1, and disable the version check and REM step with IAI_MCP_VERSION_CHECK=0 and IAI_MCP_REM_DISABLED=1. Release v3.2.2 added the iai-mcp-server launcher alongside a context-injection milestone. In v3.3.0, iai-tools ships separately as a console script, an iai-mcp tools subcommand, and an MCP server for code indexing, session events, and command execution without the memory engine.
hits and anti_hits.all-MiniLM-L6-v2; no advantage over mempalace v3.3.6 is shown on that metric.iai brain exposes graph neighborhoods and contradictions; iai-mcp doctor diagnoses setup and prints the legacy-store migration command when applicable.A single developer or researcher who wants searchable, verbatim agent history on one machine, can use host hooks, and needs old and corrected facts to remain distinguishable.
You need shared or cross-device memory, uniform per-turn injection across hosts, or a policy that prohibits plaintext capture buffers and caches.
Quick Start & Installation
curl -fsSL https://raw.githubusercontent.com/CodeAbra/iai-personal-memory-engine/main/scripts/bootstrap.sh | bash
Comparison vs. Top RAG, Data & Memory Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| iai-personal-memory-engine ★ | 925 | +2 | Python | MIT | A local MCP memory engine for verbatim history and contradiction-aware recall |
| Memori | 17.9k | +337 | Python | — | An SDK-based agent memory layer for persistent state across sessions. |
| EverOS | 14k | +41 | Python | Apache-2.0 | Local Markdown and indexes give AI agents portable long-term memory |
| mem0 | 70k | +498 | Python | Apache-2.0 | A vector-backed memory layer for AI agents that need to recall past conversation |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/CodeAbra/iai-personal-memory-engine.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about iai-personal-memory-engine
Does adding the MCP server automatically enable transcript capture and context injection?
memory_recall and memory_contradict. Background transcript capture and automatic context injection are separate integrations: Claude Code supports per-turn updates, Cursor has no per-turn text injection, and OpenClaw uses MCP tools on demand.Do I need a GPU, and how should I size the machine?
Can I deploy it commercially and keep the memory store under my control?
Does it retrieve better than mempalace v3.3.6?
all-MiniLM-L6-v2 embedder, both engines report LongMemEval-S R@5 of 0.966 and R@10 of 0.978, so that comparison does not establish a recall advantage. Evaluate host hooks, historical and contradiction-aware retrieval, and how each engine handles your own transcripts rather than choosing on aggregate recall alone.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