akitaonrails/ai-memoryPublic

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

AI summary: A unified long-term memory layer that persists context across different AI coding agents and development environments.

Stars
6.5K
+160 today
Forks
444
Watchers
41
Open issues
7
Open PRs
5
Contributors
~86
Commits
1.7K
Branches
3

RustMITCreated May 21, 2026Last push todayLatest release v2.1.1+1K stars this week+3.8K this month

Star history

since May 17, 2026
02K4K6KMay 2026Jun 2026Aug 2026Sep 2026
6.5K stars as of Sep 10, 2026, tracked back to May 17, 2026. Historical curve reconstructed from public GitHub event archives, calibrated to the current total.

Contribution activity

commits per day, last 52 weeks
SepOctNovDecJanFebMarAprMayJunJulAugSepMonWedFri2025-09-14: 0 commits2025-09-15: 0 commits2025-09-16: 0 commits2025-09-17: 0 commits2025-09-18: 0 commits2025-09-19: 0 commits2025-09-20: 0 commits2025-09-21: 0 commits2025-09-22: 0 commits2025-09-23: 0 commits2025-09-24: 0 commits2025-09-25: 0 commits2025-09-26: 0 commits2025-09-27: 0 commits2025-09-28: 0 commits2025-09-29: 0 commits2025-09-30: 0 commits2025-10-01: 0 commits2025-10-02: 0 commits2025-10-03: 0 commits2025-10-04: 0 commits2025-10-05: 0 commits2025-10-06: 0 commits2025-10-07: 0 commits2025-10-08: 0 commits2025-10-09: 0 commits2025-10-10: 0 commits2025-10-11: 0 commits2025-10-12: 0 commits2025-10-13: 0 commits2025-10-14: 0 commits2025-10-15: 0 commits2025-10-16: 0 commits2025-10-17: 0 commits2025-10-18: 0 commits2025-10-19: 0 commits2025-10-20: 0 commits2025-10-21: 0 commits2025-10-22: 0 commits2025-10-23: 0 commits2025-10-24: 0 commits2025-10-25: 0 commits2025-10-26: 0 commits2025-10-27: 0 commits2025-10-28: 0 commits2025-10-29: 0 commits2025-10-30: 0 commits2025-10-31: 0 commits2025-11-01: 0 commits2025-11-02: 0 commits2025-11-03: 0 commits2025-11-04: 0 commits2025-11-05: 0 commits2025-11-06: 0 commits2025-11-07: 0 commits2025-11-08: 0 commits2025-11-09: 0 commits2025-11-10: 0 commits2025-11-11: 0 commits2025-11-12: 0 commits2025-11-13: 0 commits2025-11-14: 0 commits2025-11-15: 0 commits2025-11-16: 0 commits2025-11-17: 0 commits2025-11-18: 0 commits2025-11-19: 0 commits2025-11-20: 0 commits2025-11-21: 0 commits2025-11-22: 0 commits2025-11-23: 0 commits2025-11-24: 0 commits2025-11-25: 0 commits2025-11-26: 0 commits2025-11-27: 0 commits2025-11-28: 0 commits2025-11-29: 0 commits2025-11-30: 0 commits2025-12-01: 0 commits2025-12-02: 0 commits2025-12-03: 0 commits2025-12-04: 0 commits2025-12-05: 0 commits2025-12-06: 0 commits2025-12-07: 0 commits2025-12-08: 0 commits2025-12-09: 0 commits2025-12-10: 0 commits2025-12-11: 0 commits2025-12-12: 0 commits2025-12-13: 0 commits2025-12-14: 0 commits2025-12-15: 0 commits2025-12-16: 0 commits2025-12-17: 0 commits2025-12-18: 0 commits2025-12-19: 0 commits2025-12-20: 0 commits2025-12-21: 0 commits2025-12-22: 0 commits2025-12-23: 0 commits2025-12-24: 0 commits2025-12-25: 0 commits2025-12-26: 0 commits2025-12-27: 0 commits2025-12-28: 0 commits2025-12-29: 0 commits2025-12-30: 0 commits2025-12-31: 0 commits2026-01-01: 0 commits2026-01-02: 0 commits2026-01-03: 0 commits2026-01-04: 0 commits2026-01-05: 0 commits2026-01-06: 0 commits2026-01-07: 0 commits2026-01-08: 0 commits2026-01-09: 0 commits2026-01-10: 0 commits2026-01-11: 0 commits2026-01-12: 0 commits2026-01-13: 0 commits2026-01-14: 0 commits2026-01-15: 0 commits2026-01-16: 0 commits2026-01-17: 0 commits2026-01-18: 0 commits2026-01-19: 0 commits2026-01-20: 0 commits2026-01-21: 0 commits2026-01-22: 0 commits2026-01-23: 0 commits2026-01-24: 0 commits2026-01-25: 0 commits2026-01-26: 0 commits2026-01-27: 0 commits2026-01-28: 0 commits2026-01-29: 0 commits2026-01-30: 0 commits2026-01-31: 0 commits2026-02-01: 0 commits2026-02-02: 0 commits2026-02-03: 0 commits2026-02-04: 0 commits2026-02-05: 0 commits2026-02-06: 0 commits2026-02-07: 0 commits2026-02-08: 0 commits2026-02-09: 0 commits2026-02-10: 0 commits2026-02-11: 0 commits2026-02-12: 0 commits2026-02-13: 0 commits2026-02-14: 0 commits2026-02-15: 0 commits2026-02-16: 0 commits2026-02-17: 0 commits2026-02-18: 0 commits2026-02-19: 0 commits2026-02-20: 0 commits2026-02-21: 0 commits2026-02-22: 0 commits2026-02-23: 0 commits2026-02-24: 0 commits2026-02-25: 0 commits2026-02-26: 0 commits2026-02-27: 0 commits2026-02-28: 0 commits2026-03-01: 0 commits2026-03-02: 0 commits2026-03-03: 0 commits2026-03-04: 0 commits2026-03-05: 0 commits2026-03-06: 0 commits2026-03-07: 0 commits2026-03-08: 0 commits2026-03-09: 0 commits2026-03-10: 0 commits2026-03-11: 0 commits2026-03-12: 0 commits2026-03-13: 0 commits2026-03-14: 0 commits2026-03-15: 0 commits2026-03-16: 0 commits2026-03-17: 0 commits2026-03-18: 0 commits2026-03-19: 0 commits2026-03-20: 0 commits2026-03-21: 0 commits2026-03-22: 0 commits2026-03-23: 0 commits2026-03-24: 0 commits2026-03-25: 0 commits2026-03-26: 0 commits2026-03-27: 0 commits2026-03-28: 0 commits2026-03-29: 0 commits2026-03-30: 0 commits2026-03-31: 0 commits2026-04-01: 0 commits2026-04-02: 0 commits2026-04-03: 0 commits2026-04-04: 0 commits2026-04-05: 0 commits2026-04-06: 0 commits2026-04-07: 0 commits2026-04-08: 0 commits2026-04-09: 0 commits2026-04-10: 0 commits2026-04-11: 0 commits2026-04-12: 0 commits2026-04-13: 0 commits2026-04-14: 0 commits2026-04-15: 0 commits2026-04-16: 0 commits2026-04-17: 0 commits2026-04-18: 0 commits2026-04-19: 0 commits2026-04-20: 0 commits2026-04-21: 0 commits2026-04-22: 0 commits2026-04-23: 0 commits2026-04-24: 0 commits2026-04-25: 0 commits2026-04-26: 0 commits2026-04-27: 0 commits2026-04-28: 0 commits2026-04-29: 0 commits2026-04-30: 0 commits2026-05-01: 0 commits2026-05-02: 0 commits2026-05-03: 0 commits2026-05-04: 0 commits2026-05-05: 0 commits2026-05-06: 0 commits2026-05-07: 0 commits2026-05-08: 0 commits2026-05-09: 0 commits2026-05-10: 0 commits2026-05-11: 0 commits2026-05-12: 0 commits2026-05-13: 0 commits2026-05-14: 0 commits2026-05-15: 0 commits2026-05-16: 0 commits2026-05-17: 0 commits2026-05-18: 0 commits2026-05-19: 0 commits2026-05-20: 0 commits2026-05-21: 10 commits2026-05-22: 43 commits2026-05-23: 43 commits2026-05-24: 34 commits2026-05-25: 47 commits2026-05-26: 31 commits2026-05-27: 23 commits2026-05-28: 19 commits2026-05-29: 17 commits2026-05-30: 19 commits2026-05-31: 5 commits2026-06-01: 13 commits2026-06-02: 28 commits2026-06-03: 4 commits2026-06-04: 12 commits2026-06-05: 6 commits2026-06-06: 18 commits2026-06-07: 0 commits2026-06-08: 4 commits2026-06-09: 0 commits2026-06-10: 0 commits2026-06-11: 11 commits2026-06-12: 8 commits2026-06-13: 3 commits2026-06-14: 13 commits2026-06-15: 19 commits2026-06-16: 6 commits2026-06-17: 17 commits2026-06-18: 6 commits2026-06-19: 4 commits2026-06-20: 9 commits2026-06-21: 8 commits2026-06-22: 7 commits2026-06-23: 6 commits2026-06-24: 16 commits2026-06-25: 0 commits2026-06-26: 17 commits2026-06-27: 0 commits2026-06-28: 2 commits2026-06-29: 2 commits2026-06-30: 3 commits2026-07-01: 11 commits2026-07-02: 14 commits2026-07-03: 2 commits2026-07-04: 3 commits2026-07-05: 1 commit2026-07-06: 1 commit2026-07-07: 3 commits2026-07-08: 2 commits2026-07-09: 10 commits2026-07-10: 20 commits2026-07-11: 9 commits2026-07-12: 7 commits2026-07-13: 15 commits2026-07-14: 4 commits2026-07-15: 7 commits2026-07-16: 0 commits2026-07-17: 4 commits2026-07-18: 5 commits2026-07-19: 12 commits2026-07-20: 10 commits2026-07-21: 16 commits2026-07-22: 16 commits2026-07-23: 19 commits2026-07-24: 6 commits2026-07-25: 17 commits2026-07-26: 3 commits2026-07-27: 29 commits2026-07-28: 5 commits2026-07-29: 13 commits2026-07-30: 31 commits2026-07-31: 9 commits2026-08-01: 16 commits2026-08-02: 2 commits2026-08-03: 8 commits2026-08-04: 15 commits2026-08-05: 5 commits2026-08-06: 7 commits2026-08-07: 8 commits2026-08-08: 0 commits2026-08-09: 1 commit2026-08-10: 0 commits2026-08-11: 2 commits2026-08-12: 4 commits2026-08-13: 1 commit2026-08-14: 5 commits2026-08-15: 7 commits2026-08-16: 14 commits2026-08-17: 7 commits2026-08-18: 14 commits2026-08-19: 18 commits2026-08-20: 2 commits2026-08-21: 11 commits2026-08-22: 6 commits2026-08-23: 7 commits2026-08-24: 9 commits2026-08-25: 9 commits2026-08-26: 6 commits2026-08-27: 3 commits2026-08-28: 20 commits2026-08-29: 5 commits2026-08-30: 6 commits2026-08-31: 19 commits2026-09-01: 54 commits2026-09-02: 19 commits2026-09-03: 36 commits2026-09-04: 18 commits2026-09-05: 10 commits2026-09-06: 9 commits2026-09-07: 10 commits2026-09-08: 2 commits2026-09-09: 0 commits2026-09-10: 0 commits2026-09-11: 0 commits2026-09-12: 0 commits
1,232 commits in the last yearLessMore

Signals and awards

derived from tracked data
  • Breakout launch

    6,456 stars in 112 days

  • Rising fast

    +1,027 stars this week

  • Very active

    1,232 commits in 52 weeks

  • Well documented

    High community health score

  • Permissive license

    MIT

  • Continuous integration

    Automated checks passing

  • Repeat trending

    23 trending appearances

What ai-memory does

AI-memory provides a centralized repository for storing the context, decisions, and architectural notes generated during AI coding sessions. Instead of losing history when switching between tools like Claude Code, Cursor, or Codex, this tool quietly observes and captures information across more than twenty supported agent harnesses. It consolidates session data into human-readable wiki pages upon completion. When a new agent is launched in the same directory, it retrieves this shared memory through search and brief context injection. This ensures continuity in complex projects without requiring developers to repeatedly re-explain architectures or past failures.

This tool is intended for developers and teams who utilize multiple AI coding assistants and struggle with context fragmentation. It is ideal for those managing complex, long-running projects where architectural decisions need to be reliably communicated across different tools.

  • Cross agent compatibility: Supports seamless integration with over twenty different AI tools including Claude Code, Cursor, and Devin.
  • Silent observation: Hooks into existing workflows to capture context quietly without disrupting the user experience.
  • Wiki compilation: Consolidates captured session data into easily readable wiki pages when a coding task ends.
  • Context injection: Automatically provides necessary background information to new agents starting in a shared directory.
  • Shared memory pool: Centralizes data so multiple tools and teammates can access the same historical context.

Where teams use it

Maintaining project continuity

Ensure that context is not lost when switching from a terminal-based agent to a full IDE integration mid-task.

Onboarding new AI tools

Start using a completely different AI model on an existing codebase without having to explain the entire architecture from scratch.

Documenting failed approaches

Prevent different agents from attempting the same incorrect solution by persisting a record of previous debugging efforts.

Collaborative agent workflows

Allow multiple AI assistants to build upon the work of one another within the same directory.

Getting started: capture ──▶ consolidate ──▶ recall ──▶ handoff hooks session-end search next agent, observe summaries as + brief any harness silently wiki pages injection

README

main branch

ai-memory

Long-term memory for AI coding agents. Quit Claude Code mid-task, start OpenAI Codex in the same directory, continue without re-explaining the architecture, the failed approaches, or the open questions.

Release Rust License

Why ai-memory

Your coding agent already has a memory feature. Claude Code takes its own notes, Cursor remembers some things, and every platform is adding more. All of them share the same walls: the notes live on one machine, belong to one agent, and vanish from view the moment you switch tools — or teammates.

ai-memory is what's on the other side of those walls.

  • It follows you across agents. Twenty-plus harnesses — Claude Code, Codex, Cursor, Gemini CLI, OpenCode, Grok, Devin, Kimi, Kiro, and more — feed one shared memory. Quit Claude Code mid-task, open Codex in the same directory, and the next agent picks up a real handoff: where you left off, what failed, what's still open. Handoffs are a protocol here, not a convention — typed, owned, claimed exactly once.

  • It follows you across machines. Memory lives in a server you run — on the same laptop, a homelab box, or wherever — so the project you left on the desktop is the project you resume on the laptop. Same knowledge, same open questions.

  • It works for a team. Point everyone at one server and what one person's sessions learn, everyone's agents can retrieve. Knowledge is shared per project; personal handoffs stay personal. Multi-user auth, per-person attribution, and an audit log are built in — not a paid tier.

  • Your memory is plain markdown. The source of truth is a git-backed wiki of ordinary .md files: grep it, open it in Obsidian, edit it by hand, rsync it. The database is a derived index that can always be rebuilt from the files. No vector store to babysit, nothing held hostage in a binary blob.

  • It captures the work itself, silently. Lifecycle hooks record what actually happened — prompts, tool calls, session boundaries — sanitized at a typed privacy boundary before anything is stored, then consolidated into readable pages. No "remember this" ceremony. And the default path uses zero LLM calls: capture, search, and handoffs all work with no API key at all.

  • It tells you the truth about itself. One self-contained binary. Purge commands that say exactly what "deleted" means. A measured write ceiling (~700/s) instead of a guessed one. An audit log of every mutation. Boring, in the way infrastructure should be.

How it works

capture ──▶ consolidate ──▶ recall ──▶ handoff
 hooks        session-end      search     next agent,
 observe      summaries as     + brief    any harness
 silently     wiki pages       injection

Agents emit sanitized observations through lifecycle hooks as you work. At session end, observations become coherent markdown pages in the project's wiki (optionally LLM-written; useful even without). The next session — any agent, any machine — gets a bounded brief and can search everything: full-text, entities, links, and (optionally) vectors, fused into one ranking. Cross-agent handoffs carry the baton explicitly.

The full design, including the invariants that keep multi-user and multi-session use safe, is in docs/ARCHITECTURE.md.

Support matrix

Every row below is a first-party integration — MCP registration, lifecycle hooks, or both — kept honest by CI. The full matrix with per-agent notes and caveats is in docs/support-matrix.md.

Area Status
Linux Supported
macOS Supported
Windows via WSL2 Supported
Native Windows Experimental
Claude Code Supported
Codex Supported
Command Code Supported
Devin CLI Supported
OpenCode Supported
OpenCode 2 (opencode2 beta) Supported
Cursor Supported
Gemini CLI Supported
Oh My Pi / OMP Supported
Pi Supported
Crush Managed-only
Managed workstreams Opt-in
Claude Desktop MCP-only
OpenClaw Supported
Antigravity CLI Supported
Grok Build CLI Supported
Swival CLI MCP-only
Zero Supported
ZCode Supported
Kimi Code Supported
Kiro CLI Supported
Pool Hooks-only
VS Code Copilot MCP-only
Zed MCP-only
Hermes Agent Community
LLM/auth providers Supported
Embedding providers Supported

Quick start

Arch Linux (AUR)

For native Arch installs, use the AUR packages. They install /usr/bin/ai-memory, packaged hook sources, and both system-level and user-level systemd units.

yay -S ai-memory-bin    # prebuilt Linux x86_64/aarch64 binary
yay -S ai-memory        # builds from source

Single-user workstation:

mkdir -p ~/.config/ai-memory ~/.local/share/ai-memory
ai-memory --data-dir ~/.local/share/ai-memory \
  --config ~/.config/ai-memory/config.toml init
systemctl --user enable --now ai-memory.service
ai-memory install-mcp --client claude-code --apply
ai-memory install-hooks --agent claude-code --apply

System service installs use /var/lib/ai-memory and /etc/ai-memory/ via the packaged unit. Full user-service, system-service, auth, and provider setup is in docs/install.md#arch-linux-native-packages-aur.

Docker

You need: Docker or Podman + an agent CLI from the Support Matrix, or anything else that speaks MCP.

The published Docker image includes linux/amd64 and linux/arm64 variants, so Apple Silicon Macs and ARM64 Linux hosts can pull akitaonrails/ai-memory without --platform linux/amd64 emulation.

The default quick-start has no authentication - the server binds to loopback only, so on a single-user laptop nothing else can reach it. Adding a bearer token is a one-line change once you're ready to expose the server on the LAN; see Security below.

# 1. Install the ai-memory CLI wrapper (a small shell script that
#    runs the binary inside a container with your $HOME mounted). This is
#    the only thing that needs to live on the host filesystem.
mkdir -p ~/.local/bin
wrapper_tmp="$(mktemp -d)"
trap 'rm -rf "$wrapper_tmp"' EXIT
wrapper_base=https://github.com/akitaonrails/ai-memory/releases/latest/download/ai-memory-wrapper
curl -fsSL "$wrapper_base" -o "$wrapper_tmp/ai-memory-wrapper"
curl -fsSL "$wrapper_base.sha256" -o "$wrapper_tmp/ai-memory-wrapper.sha256"
expected="$(awk 'NR == 1 { print $1 }' "$wrapper_tmp/ai-memory-wrapper.sha256")"
if command -v sha256sum >/dev/null 2>&1; then
    actual="$(sha256sum "$wrapper_tmp/ai-memory-wrapper" | awk '{ print $1 }')"
else
    actual="$(shasum -a 256 "$wrapper_tmp/ai-memory-wrapper" | awk '{ print $1 }')"
fi
[ -n "$expected" ] && [ "$actual" = "$expected" ] || { echo "wrapper checksum mismatch" >&2; exit 1; }
install -m 0755 "$wrapper_tmp/ai-memory-wrapper" ~/.local/bin/ai-memory
rm -rf "$wrapper_tmp"
trap - EXIT
# Most distros put ~/.local/bin on PATH automatically. If `which
# ai-memory` comes up empty, add this to ~/.bashrc / ~/.zshrc:
#     export PATH="$HOME/.local/bin:$PATH"

# 2. Start the server. `--restart unless-stopped` makes it come back
#    on docker daemon restart and on machine boot (provided your
#    docker service is enabled at boot — `sudo systemctl enable
#    docker` on most distros). Loopback-only bind (`127.0.0.1:49374`)
#    so nothing outside this machine can reach it. Omit the LLM /
#    EMBEDDING lines for zero-LLM mode — FTS5 search still works
#    without any keys.
docker run -d --name ai-memory \
    --restart unless-stopped \
    -p 127.0.0.1:49374:49374 \
    -v ai-memory-data:/data \
    -e AI_MEMORY_LLM_PROVIDER=anthropic \
    -e ANTHROPIC_API_KEY=sk-ant-... \
    -e AI_MEMORY_EMBEDDING_PROVIDER=openai \
    -e OPENAI_API_KEY=sk-... \
    docker.io/akitaonrails/ai-memory:latest

# 3. Wire your agent CLI in two commands. The wrapper takes care of
#    mounts and each client's config-path detection. Re-run with
#    `--agent codex`, `--agent command-code`, `--agent devin`, `--agent opencode`, `--agent opencode2`, `--agent gemini-cli`,
#    `--agent grok`, `--agent kimi-code`, `--agent kiro-cli`, `--agent omp`,
#    `--agent oh-my-pi`, `--client cursor`,
#    `--client gemini-cli`, `--client grok`, `--client kiro-cli`, etc.
#    for additional agents; full list in docs/install.md.
ai-memory install-mcp   --client claude-code --apply
ai-memory install-hooks --agent  claude-code --apply

The examples use docker; replace it with podman on a Podman host. The wrapper automatically uses Podman when Docker is not installed. Set AI_MEMORY_DOCKER=podman to force Podman when both engines are available.

On Linux/macOS, that's it. Start a Claude Code session as usual - every prompt and tool call now lands in ai-memory, and the next session you open in this project will see a handoff with where you left off. On macOS, the native release binary is also supported and recommended when you do not need Docker; see docs/macos.md.

Wiring another agent is the same two commands with a different name — --client codex, --agent codex, and so on for every row of the support matrix. The full per-agent guide, including Windows and remote servers, is docs/install.md.

Two agents in the same project at once, or teammates on one server? That works out of the box: the "current project" pointer is isolated per caller by default (v1.39+). See docs/auto-scope.md for the optional session-aware Claude Code bridge and the details.

Managed workstreams are optional and add cross-harness session continuity on top of shared memory:

ai-memory run claude
ai-memory run codex --yolo   # later: same workstream, different harness
ai-memory continue           # resume the newest managed checkout

ai-memory uninstall --apply removes everything ai-memory installed, and only what it installed. Install commands are idempotent and write timestamped backups next to any file they touch.

Everyday use

Day to day, you mostly do not think about ai-memory. Hooks capture prompts, tool calls, and session boundaries; session end turns them into readable wiki pages; the next session starts with a handoff.

  • Ask "where did we leave off?" to continue from the pending handoff.
  • Ask "have we discussed X?" or "search memory for Y" to query the wiki.
  • Ask "catch me up" for a prose digest of recent project activity.
  • Run ai-memory bootstrap once when adopting an existing project with months of history.
  • Start the server with --enable-web for a read-only browser view of the wiki and a JSON API under /api/v1.

The full tour — search modes, entities, feedback, briefings, the web API — is in docs/usage.md and docs/use-cases.md.

Teams and multiple machines

Run the server somewhere reachable — a homelab box, a LAN host — and point every machine and every teammate at it. Knowledge is shared per project; personal handoffs stay personal; every write is attributed and audited. Multi-user auth (passwords, API credentials) is built in.

Start with docs/users.md for accounts and ownership, and docs/deploy.md for the server itself — including capacity numbers measured rather than guessed, and the one rule that matters: one server per data directory, never two.

Security

The quick-start default is loopback-only with no auth — nothing outside your machine can reach it. From there, hardening is incremental: a bearer token for the LAN, per-user accounts, OIDC device auth for hooks, TLS via a reverse proxy. Capture is sanitized at a typed privacy boundary before anything is stored, and per-repository [capture] rules can exclude paths or invert to allowlist mode.

The full model is in docs/security.md, docs/users.md, and docs/https-via-proxy.md.

LLM providers

Optional. Everything works with zero LLM calls; adding a provider upgrades session summaries and enables semantic search. Anthropic, OpenAI (incl. OAuth/Codex), GitHub Copilot, Gemini, OpenCode (Go and Zen), and any OpenAI-compatible endpoint (Ollama, LM Studio, vLLM) are supported for consolidation; OpenAI, Voyage, Gemini, and keyless OpenAI-compatible endpoints for embeddings. Configuration lives in docs/llm-providers.md.

Architecture

One Rust binary runs an MCP/HTTP server and owns one 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

Hooks POST observations to the server. The server serializes writes through one SQLite writer, compiles session observations into markdown pages, and serves retrieval through FTS5, entity-match and graph-neighbor RRF, optional vector RRF, bounded source-authority adjustment, and bounded raw-observation fallback for non-global searches.

See docs/ARCHITECTURE.md for the data-flow diagram, crate breakdown, schema notes, and invariants.

Docs

File What it is
docs/install.md Installation cookbook. Every agent CLI, every alternative (curl, source build, no-docker, no-auth), and the server-on-a-different-machine (homelab/LAN) walkthrough. Read after the Quick start if your setup doesn't match the happy path.
docs/usage.md Handoffs, proactive memory queries, slim routing snippet + managed Agent Skills, migration from other memory tools, web UI, raw-wiki inspection, and rules-vs-facts workflow.
docs/managed-workstreams.md Optional ai-memory run continuity across Claude Code, Codex, OpenCode, OpenCode 2 beta, Pi, Crush, Kimi Code, Command Code, Kiro CLI v2/v3, OMP, Grok Build CLI, and Antigravity CLI: automatic harness selection, native resume, argument forwarding, ledger search, privacy, and recovery.
docs/managed-harness-contributions.md Protocol and acceptance bar for contributors adding managed resume, read-only transcript import, and startup context delivery to another harness.
docs/marker-file.md .ai-memory.toml workspace/project routing for multi-client trees, mono-repos, worktrees, and work/personal separation.
docs/auto-scope.md [auto_scope] modes for shared servers: default single-slot routing, session-aware isolation, and multi-user per_actor behavior.
docs/macos.md macOS install paths: native release binary (recommended), source build, the Docker wrapper, hook-platform notes, and current macOS limitations.
docs/windows.md Windows install modes: full WSL2, native Windows with Docker Desktop, prebuilt native release zip, native source builds, and current hook/MCP harness caveats.
docs/mcp-install.md Per-client MCP and lifecycle notes, handoff-injection limits, and community bridge guidance.
docs/deploy.md Homelab deploy: bin/deploy, bearer-token auth, pointers to the TLS guide.
docs/users.md Multi-user attribution and human login. Four-rung bearer ladder, password sessions, ai-memory user / api-key walkthrough, brownfield aim_ migration.
docs/https-via-proxy.md HTTPS via a reverse proxy. When you need TLS (multi-user, non-loopback) and when you don't (loopback / stdio). Copy-paste docker compose templates for Caddy + Let's Encrypt, Caddy + internal CA (LAN-only), Cloudflare Tunnel (no open ports), and external cert files; plus native-Caddy + nginx recipes. The "thinking you're secure when you're not" failure modes explicitly called out.
docs/lifecycle-ops.md Read before running purge / rename / backup / restore / reset / reindex / restore-page. Safety matrix for state-touching commands, per-project disk layout (how isolation actually works), checkpoint-based page recovery, and operator workflows for "fresh start", "snapshot before risky op", "drop one project", and rebuilding SQLite from wiki files.
docs/auto-improvement-loop.md Auto-improvement design notes: Hermes-inspired scheduled review, auto-approval default, manual review opt-in, pending proposal storage, and curator work.
docs/companion-crates.md Boundary and implementation plan for optional companion projects, including the standalone importer at companions/ai-memory-importer, without widening core ai-memory.
docs/llm-provider-comparison.md Empirical notes behind the recommended LLM defaults.
docs/llm-provider-fallback.md Proposed opt-in fallback-chain design for transient LLM-provider failures; not yet a supported configuration surface.
docs/ARCHITECTURE.md Operational summary: data flow, crate layout, cross-cutting invariants, schema.
docs/design-decisions.md The full v1 spec.
Research docs under docs/ Karpathy LLM Wiki notes, Hermes Agent, agentmemory / basic-memory / cognee deep-dives, lessons-learned from upstream issues.

Influences and prior art

  • Karpathy LLM Wiki - the compile-not-retrieve pattern.
  • agentmemory - most of the right ideas; this project is the Rust successor.
  • basic-memory - the markdown-on-disk source-of-truth model.
  • cognee - pipeline composition and triplet embeddings.
  • Hermes Agent - the self-improvement loop: post-turn review, approval gates, and curator boundaries.
  • A-MEM - Zettelkasten-style atomic notes with link evolution.

License

MIT - see LICENSE.

Acknowledgements

This codebase is being built collaboratively with Claude Code (Anthropic Claude Opus 4.7) following the plan documented in docs/design-decisions.md.

View on GitHub

Recent activity

commits and pull requests

Releases and announcements

107 total
  1. v2.1.1v2.1.1Sep 8, 2026407 downloads

    ## ai-memory 2.1.1 A patch release: correctness and cost fixes on top of 2.1.0. No new features, no migrations, no config changes — safe to upgrade in place. ### Fixed - **`serve` no longer re-archives the whole data dir on every start** (#669). The OKF-conformance backup gate flagged the frontmatter-less monthly `log-YYYY-MM.md` event ledgers as pre-OKF, so a full tar.gz of the data dir was taken on every boot once a ledger existed. Ledgers are now excluded from that scan (the flip-side of 2.1.0's indexer fix). High-impact for long-running servers. - **Promptless internal sessions no longer flood the wiki** (#662). A session is now synthesized into a `sessions/<id>.md` page only when it logged real work (a user prompt or a tool use). OpenCode's internal `session.idle`/branch-naming events — which emit only a `stop` — stop creating ephemeral no-op pages. Provider-agnostic; applied on both the router and the atomic store check. - **Wiki commits stop re-hashing the entire tree** (#665). Since the #594 guard, every commit cleared the git index and re-read every page, so session-end cost grew with the wiki. Staging now uses libgit2's stat cache and re-hashes only

  2. v2.1.0v2.1.0Sep 6, 20261.3K downloads

    ## ai-memory 2.1.0 The 2.1 feature train, on top of every 2.0.x fix. ### Highlights **Ordered LLM provider fallback chains (#648).** Configure `[[llm_fallbacks]]` in `config.toml` with additional providers (each with its own `model`, optional `base_url`, and `api_key_env`). On a *transient* failure — 429, 5xx, timeout, or connection error — the chain advances to the next provider, preserving the original request, schema, and operation id; deterministic failures (bad request, auth, unsupported schema) stop immediately. Per-candidate circuit breaker, resolved-once credentials that never inherit the primary's env var, and passive per-candidate health in `ai-memory status` — labels and status only, never keys or response bodies. **`bootstrap --resume` (#621, #635).** An interrupted bootstrap resumes from durable per-chunk progress instead of re-paying for every LLM call. It adopts only the contiguous completed prefix and re-runs from the first gap, so a resumed run can never diverge from a clean one. Complements the transient-retry from 2.0.3. **First-party OpenCode 2.0 beta (#622).** `install-mcp --client opencode2`, `install-hooks --agent opencode2`, and `ai-memory run opencode2

  3. v2.0.3v2.0.3Sep 4, 20261.1K downloads

    ai-memory **2.0.3** — a patch release hardening the 2.0 line: data-safety, provider correctness, and reliability. No breaking changes; drop-in over 2.0.x. ### Highlights - **1.x rollback restored (#633).** The pre-migration safety archive is now taken *before* the SQLite schema is migrated, so it is a genuine pre-2.0 recovery point a 1.x binary can reopen — the documented "reversible upgrade" works again. (Earlier 2.0.x archives captured the already-migrated DB and were 2.x-only.) - **Typed edges work on OpenAI-family providers (#630).** `relations` was an open map that OpenAI strict mode silently emptied; it is now a fixed-shape object, so `causes`/`fixes`/`contradicts` edges emit again on `openai`, `openai-oauth`, `copilot`, `opencode`, and `openai-compat`. - **bootstrap reliability.** Tolerates a chunk that returns no pages (#614); retries a chunk on transient LLM errors — 5xx/429/timeout — instead of discarding the whole run (#617). - **`finalize-session --agent` accepts every captured agent (#623)** — `hermes`, `claude-desktop`, `crush`, `other`. - **Generated TypeScript integrations authenticate again under `--apply` (#625).** - **Watcher no longer spams on orphan project d

  4. v2.0.2v2.0.2Sep 3, 20261.2K downloads

    # ai-memory 2.0.2 A patch release that hardens the 2.0 line — most importantly, it fixes two startup crash-loops that could block a 1.x→2.0 upgrade, and meets OpenCode Go's Sept 6 header requirement. ## Upgrade-blocking fixes (upgrade to this before migrating) - **Windows: the OKF migration no longer aborts** on the `.serve.lock` file the same server holds under an exclusive lock (`os error 33`). The backup walk now skips it. (#593, thanks @Gaalbu / @rafaelkenedy) - **libgit2 crash-loop fixed**: the OKF migration could fail with `invalid object specified … class=Tree` and never start; the wiki commit now clears its index before staging so a stale cached blob OID can't abort it. (#594) ## Fixes - **OpenCode Go**: requests now send `x-opencode-session` + `User-Agent: ai-memory/<version>` — required before OpenCode Go starts rejecting header-less requests on 2026-09-06. (#608, thanks @lucazz) - **ZCode**: `install-hooks --agent zcode --apply` no longer reports a config ZCode has rejected as "already up to date"; it now reports the offending keys. (#600, thanks @costajohnt) - **Empty page titles**: pages with a blank frontmatter `title` (but a real `# H1`) read back correctly and no

  5. v2.0.1v2.0.1Sep 2, 20261.2K downloads

    # ai-memory 2.0.1 Patch release: the human-readable wiki no longer drowns knowledge in machinery. - **One lint report per project.** The lint pass supersedes a single `_lint/report.md` (history stays in the version chain) instead of writing a dated page every day — a long-lived store had accumulated 2,000+ of them, all indexed, searched, and embedded. Each pass also prunes the legacy dated pile, so existing stores clean themselves up with no migration; a pass with no findings removes the report entirely. - **Knowledge first in the web UI.** The project view moves machinery (lint reports, session captures, monthly logs, bundle indexes) into a collapsed *System* sidebar section, and Recent Activity lists knowledge pages only — concepts, decisions, gotchas, notes, procedures, and `_rules`. - **Calmer homepage.** The "LLM-optimised memory" explainer is dismissible (remembered per browser), and the redundant always-on backup banner is gone — the one-time migration dialog and `ai-memory status` carry that information. Upgrading from 2.0.0 needs nothing special: `docker compose pull && docker compose up -d` (or your platform's equivalent). Details in [CHANGELOG.md](https://github.com/a

Code frequency

additions and deletions
+73.1K-73.1KWeek of 2026-05-17: +44,136 linesWeek of 2026-05-17: -4,313 linesWeek of 2026-05-24: +44,491 linesWeek of 2026-05-24: -9,324 linesWeek of 2026-05-31: +16,269 linesWeek of 2026-05-31: -1,984 linesWeek of 2026-06-07: +5,816 linesWeek of 2026-06-07: -1,353 linesWeek of 2026-06-14: +19,483 linesWeek of 2026-06-14: -3,160 linesWeek of 2026-06-21: +13,145 linesWeek of 2026-06-21: -1,020 linesWeek of 2026-06-28: +7,751 linesWeek of 2026-06-28: -2,163 linesWeek of 2026-07-05: +7,221 linesWeek of 2026-07-05: -819 linesWeek of 2026-07-12: +13,769 linesWeek of 2026-07-12: -1,368 linesWeek of 2026-07-19: +28,985 linesWeek of 2026-07-19: -6,137 linesWeek of 2026-07-26: +43,341 linesWeek of 2026-07-26: -6,675 linesWeek of 2026-08-02: +13,156 linesWeek of 2026-08-02: -1,613 linesWeek of 2026-08-09: +7,127 linesWeek of 2026-08-09: -720 linesWeek of 2026-08-16: +12,647 linesWeek of 2026-08-16: -1,478 linesWeek of 2026-08-23: +9,298 linesWeek of 2026-08-23: -652 linesWeek of 2026-08-30: +73,105 linesWeek of 2026-08-30: -33,505 linesWeek of 2026-09-06: +3,994 linesWeek of 2026-09-06: -663 linesMay 17, 2026Sep 6, 2026
+363.7K lines added, -76.9K removed over the last year.

Commits per week

last 52 weeks
1900Week of 2025-09-14: 0 commitsWeek of 2025-09-21: 0 commitsWeek of 2025-09-28: 0 commitsWeek of 2025-10-05: 0 commitsWeek of 2025-10-12: 0 commitsWeek of 2025-10-19: 0 commitsWeek of 2025-10-26: 0 commitsWeek of 2025-11-02: 0 commitsWeek of 2025-11-09: 0 commitsWeek of 2025-11-16: 0 commitsWeek of 2025-11-23: 0 commitsWeek of 2025-11-30: 0 commitsWeek of 2025-12-07: 0 commitsWeek of 2025-12-14: 0 commitsWeek of 2025-12-21: 0 commitsWeek of 2025-12-28: 0 commitsWeek of 2026-01-04: 0 commitsWeek of 2026-01-11: 0 commitsWeek of 2026-01-18: 0 commitsWeek of 2026-01-25: 0 commitsWeek of 2026-02-01: 0 commitsWeek of 2026-02-08: 0 commitsWeek of 2026-02-15: 0 commitsWeek of 2026-02-22: 0 commitsWeek of 2026-03-01: 0 commitsWeek of 2026-03-08: 0 commitsWeek of 2026-03-15: 0 commitsWeek of 2026-03-22: 0 commitsWeek of 2026-03-29: 0 commitsWeek of 2026-04-05: 0 commitsWeek of 2026-04-12: 0 commitsWeek of 2026-04-19: 0 commitsWeek of 2026-04-26: 0 commitsWeek of 2026-05-03: 0 commitsWeek of 2026-05-10: 0 commitsWeek of 2026-05-17: 96 commitsWeek of 2026-05-24: 190 commitsWeek of 2026-05-31: 86 commitsWeek of 2026-06-07: 26 commitsWeek of 2026-06-14: 74 commitsWeek of 2026-06-21: 54 commitsWeek of 2026-06-28: 37 commitsWeek of 2026-07-05: 46 commitsWeek of 2026-07-12: 42 commitsWeek of 2026-07-19: 96 commitsWeek of 2026-07-26: 106 commitsWeek of 2026-08-02: 45 commitsWeek of 2026-08-09: 20 commitsWeek of 2026-08-16: 72 commitsWeek of 2026-08-23: 59 commitsWeek of 2026-08-30: 162 commitsWeek of 2026-09-06: 21 commitsSep 14, 2025Sep 6, 2026
1.2K commits in the last 52 weeks.

When work happens

weekday and hour
SunMonTueWedThuFriSat036912151821Sun 0:00 — 5 commitsSun 1:00 — 2 commitsSun 2:00 — 1 commitsSun 3:00 — 3 commitsSun 4:00 — 0 commitsSun 5:00 — 0 commitsSun 6:00 — 0 commitsSun 7:00 — 0 commitsSun 8:00 — 2 commitsSun 9:00 — 1 commitsSun 10:00 — 8 commitsSun 11:00 — 9 commitsSun 12:00 — 15 commitsSun 13:00 — 12 commitsSun 14:00 — 13 commitsSun 15:00 — 4 commitsSun 16:00 — 3 commitsSun 17:00 — 5 commitsSun 18:00 — 6 commitsSun 19:00 — 5 commitsSun 20:00 — 5 commitsSun 21:00 — 3 commitsSun 22:00 — 11 commitsSun 23:00 — 11 commitsMon 0:00 — 3 commitsMon 1:00 — 0 commitsMon 2:00 — 0 commitsMon 3:00 — 0 commitsMon 4:00 — 0 commitsMon 5:00 — 0 commitsMon 6:00 — 2 commitsMon 7:00 — 0 commitsMon 8:00 — 1 commitsMon 9:00 — 4 commitsMon 10:00 — 5 commitsMon 11:00 — 2 commitsMon 12:00 — 14 commitsMon 13:00 — 13 commitsMon 14:00 — 14 commitsMon 15:00 — 18 commitsMon 16:00 — 22 commitsMon 17:00 — 15 commitsMon 18:00 — 18 commitsMon 19:00 — 25 commitsMon 20:00 — 7 commitsMon 21:00 — 6 commitsMon 22:00 — 22 commitsMon 23:00 — 9 commitsTue 0:00 — 5 commitsTue 1:00 — 3 commitsTue 2:00 — 3 commitsTue 3:00 — 0 commitsTue 4:00 — 2 commitsTue 5:00 — 0 commitsTue 6:00 — 1 commitsTue 7:00 — 0 commitsTue 8:00 — 1 commitsTue 9:00 — 5 commitsTue 10:00 — 10 commitsTue 11:00 — 16 commitsTue 12:00 — 21 commitsTue 13:00 — 22 commitsTue 14:00 — 15 commitsTue 15:00 — 19 commitsTue 16:00 — 17 commitsTue 17:00 — 6 commitsTue 18:00 — 10 commitsTue 19:00 — 7 commitsTue 20:00 — 3 commitsTue 21:00 — 10 commitsTue 22:00 — 9 commitsTue 23:00 — 13 commitsWed 0:00 — 11 commitsWed 1:00 — 9 commitsWed 2:00 — 2 commitsWed 3:00 — 0 commitsWed 4:00 — 0 commitsWed 5:00 — 0 commitsWed 6:00 — 0 commitsWed 7:00 — 0 commitsWed 8:00 — 1 commitsWed 9:00 — 3 commitsWed 10:00 — 22 commitsWed 11:00 — 8 commitsWed 12:00 — 17 commitsWed 13:00 — 13 commitsWed 14:00 — 12 commitsWed 15:00 — 10 commitsWed 16:00 — 6 commitsWed 17:00 — 6 commitsWed 18:00 — 7 commitsWed 19:00 — 4 commitsWed 20:00 — 6 commitsWed 21:00 — 20 commitsWed 22:00 — 4 commitsWed 23:00 — 0 commitsThu 0:00 — 6 commitsThu 1:00 — 7 commitsThu 2:00 — 0 commitsThu 3:00 — 0 commitsThu 4:00 — 4 commitsThu 5:00 — 2 commitsThu 6:00 — 0 commitsThu 7:00 — 0 commitsThu 8:00 — 0 commitsThu 9:00 — 1 commitsThu 10:00 — 11 commitsThu 11:00 — 11 commitsThu 12:00 — 12 commitsThu 13:00 — 17 commitsThu 14:00 — 7 commitsThu 15:00 — 20 commitsThu 16:00 — 15 commitsThu 17:00 — 9 commitsThu 18:00 — 13 commitsThu 19:00 — 10 commitsThu 20:00 — 7 commitsThu 21:00 — 17 commitsThu 22:00 — 4 commitsThu 23:00 — 8 commitsFri 0:00 — 8 commitsFri 1:00 — 5 commitsFri 2:00 — 3 commitsFri 3:00 — 0 commitsFri 4:00 — 0 commitsFri 5:00 — 1 commitsFri 6:00 — 2 commitsFri 7:00 — 0 commitsFri 8:00 — 2 commitsFri 9:00 — 5 commitsFri 10:00 — 12 commitsFri 11:00 — 29 commitsFri 12:00 — 19 commitsFri 13:00 — 9 commitsFri 14:00 — 12 commitsFri 15:00 — 13 commitsFri 16:00 — 12 commitsFri 17:00 — 3 commitsFri 18:00 — 6 commitsFri 19:00 — 11 commitsFri 20:00 — 7 commitsFri 21:00 — 15 commitsFri 22:00 — 14 commitsFri 23:00 — 10 commitsSat 0:00 — 8 commitsSat 1:00 — 5 commitsSat 2:00 — 4 commitsSat 3:00 — 1 commitsSat 4:00 — 5 commitsSat 5:00 — 3 commitsSat 6:00 — 3 commitsSat 7:00 — 0 commitsSat 8:00 — 4 commitsSat 9:00 — 3 commitsSat 10:00 — 13 commitsSat 11:00 — 12 commitsSat 12:00 — 19 commitsSat 13:00 — 13 commitsSat 14:00 — 14 commitsSat 15:00 — 12 commitsSat 16:00 — 10 commitsSat 17:00 — 4 commitsSat 18:00 — 9 commitsSat 19:00 — 7 commitsSat 20:00 — 1 commitsSat 21:00 — 4 commitsSat 22:00 — 12 commitsSat 23:00 — 4 commits
Commit volume by weekday and hour (UTC). Larger dots mean more commits.

Who is committing

last 52 weeks
Maintainer commits1,223 (72%)
Community commits470 (28%)

1,693 commits in total over the last year.

DateListRankStars gained
Sep 10, 2026monthly#13+4,804
Sep 9, 2026monthly#13+4,716
Sep 8, 2026monthly#12+4,570
Sep 7, 2026monthly#13+4,490
Sep 6, 2026monthly#15+4,430
Sep 5, 2026monthly#17+4,357
Sep 4, 2026monthly#17+4,278
Sep 1, 2026monthly#16+3,902
Aug 31, 2026monthly#16+3,902
Aug 30, 2026monthly#17+3,846
Aug 28, 2026monthly#16+3,583
Aug 27, 2026weekly#9+2,073
Aug 27, 2026monthly#16+3,583
Aug 26, 2026weekly#9+2,073
Aug 25, 2026weekly#8+2,520
  • ultraworkers/claw-code

    An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

    195.2K stars · Rust

  • ultraworkers/claw-code

    An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

    194.9K stars · Rust

  • ultraworkers/claw-code

    An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

    194.9K stars · Rust

  • farion1231/cc-switch

    A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

    132.2K stars · Rust

  • openai/codex

    Lightweight coding agent that runs in your terminal

    123.1K stars · Rust

  • denoland/deno

    A modern runtime for JavaScript and TypeScript.

    108.4K stars · Rust