CodeAbra/iai-personal-memory-engine

★ 890⑂ 0

A cyber brain for your AI. It never forgets a detail, remembers exactly what you said, and learns how you work over time.

About CodeAbra/iai-personal-memory-engine

CodeAbra/iai-personal-memory-engine is an open-source project on GitHub, mainly written in Python. A cyber brain for your AI. It never forgets a detail, remembers exactly what you said, and learns how you work over time. It currently holds 890 stars and 0 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the AI Agent Memory board.

GitHub Repository Details

Repository CodeAbra/iai-personal-memory-engine · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

English | 中文

https://github.com/CodeAbra/iai-personal-memory-engine/blob/HEAD/iai-memory — a personal memory engine for your AI coding workflow

Keeps every conversation word-for-word and gives your AI agent the right
context on every turn.

https://github.com/CodeAbra/iai-personal-memory-engine/blob/HEAD/iai-memory searching, recalling, pinning, fading, rescuing, and learning a file

https://github.com/CodeAbra/iai-personal-memory-engine/blob/HEAD/iai-memory on PyPI https://github.com/CodeAbra/iai-personal-memory-engine/blob/HEAD/MIT License https://github.com/CodeAbra/iai-personal-memory-engine/blob/HEAD/Python 3.11 or 3.12 https://github.com/CodeAbra/iai-personal-memory-engine/blob/HEAD/macOS and Linux supported https://github.com/CodeAbra/iai-personal-memory-engine/blob/HEAD/Windows beta https://github.com/CodeAbra/iai-personal-memory-engine/blob/HEAD/MCP compatible

https://github.com/CodeAbra/iai-personal-memory-engine/blob/HEAD/Rescue@10 1.000 https://github.com/CodeAbra/iai-personal-memory-engine/blob/HEAD/LongMemEval R@5 0.962 https://github.com/CodeAbra/iai-personal-memory-engine/blob/HEAD/Historical-verbatim hit@10 1.000 https://github.com/CodeAbra/iai-personal-memory-engine/blob/HEAD/AES-256-GCM at rest

Quick start · How it works · Benchmarks · Compatibility · Technical reference

---

What it is

A local server that speaks the MCP protocol and gives Claude, and any other MCP-compatible agent, a long-term memory. It captures every turn of every session verbatim, organizes those captures over time into a personal map of who you are, and serves a small slice of relevant memory back at the start of each new conversation and turn. You never have to say "remember this" or *"what did we say last time?"*.

I built this for myself. It worked. The benchmarks were mostly for my own curiosity.

Under the hood it's not a wrapper around someone else's vector store and graph library — the parts that matter are my own code: the storage engine, the community-detection algorithm, the hyperdimensional memory substrate, and a native engine that makes it fast.

And unlike cloud memory services, there's no API key, no account, and no telemetry: the engine, the store, and the embeddings all run locally. The only things that leave your machine are the normal model calls your CLI already makes, plus one optional nightly consolidation step that asks your model for a single insight through the same subscription your CLI already uses.

---

Quick start

Claude Code

python3.12 -m pip install -U iai-pme

Then run inside Claude Code:

/plugin marketplace add CodeAbra/iai-personal-memory-engine
/plugin install iai-memory@iai-pme

Restart the session, then verify:

iai --version
iai-mcp daemon status
iai-mcp doctor

Python 3.11 is also supported.

macOS or Linux: all-in-one source install

curl -fsSL https://raw.githubusercontent.com/CodeAbra/iai-personal-memory-engine/main/scripts/bootstrap.sh | bash

This builds the Rust engine and TypeScript wrapper, installs the background service and hooks, registers Claude Code, and runs the health check. It requires Git, Python 3.11/3.12, Node.js 18+, and Rust. To inspect the steps without changing anything:

curl -fsSL https://raw.githubusercontent.com/CodeAbra/iai-personal-memory-engine/main/scripts/bootstrap.sh | bash -s -- --dry-run

Other hosts

python3.12 -m pip install -U iai-pme
iai-mcp crypto init
iai-mcp daemon install
iai-mcp capture-hooks install --target codex

Replace codex with cursor, antigravity, hermes, openclaw, or all. MCP tools work with any MCP-over-stdio client; automatic capture and context injection depend on the hooks exposed by the host. See the technical reference.

New stores use the native engine format by default; an existing store keeps its current format on upgrade. To move an existing legacy SQLite store onto the native engine, run iai-mcp migrate-to-lilliiai-mcp doctor prints the exact command, and the technical reference documents the full flow.

---

What happens after installation

| Event | Action | |---|---| | Prompt | New turns are appended to a session buffer as file IO; no embedding or engine RPC is needed on the capture path | | Session end | Remaining transcript content is rolled over for ingestion; hook failures do not block the host | | Session start | A bounded memory prefix is exposed as host context; an empty store or unavailable engine yields empty output | | Later turns | Supported hosts receive a small foresight or delta pack with age and revision markers | | Idle time | Captures are embedded, deduplicated, encrypted, inserted, clustered, consolidated, reinforced, and decayed |

The background process is called the daemon in the CLI. The MCP wrapper and iai can still read the local store directly when it is asleep or temporarily unavailable.

---

How it works

Memory model

| Tier | Contains | |---|---| | Episodic | Timestamped, write-once fragments of what was said | | Semantic | Summaries induced from related episodes during idle consolidation | | Procedural | Ten bounded behavioural parameters learned over time |

Distinct hyperdimensional representations keep literal detail, semantic structure, and behavioural tendencies from collapsing into one vector surface.

The local, LLM-free recall path combines semantic similarity, graph evidence, recency, temporal validity, and lexical evidence. memory_recall returns both hits and anti_hits; memory_contradict closes the old record's validity interval, creates a new record, and links the two.

While idle, the engine groups related episodes, induces semantic memory, reinforces useful paths, and decays weak unreviewed edges. One optional REM step may invoke claude -p through the user's existing Claude subscription, capped at no more than 1% of the daily quota. No Anthropic API key is required.

First-party components

| Component | Role | |---|---| | Hippo | Encrypted records, vector index, and graph in one local store | | MOSAIC | Leiden-family community detection with stable community identity | | Lilli HD | Hyperdimensional substrate and structural recall | | Native engine | Rust embedder and graph kernels |

---

Dashboard and CLI

iai brain

The local dashboard searches the store, exposes graph neighbourhoods and contradictions, pins or fades memories, ingests files, controls the background engine, and reports token-use estimates from your own store.

iai recall · temporal-recall · search · ask · capture · teach · upload
iai watch · brain · status · last

iai upload accepts documents, Office files, e-books, source code, configuration files, and directories. Full formats and administrative commands are listed in docs/REFERENCE.md.

---

Benchmarks

Every harness ships in bench/; methodology and reproduce commands are in BENCHMARKS.md.

| Benchmark | Result | |---|---:| | Rescue@10 after contradiction | 1.000 | | Historical-verbatim hit@10 | 1.000 | | LongMemEval-S R@5, product embedder | 0.962 | | LongMemEval-S R@10, product embedder | 0.978 |

Historical-verbatim retrieval uses a flat-cosine baseline of about 0.71. With the matched all-MiniLM-L6-v2 embedder, iai-memory and mempalace v3.3.6 both score R@5 0.966 and R@10 0.978; no win is claimed.

On the author's store, an automatically injected memory pack averaged about 350 tokens versus about 2,850 tokens for the agent-search round trip it replaced: approximately 88% cheaper on that measured workload. This does not apply to explicit memory_recall, whose default response budget is 1,500 tokens.

---

MCP tools

memory_recall              memory_temporal_recall
memory_recall_structural   memory_search
memory_capture             memory_contradict
memory_reinforce           memory_consolidate
profile_get_set            topology
schema_list                events_query
episodes_recent            curiosity_pending

Fourteen tools cover cue, temporal, structural, and lexical recall; capture and correction; reinforcement and consolidation; behavioural-profile control; and store introspection.

---

Compatibility

| Host | Ambient behaviour | |---|---| | Claude Code | Session-start recall, per-turn updates, turn capture, and session capture | | Codex CLI | Full integration through Codex hooks | | Cursor | Session-start recall and capture; no per-turn text injection | | Antigravity | Recall per invocation and lossless transcript capture | | Hermes 0.5.0+ | Recall before model calls and capture from its message store | | OpenClaw | MCP tools on request; no ambient shell hooks | | Gemini CLI and other MCP hosts | MCP tools; no bundled host-specific hooks unless listed above | | Claude Desktop | MCP tools; plain Chat does not expose Claude Code-style ambient hooks |

---

Privacy and limitations

~/.iai-mcp/; back them up together. with a per-user token. cross-machine sync. PyPI version check. Set IAI_MCP_VERSION_CHECK=0 to disable the check. embedder requires an explicit migration. and latency depend on corpus size, language, embedder, and stored history. explicit raw: tag and a multilingual or custom embedder. Health and updates:
iai-mcp doctor          # 38 checks
iai-mcp daemon status
iai-mcp self-update

---

About the name

IAI — Independent Autistic Intelligence describes the memory design.

events retained as rare rather than smoothed into a typical summary. This is an operational design description, not a diagnosis or casual metaphor. adapts, reorganizes itself, and remains viable over time.

“Personal memory engine” describes the scope: one person's memory, on one machine, used by the assistant they already have.

---

Documentation

Issues and pull requests are welcome. Changes to retrieval, capture, contradiction handling, or consolidation should include relevant benchmark reruns.

Authors

By Areg Aramovich Noya and Lilli Noya, in collaboration with the team at lcgc.dev.

License

MIT

GitHub Stars & Activity

890Stars
0Forks
0Open issues
PythonLanguage

GitHub Popularity

GitHub stars890
Forks0
Open issues0
Primary languagePython
License-
Stars gained today0
Created-
Last pushed-

Trending History

Trending statusnot on today's boards

Related AI Projects

1

666ghj / MiroFish

Python★ 74,064⑂ 0
2

mem0ai / mem0

Python★ 65,695⑂ 0
3

bojieli / ai-agent-book

Python★ 48,844⑂ 0
4

volcengine / OpenViking

Python★ 38,148⑂ 0
5

topoteretes / cognee

Python★ 30,855⑂ 0
6

MemoriLabs / Memori

Python★ 16,849⑂ 0
7

NevaMind-AI / memU

Python★ 14,418⑂ 0
8

semantica-agi / semantica

Python★ 13,301⑂ 0

More AI Rankings