cd /news/ai-agents/ai-memory-persistent-cross-agent-lon… Β· home β€Ί topics β€Ί ai-agents β€Ί article
[ARTICLE Β· art-137437] src=dev.to β†— pub= topic=ai-agents verified=true sentiment=↑ positive

ai-memory: Persistent Cross-Agent Long-Term Memory for Coding CLIs

A developer released ai-memory, an open-source Rust binary that provides vendor-neutral, git-backed long-term memory for more than 20 AI coding harnesses including Claude Code, Cursor, and Codex. The tool captures session observations through native lifecycle hooks, stores them as human-readable markdown files indexed by SQLite FTS5, and passes pending task handoffs between agents via claim-once tokens, all with zero LLM API calls by default. Optional background LLM consolidation and local vector embeddings can be enabled by users.

by read3 min views1 publishedSep 22, 2026

AI coding agents have revolutionized day-to-day software development, but they have introduced a frustrating new bottleneck: agent amnesia.

As developers increasingly juggle multiple coding harnessesβ€”using Claude Code for architecture planning, Cursor for frontend adjustments, and Codex or OpenCode for automated refactorsβ€”they quickly discover that each tool operates in a completely isolated silo:

ai-memory (akitaonrails/ai-memory) was created to break down these walls. Built in Rust as a single, self-contained binary, it provides a vendor-neutral, git-backed long-term memory server that bridges more than 20 AI coding harnesses.

Here is a technical overview of how ai-memory works, its zero-LLM architecture, and how it handles cross-agent handoffs.

Most coding assistants provide some flavor of built-in memory. Claude Code creates local project notes, Cursor maintains workspace indexes, and various plugins offer per-session scratchpads.

However, these implementations share three critical flaws:

ai-memory separates memory management into four distinct, observable stages:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       AI Coding Agent                       β”‚
β”‚    (Claude Code / Cursor / Codex / Antigravity CLI / etc.)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
            [ 1. Capture (Silent Lifecycle Hooks) ]
                               β”‚
                               β–Ό
           [ 2. Consolidate (Git-Backed Markdown) ]
                               β”‚
                               β–Ό
               [ 3. Recall (FTS5 + Entity Search) ]
                               β”‚
                               β–Ό
        [ 4. Cross-Agent Handoff (Typed & Claim-Once) ]

Rather than forcing developers into awkward "please remember this" ceremonies, ai-memory utilizes native agent lifecycle hooks. As you work, sanitized observations (prompts, tool invocations, session milestones) are streamed through a typed privacy boundary.

The central invariant of ai-memory is that the human developer owns the data.

Memory is compiled into an ordinary, git-backed wiki composed of human-readable .md files. You can:

grep or ripgrep. git push or rsync. The underlying database is strictly a derived index (SQLite FTS5) that can be completely wiped and reconstructed from the markdown files at any time.

By default, ai-memory operates with zero LLM API calls.

Capture, indexing, and recall use high-performance full-text search (SQLite FTS5), entity extraction, and link graphs. A developer can run ai-memory completely offline with zero API keys and zero recurring expenses. For users who want it, optional background LLM consolidation and local vector embeddings can be toggled on.

When you terminate a session in Claude Code, ai-memory records where the task halted, which hypotheses failed, and what tasks remain open.

When you launch Codex or Cursor in that same repository, the new agent claims the pending handoff token exactly once, immediately injecting a compact, high-signal brief into the prompt context.

ai-memory provides first-party integration (via MCP server registration, lifecycle hooks, or both) across major platforms:

You can run ai-memory on any workstation using the pre-built Docker container:

docker run -d --name ai-memory \
    --restart unless-stopped \
    -p 127.0.0.1:49374:49374 \
    -v ai-memory-data:/data \
    akitaonrails/ai-memory:latest

To connect ai-memory to Claude Code, simply install the MCP bridge and hooks:

ai-memory install-mcp --client claude-code --apply
ai-memory install-hooks --agent claude-code --apply

Now, any observations, architectural choices, and unresolved debugging questions will automatically persist into your project's local markdown wiki, ready to be retrieved by whichever agent you open next.

ai-memory treats developer memory the way developer tools ought to be built: local-first, transparent, git-versioned, and completely independent of any single model vendor.

By eliminating the cognitive tax of re-explaining systems to every new tool, it makes a multi-agent coding workflow genuinely seamless.

── more in #ai-agents 4 stories Β· sorted by recency
── more on @ai-memory 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/ai-memory-persistent…] indexed:0 read:3min 2026-09-22 Β· β€”