AI-Memory: The Open-Source Solution With 3,800+ GitHub Stars That Gives Your AI Coding Agents Persistent Memory Across Sessions
Learn how AI-Memory, an open-source tool with 3,800+ GitHub stars, solves the context persistence problem for AI coding agents. Switch between Claude Code, Codex, Cursor, and 12+ other agents without losing context.
Quick Answer
AI-Memory is an open-source tool (3,800+ GitHub stars) that gives AI coding agents persistent memory across sessions and tools. Quit Claude Code mid-task, start Codex in the same directory, and continue without re-explaining architecture or failed approaches. It stores context as markdown in git, requires no vector database, and supports 15+ AI agents including Claude Code, Codex, Cursor, and Gemini CLI.
Why AI Agents Need Long-Term Memory
Every developer using AI coding assistants has experienced this frustration: you spend hours explaining your project architecture, discussing failed approaches, and building context with an AI agent—then the session ends. When you start a new session, even with the same tool, you're back to square one.
The problem gets worse when switching between tools. Start with Claude Code for architecture design, switch to Codex for implementation, then use Cursor for debugging—each tool operates in isolation, forcing you to repeat context that should persist.
AI-Memory solves this by creating a shared, persistent memory layer that works across sessions and AI agents. It's not just another note-taking app—it's a context management system specifically designed for AI-powered development workflows.
How AI-Memory Works
Unlike traditional RAG systems that rely on vector databases and embeddings, AI-Memory takes a fundamentally different approach:
1. Lifecycle Observation Capture
AI-Memory hooks into your AI agent's lifecycle events—session start, tool usage, session end—and captures relevant observations automatically. These aren't raw transcripts; they're sanitized, bounded observations (up to 16 KiB for user prompts, 2 KB for tool excerpts) that preserve context without bloating storage.
2. Session-End Compilation
When a session ends, AI-Memory compiles observations into coherent wiki-style markdown pages. This "Karpathy-style compilation" transforms raw logs into organized, searchable knowledge. The result is a git-versioned markdown wiki that you can grep, open in Obsidian, or back up with rsync.
3. Cross-Agent Handoffs
The magic happens when you switch tools. When Codex starts in a directory where Claude Code just finished, it receives a bounded handoff—a "where you left off" block that summarizes the previous work, open questions, and architectural decisions.
Key Features That Set AI-Memory Apart
Zero-Friction Setup
AI-Memory works with 15+ AI agents out of the box: Claude Code, Codex, Command Code, Devin CLI, OpenCode, Cursor, Gemini CLI, Antigravity CLI, Grok Build CLI, Kimi Code, OpenClaw, and more. Installation is a single command, and lifecycle hooks configure automatically.
Per-Project Isolation
Each project gets its own isolated memory space, keyed by stable UUIDs. Worktrees of the same repo share one project identity, but different projects never collide. Perfect for consultants managing multiple clients or developers juggling personal and work projects.
Authority-Aware Recall
Not all memories are equal. AI-Memory uses authority-aware retrieval that favors maintained documentation (_rules/, decisions/, procedures/) over ephemeral session logs. Critical architectural decisions rank higher than yesterday's debugging session.
Entity-Assisted Search
Each page stores up to 10 canonical entities in frontmatter. When you search for "authentication," pages that mention "OAuth," "JWT," or "session management" in their entity list get boosted—even if their body text uses different wording.
Built-In Web Browser
Need to browse your AI's memory manually? AI-Memory includes a read-only HTML UI with project navigation, folder trees, full-text search, and dark mode. It runs on the same server as the MCP endpoint.
Real-World Example: Migrating from Claude Code to Codex
Let's say you're building a React application. You start with Claude Code to design the component architecture:
Later, you want to switch to Codex for faster code generation:
The handoff includes not just what was decided, but why—the rationale, failed approaches, and open questions. This context preservation is what makes multi-agent workflows practical.
Technical Architecture
AI-Memory is written in Rust for performance and reliability. The architecture follows a client-server model:
- Server: Runs locally (loopback) or on a homelab/LAN with bearer-token authentication
- Storage: SQLite for metadata, git-versioned markdown for content
- Search: FTS5 (full-text search), entity matching, graph-neighbor ranking, optional vector embeddings
- Clients: Thin CLI tools that communicate via HTTP
The LLM is opt-in. Zero-LLM mode gives you FTS5 search, entity matching, and rule-based summarization. Add an LLM provider when you want consolidated pages, contradiction detection, or staged auto-improvement proposals.
Key Benefits
- Cross-agent continuity: Switch between 15+ AI agents without losing context
- No vector database: Plain markdown in git—grep-able, portable, human-readable
- Automatic capture: Lifecycle hooks fire-and-forget; no manual note-taking
- Per-project isolation: Multiple projects, clients, or work/personal split handled automatically
- Authority-aware retrieval: Critical decisions rank higher than ephemeral logs
- Multi-platform support: Linux, macOS, Windows (WSL2 and native)
- Built-in web UI: Browse and search your AI's memory visually
- Opt-in LLM: Works without an LLM; add one when you need advanced features
FAQ
What AI agents does AI-Memory support?
AI-Memory supports 15+ agents: Claude Code, OpenAI Codex, Command Code, Devin CLI, OpenCode, Cursor, Gemini CLI, Antigravity CLI, Grok Build CLI, Kimi Code, OpenClaw, Oh My Pi, Pi, VS Code Copilot (MCP-only), Kiro CLI, and Zed (MCP-only). New agents are added regularly.
Do I need a vector database?
No. AI-Memory stores everything as plain markdown in a git repository. You can grep it, open it in Obsidian, or back it up with rsync. Vector embeddings are optional—only needed if you want semantic search on top of the existing FTS5 and entity-based search.
How does cross-agent handoff work?
When you quit one AI agent and start another in the same directory, the new agent receives a bounded handoff block summarizing the previous session. This includes architectural decisions, failed approaches, open questions, and recent context. The handoff happens automatically before the first prompt.
Can I use AI-Memory with multiple projects?
Yes. Each project gets isolated memory keyed by stable UUIDs. Worktrees of the same repo share one project identity, but different projects never collide. You can use .ai-memory.toml marker files to explicitly control workspace and project assignment.
Does AI-Memory work without an LLM?
Yes. Zero-LLM mode provides FTS5 search, entity matching, graph-neighbor search, and rule-based summarization. Add an LLM provider (OpenAI, Anthropic, Gemini, or OpenAI-compatible endpoints like Ollama) when you want consolidated pages, contradiction detection, or auto-improvement proposals.
How much storage does AI-Memory use?
Observations are bounded: user prompts retain up to 16 KiB, tool excerpts up to 2 KB, with a 16 KiB backstop per observation. Compiled wiki pages are concise markdown. A typical project with months of usage stays under 100 MB, easily backed up with git.
Can I share AI-Memory with my team?
Yes. Run the server on a homelab or LAN with bearer-token authentication. Per-operator memory slots keep individual context isolated while sharing project-wide knowledge. The server never exposes local file paths, so team members can use different directory structures.
Getting Started
Installation is straightforward:
For detailed setup instructions, including Docker deployment and multi-user configuration, check the official GitHub repository.
Conclusion
AI-Memory addresses a fundamental limitation of AI coding assistants: session amnesia. By providing persistent, cross-agent memory stored as plain markdown, it makes multi-agent workflows practical and eliminates the need to repeatedly explain project context.
With 3,800+ GitHub stars and support for 15+ AI agents, AI-Memory has quickly become the go-to solution for developers serious about AI-powered development. Whether you're switching between tools, working across multiple projects, or collaborating with a team, AI-Memory ensures your AI agents always have the context they need to be effective.
Ready to give your AI agents persistent memory? Check out AI-Memory on GitHub and start building context that lasts.
Looking to master AI-powered development? Explore CoddyKit's AI and development courses to level up your skills.