iai-pme logo

iai-pme

Community
CodeAbra

A cyber brain for your AI. It never forgets a detail, remembers exactly what you said, and learns how you work over time. Free, local, works with Cursor, Claude Code, Codex, OpenClaw, Hermes and more. MIT.

PublisherCodeAbra
Repositoryiai-personal-memory-engine
LanguagePython
Forks
110
Stars
893
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    iai-pme exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    893 stars and 110 forks from the linked repository.

English | 中文


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

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

Then run inside Claude Code:

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

Restart the session, then verify:

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

Python 3.11 is also supported.

macOS or Linux: all-in-one source install

bash
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:

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

Other hosts

bash
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-lilli — iai-mcp doctor prints the exact command, and the technical reference documents the full flow.


What happens after installation

EventAction
PromptNew turns are appended to a session buffer as file IO; no embedding or engine RPC is needed on the capture path
Session endRemaining transcript content is rolled over for ingestion; hook failures do not block the host
Session startA bounded memory prefix is exposed as host context; an empty store or unavailable engine yields empty output
Later turnsSupported hosts receive a small foresight or delta pack with age and revision markers
Idle timeCaptures 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

TierContains
EpisodicTimestamped, write-once fragments of what was said
SemanticSummaries induced from related episodes during idle consolidation
ProceduralTen 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

ComponentRole
HippoEncrypted records, vector index, and graph in one local store
MOSAICLeiden-family community detection with stable community identity
Lilli HDHyperdimensional substrate and structural recall
Native engineRust embedder and graph kernels

Dashboard and CLI

bash
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.

text
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.

BenchmarkResult
Rescue@10 after contradiction1.000
Historical-verbatim hit@101.000
LongMemEval-S R@5, product embedder0.962
LongMemEval-S R@10, product embedder0.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

text
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

HostAmbient behaviour
Claude CodeSession-start recall, per-turn updates, turn capture, and session capture
Codex CLIFull integration through Codex hooks
CursorSession-start recall and capture; no per-turn text injection
AntigravityRecall per invocation and lossless transcript capture
Hermes 0.5.0+Recall before model calls and capture from its message store
OpenClawMCP tools on request; no ambient shell hooks
Gemini CLI and other MCP hostsMCP tools; no bundled host-specific hooks unless listed above
Claude DesktopMCP tools; plain Chat does not expose Claude Code-style ambient hooks

Privacy and limitations

  • Records are encrypted at rest with AES-256-GCM. The store and key live under ~/.iai-mcp/; back them up together.
  • macOS and Linux use a Unix socket. Windows uses an ephemeral loopback port with a per-user token.
  • There is no iai-memory account, telemetry pipeline, hosted dashboard, or cross-machine sync.
  • Optional iai-memory network activity is the REM claude -p step and a daily PyPI version check. Set IAI_MCP_VERSION_CHECK=0 to disable the check.
  • The store refuses to mix incompatible embedding generations; changing the embedder requires an explicit migration.
  • Recall is usually mediocre during roughly the first ten sessions, and quality and latency depend on corpus size, language, embedder, and stored history.
  • The default store is English-first. Raw non-English records require an explicit raw:<lang> tag and a multilingual or custom embedder.
  • Windows support is beta. Ambient behaviour varies with host hook support.
  • The project is solo-maintained and has no enterprise SLA.

Health and updates:

bash
iai-mcp doctor          # 38 checks
iai-mcp daemon status
iai-mcp self-update

About the name

IAI — Independent Autistic Intelligence describes the memory design.

  • Independent: the engine, store, embeddings, and dashboard run locally.
  • Autistic: literal preservation, precise cues, sustained focus, and rare events retained as rare rather than smoothed into a typical summary. This is an operational design description, not a diagnosis or casual metaphor.
  • Intelligence: used in the systems sense — a process that observes, 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

Installation

TypingMind
{
  "mcpServers": {
    "iai-personal-memory-engine": {
      "command": "node",
      "args": [
        "{{config.PATH_TO_MCP_WRAPPER_DIST}}/index.js"
      ],
      "env": {
        "PATH_TO_MCP_WRAPPER_DIST": "<PATH_TO_MCP_WRAPPER_DIST>"
      }
    }
  }
}

Use iai-pme MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once iai-pme is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add iai-pme as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the iai-pme MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "iai-personal-memory-engine": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the iai-pme MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the iai-pme MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use iai-pme to help me with this task?
iai-pme
Sure. I read it.
Here is what I found using iai-pme.

Frequently asked questions

What is the iai-pme MCP server used for?

iai-pme is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use iai-pme MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use iai-pme with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use iai-pme MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With iai-pme connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect iai-pme MCP to TypingMind?

iai-pme runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does iai-pme MCP provide in TypingMind?

iai-pme exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use iai-pme MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If iai-pme requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇