ai-memory: Shared Long-Term Memory for AI Coding Agents
GitHub Repo
MIT
October 18, 2026 at 03:20 PM
0 views

ai-memory: Shared Long-Term Memory for AI Coding Agents

@akitaonrailsProject Author

What ai-memory is

ai-memory is an MIT-licensed, self-hosted long-term memory server for AI coding agents, written in Rust and published under the akitaonrails GitHub account. Its pitch is continuity across tools: quit Claude Code mid-task, start OpenAI Codex in the same directory, and carry on without re-explaining the architecture, the approaches that failed or the questions still open. The README lists more than twenty supported harnesses, including Claude Code, Codex, Cursor, Gemini CLI, OpenCode, GitHub Copilot CLI, Kiro CLI and Factory Droid.

The problem it targets is that the memory features built into individual agents live on one machine, belong to one agent and disappear from view when you switch tools or hand work to a teammate. ai-memory moves that memory into a server you run, on the same laptop, a homelab box or a shared host, so it follows you across agents, projects, machines and people. It is aimed at developers who use more than one coding agent, and at small teams that want what one person's sessions learn to be available to everyone's agents.

How it works

The README summarises the pipeline as capture, consolidate, recall and handoff. Lifecycle hooks installed into each agent record prompts, tool calls and session boundaries, sanitise them at a typed privacy boundary and post them to the server. At session end, observations are compiled into readable markdown pages in the project's wiki, optionally written by an LLM but useful without one. The next session, in any agent on any machine, receives a bounded brief and can search everything. Handoffs between agents are a typed protocol: each has an owner and is claimed exactly once.

One Rust binary runs an MCP and HTTP server and owns a single data directory:

<data_dir>/
├── wiki/    # markdown source of truth, git-versioned
├── raw/     # immutable sanitized managed-workstream transcript segments
├── db/      # SQLite indexes, including FTS5, entities, and embeddings
├── models/  # reserved for local embedding models
└── logs/    # rolling tracing output

The markdown wiki is the source of truth; the SQLite database is a derived index that can be rebuilt from the files. Retrieval fuses full-text search, entity matches and graph neighbours, with optional vector search, into one ranking. Writes are serialised through a single SQLite writer, and the README states a measured write ceiling of about 700 per second.

Key features

  • Cross-agent handoffs: the next agent picks up a handoff saying where you left off, what failed and what is still open.
  • Session carry-over: launching agents with ai-memory run gives the receiving agent a private, temporary local projection of the previous agent's visible native history; the README says the remote server receives only the harness and session identity, not the transcript.
  • Cross-project profile: a small profile of how you usually work, such as package manager and test layout, reaches each new repository as a default below its own rules file. It is on by default for a single user and opt-in, private per person, on a shared server.
  • Zero-LLM default: capture, search and handoffs work with no API key and no LLM calls.
  • Memory ageing without an LLM: memory decays on tunable per-tier schedules, decays more slowly when it is used, and cold notes can be compacted to durable facts. Nothing is hard-deleted; earlier versions remain in git and can be brought back with restore-page.
  • Optional "dream" pass: with an LLM configured, an opt-in background job rewrites clusters of cold notes into single pages while you are idle and never deletes a source. It is off by default.
  • Team mode: multi-user auth, per-person attribution and an audit log are built in; knowledge is shared per project and personal handoffs stay personal.
  • Plain files: the wiki is ordinary .md files that can be grepped, opened in Obsidian, edited by hand or synced with rsync.

Getting started

On Linux and macOS the README's two-command install needs no root:

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

The install script checks the download against the release's published SHA-256 checksum and refuses to install without a match. ai-memory setup creates the data directory with a bearer token in an owner-only file, starts a per-user service (systemd --user or a launchd LaunchAgent), shows a plan of the agents it found and asks before wiring MCP, hooks and Agent Skills into them. On Windows, in PowerShell:

irm https://github.com/akitaonrails/ai-memory/releases/latest/download/install.ps1 | iex
ai-memory setup

Claude Code and Codex users can wire their agent as a marketplace plugin instead, with the binary still installed as above:

claude plugin marketplace add akitaonrails/ai-memory && claude plugin install ai-memory@ai-memory
codex plugin marketplace add akitaonrails/ai-memory && codex plugin add ai-memory@ai-memory

The README recommends starting harnesses through ai-memory run, which installs missing hooks and MCP registration on first use and adds cross-harness session continuity:

ai-memory run claude
ai-memory run codex --yolo   # same workstream + local Claude history dossier
ai-memory continue           # resume the newest managed checkout

Docker, Podman, an AUR package, Fedora RPMs, a NixOS module with a hardened systemd unit and a macOS menu bar app are also documented. With the Docker wrapper, an agent is wired with two commands:

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

Use cases

  • Switching agents mid-task: hit a quota or an abrupt exit in one harness and continue in another with the handoff and, on the same machine, the previous session's history.
  • Several machines: resume on a laptop the project you left on a desktop, with the same knowledge and open questions, by pointing both at one server.
  • Small teams: run one server on a LAN host so that every teammate's agents can retrieve what other sessions learned about a project.
  • Adopting an existing repository: run ai-memory bootstrap once on a project with months of history.
  • Asking about history: questions such as "where did we leave off?", "have we discussed X?" or "catch me up" are answered from the wiki.

How it compares

The README includes its own comparison table. Against fact extractors such as Mem0 and LangMem, it argues for readable pages you own instead of opaque fact rows. Against temporal knowledge graphs such as Zep and Graphiti, it offers typed edges and version-filtered search without a graph database. Against basic-memory, which also treats markdown on disk as the source of truth, it adds automatic lifecycle capture, cross-agent handoffs and multi-user sharing. Against Claude Code's built-in memory, it adds sync across machines and agents and team use, and against hosted memory APIs such as Supermemory it emphasises git-versioned files, offline operation and no required API spend. These are the project's own positioning claims; a longer comparison and a published benchmark are in its docs/comparison.md.

Things to know before adopting

  • Captured content: hooks capture prompts and tool calls by default. Capture is sanitised before storage, and per-repository [capture] rules can exclude paths or switch to allowlist mode; review these before using it on sensitive code.
  • Auth defaults: the server binds to loopback only. Native installs mint a bearer token, but the Docker quick-start runs without authentication, so local processes and browser pages can reach it until you enable a token.
  • One server per data directory: the deployment guide's one hard rule is never to run two servers against the same data directory.
  • Platform support: Linux, macOS, NixOS and Windows via WSL2 are listed as supported; native Windows is experimental. Some harnesses are MCP-only or hooks-only.
  • Toolchain and upgrades: source builds need Rust 1.95 or newer, and the README asks 2.x users to read its upgrade guide before moving to 3.0.
  • Optional providers: LLM consolidation and embeddings can use Anthropic, OpenAI, Gemini, GitHub Copilot or any OpenAI-compatible endpoint such as Ollama, but none is required.

Project activity

As of October 2026 the repository has about 9,900 stars. It was created in May 2026, is written in Rust and is licensed under MIT, with pushes as recent as mid-October 2026. Releases include installers, packages and a Docker image for linux/amd64 and linux/arm64. The project site is aimemory.sh and the source is at github.com/akitaonrails/ai-memory.

Enjoying this project?

Discover more amazing open-source projects on TechLogHub. We curate the best developer tools and projects.

Project
ai-memory-coding-agents
Created
October 18
Last Updated
October 18, 2026 at 03:20 PM

Maintain ai-memory: Shared Long-Term Memory for AI Coding Agents? Add the badge to your README

Show that the project is featured on TechLogHub and send readers to this write-up.

Featured on TechLogHub
[![Featured on TechLogHub](https://techloghub.com/badge-neutral.svg)](https://techloghub.com/open-source/ai-memory-coding-agents?utm_source=techloghub_badge&utm_medium=referral&utm_campaign=readme)

Find more projects like this

One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.