ai-memory: Cross-Agent Memory for AI Coding Agents (12k Stars, Rust, Zero LLM)

The article analyzes ai-memory, a Rust-based cross-agent memory system that lets AI coding agents like Claude Code, Codex, and Cursor share long-term project knowledge across tools, machines, and teams using markdown files and Git, with zero LLM calls by default.

Architecture Digest
Architecture Digest
Architecture Digest
ai-memory: Cross-Agent Memory for AI Coding Agents (12k Stars, Rust, Zero LLM)

Problem: Memory Silos Across AI Coding Agents

Teams using multiple AI coding agents (Claude Code, Codex, Cursor, Gemini CLI, OpenCode, Kimi, Kiro, Zed, Copilot CLI, etc.) face a structural problem: each agent stores its memory locally, so context — project architecture, known issues, unfinished tasks — does not transfer when switching tools, machines, or users. The author observed this pain point at an offline AI coding event where many team leads reported the same frustration.

Solution: ai-memory — A Cross-Agent, Cross-Machine, Cross-Project Memory Layer

ai-memory (GitHub: https://github.com/akitaonrails/ai-memory, ~12k stars) is a single Rust binary that runs an MCP/HTTP server and provides a shared, versioned memory layer. Its core differentiators:

Cross-agent: 20+ agents consume the same memory via a typed handoff protocol; each memory entry has an owner and is claimed only once, preventing conflicts.

Cross-machine & cross-project: The server can be hosted centrally (Docker, NixOS, systemd, etc.). A cross-project profile carries team conventions (package manager, test layout, architectural preferences) into every new repository.

Cross-user: Multi-user auth, OIDC SSO, and audit logs are built-in; project knowledge is shared while personal handoffs stay private.

Zero LLM by default: Capture, consolidation, search, and handoff run entirely offline — no API key required. LLM-powered features (semantic vector search, "dream" cold-note synthesis) are opt-in enhancements.

Architecture & Data Flow

The server owns a single data directory with three subdirectories:

wiki/ — Source of truth: Git-versioned plain Markdown files (grep-able, openable in Obsidian, rsync-able).

db/ — Derived indexes: SQLite with FTS5 full-text search, entity extraction, and graph-neighbor RRF (Reciprocal Rank Fusion) retrieval; optional vector index.

raw/ — Immutable, redacted raw session fragments.

Data flows through four lifecycle hooks: capture → consolidate → recall → handoff. Hooks silently record prompts and tool calls; at session end they compile readable Markdown pages. The next session (any agent, any machine) receives a briefing and can full-text search the entire history.

ai-memory architecture diagram showing wiki, db, raw directories and data flow
ai-memory architecture diagram showing wiki, db, raw directories and data flow

Key Design Decisions

Markdown as source of truth — not a vector store. The database is a rebuildable derived index; no binary blobs lock the content.

Offline memory aging — decay, compression, deduplication, and contradiction flagging run without any LLM calls. Used memories decay slower; opening, searching, or linking counts as usage.

Dream is opt-in — LLM synthesis of cold notes into coherent pages must be explicitly enabled; it is not a default crippled feature.

Installation & Configuration

Single-User (Linux/macOS)

curl -fsSL https://github.com/akitaonrails/ai-memory/releases/latest/download/install.sh | sh
ai-memory setup

The installer verifies SHA-256 checksums (aborts on mismatch). ai-memory setup creates the data directory, starts a user-level service, and attaches MCP + hooks to detected agents.

Team / Cross-Machine (Docker)

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

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

Then launch agents with ai-memory run claude or ai-memory run codex. Supported platforms: Linux, macOS, NixOS, WSL2; native Windows is experimental.

Read-Only Web UI

ai-memory serve --enable-web

starts a browser interface to browse wiki pages, project lists, and project details.

Web UI showing project list
Web UI showing project list
Web UI showing memory pages for a single project
Web UI showing memory pages for a single project

Team Adoption

Deployment: NixOS module (systemd sandbox), Arch AUR, Fedora RPM, multi-arch Docker images. One command wires every developer's agents.

Pipeline integration: MCP bridge and lifecycle hooks plug into existing agent CLIs without tool lock-in. Cross-project profiles propagate team defaults to new repos.

Policy customization: ignore_paths and allowlists redact sensitive data at ingest. Multi-user auth, OIDC SSO, and per-mutation audit logs are included.

Caveats & Trade-offs

Community size: ~12k stars vs. claude-mem (102k), mem0 (67.5k), cognee (32.6k) — ecosystem and community depth are still shallow.

Advanced features require opt-in: LLM synthesis, semantic vector search, and dream are disabled by default; enabling them needs an LLM and embedding provider.

Infrastructure, not a toy: It solves the structural memory-fragmentation problem; value appears after experiencing the pain of context loss, not as an instant "smarter" feeling.

Security defaults: Docker quick-start binds to loopback without auth (no token unless init runs). Production must add tokens, multi-user, and TLS manually.

Author's Take

ai-memory's clarity lies in refusing to compete on memory granularity and instead fixing the ownership fracture: why must memory belong to a single agent? The combination of cross-agent/machine/project + zero-LLM default demotes memory from "another LLM feature" to controllable infrastructure.

However, clarity ≠ zero barrier. It benchmarks against larger players (mem0, cognee) with deeper community roots. The markdown + zero-LLM advantage is invisible to users who just want drop-in intelligence. Real value emerges after you've been burned by tool-switching amnesia.

Recommendation: If your team mixes multiple agents or you personally switch tools/machines often, this Rust single-binary deserves a spot on your shortlist — especially for data sovereignty and zero API overhead. If you're a single-user, single-agent setup chasing out-of-the-box smarts, it may not beat built-in memory; don't let the cross-agent concept hype you.

GitHub repository: https://github.com/akitaonrails/ai-memory
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

MCPRustGitmarkdownai-memoryAI coding agentscross-agent memoryzero LLM
Architecture Digest
Written by

Architecture Digest

Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.