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.md output 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.
context command 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.md rules from team conventions discussed in editor chats.
- Debug past decisions:
recall shows what was decided, when, and by whom.
- Resume long-running sessions without re-pasting entire conversation history.
- Sync memory across machines via
git pull on the .ai-memory/ directory.
评论