ai-memory — Chat History → AGENTS.md + Cursor Rules + MCP
@hyxnj666-creator
Turn editor chat history (Cursor/Claude Code/Windsurf/Copilot/Codex CLI) into typed Markdown memories (decisions/architecture/conventions/TODOs) and expose them via MCP server, AGENTS.md, Cursor Rules, and Anthropic Skills. Local-first, git-trackable, no .remember() calls. CCEB b
Overview
What is ai-memory?
ai-memory reads AI editor chat history (Cursor, Claude Code, Windsurf, Copilot Chat, Codex CLI) and converts it into typed Markdown plus AGENTS.md rules. It is local-first, git-trackable, and requires no .remember() API calls — designed for developers who want persistent, reviewable memory from their coding conversations without instrumenting their code.
How to use ai-memory?
Install with npx ai-memory-cli (no global install required). Run npx ai-memory-cli extract to read editor chat history; npx ai-memory-cli rules --target agents-md to generate AGENTS.md; npx ai-memory-cli recall "query" to view git lineage of decisions; npx ai-memory-cli context --copy to resume a session with compressed context. The built-in free model works immediately; set your own API key (any OpenAI-compatible provider) for unlimited use. Use npx ai-memory-cli init --with-mcp to optionally register as an MCP server.
Key features of ai-memory
- Zero
.remember()boilerplate — reads existing chat transcripts directly from disk. - Native
AGENTS.mdoutput consumed by Cursor, Claude Code, Windsurf, Copilot, and Codex CLI. - Plain Markdown files in git (
.ai-memory/) — no database, fully diffable and revertible. - Time-travel recall via git history — shows full commit-by-commit lineage of decisions.
- Team-aware per-author subdirectories to avoid merge conflicts.
- Cross-device portable export/import as versioned JSON bundle.
contextcommand compresses thousands of turns into a focused prompt (typically 90%+ reduction).
Use cases of ai-memory
- Turn chat history from AI coding sessions into a permanent, git-tracked knowledge base.
- Auto-generate
AGENTS.mdrules from team conventions discussed in editor chats. - Debug past decisions:
recallshows what was decided, when, and by whom. - Resume long-running sessions without re-pasting entire conversation history.
- Sync memory across machines via
git pullon the.ai-memory/directory.
FAQ from ai-memory
Does ai-memory require an API key to work?
No. The built-in free model works immediately for extraction (limited to 2 conversations per run). Set your own key with export AI_REVIEW_API_KEY=sk-... or OPENAI_API_KEY for unlimited extractions, or use Ollama / LM Studio for fully offline operation.
Which AI editors are supported?
Cursor, Claude Code, Windsurf, Copilot Chat, and Codex CLI are explicitly supported. The README states that ai-memory reads transcripts from these tools.
Where does ai-memory store data?
All extracted memories are stored as plain Markdown files in the .ai-memory/ directory at the project root. This directory is meant to be committed to git — no external database or runtime memory store is used.
How is ai-memory different from other memory tools like mem0 or Letta?
Other tools require a remember() API call from application code. ai-memory reads existing chat history directly from the editor's disk — no SDK import, no runtime memory store to keep alive. It outputs git-trackable Markdown and AGENTS.md that every editor can read.
Doesn't 1M-token context make ai-memory obsolete?
No. Long context solves per-query visibility; ai-memory provides persistent, cross-session, cross-machine, and team-shareable memory. Re-shipping raw history every query is expensive ($0.20–$0.60 per turn for a two-week session), and long-context retrieval degrades on non-headline information past ~128K tokens. AGENTS.md is 1–5K tokens loaded once per session.