Stop explaining your project to every new chat session.
0xMemory transforms your repository into a self-documenting brain that evolves with your code.
Quick Start β’ How It Works β’ Features β’ Installation
Building complex software with AI agents is frustrating because they forget. They forget your architecture decisions, your coding conventions, and what you fixed yesterday.
0xMemory bridges the gap between simple CLI tools and complex cloud memory APIs.
| Feature | βοΈ Cloud Memory APIs | β¨οΈ CLI Agents | π§ 0xMemory |
|---|---|---|---|
| Primary Goal | App Integration | Chat Interaction | Project Intelligence |
| Data Privacy | β Third-party Servers | β 100% Local | |
| Storage | β Hidden Vector DB | β Temp Files | β Markdown + Vector |
| Control | β API Access Only | β Re-prompting | β Edit Files Directly |
| Scope | π Global / User | β±οΈ Session | π Per-Repository |
| Cost | β Subscription | β Free | β Free (Open Source) |
Most tools define memory as "storing chat logs". 0xMemory defines it as curating project knowledge.
0xMemory isn't just a file writer. It's a living knowledge loop that runs legally on your machine.
flowchart LR
subgraph IDE [Your Environment]
Agent[π€ AI Agent]
User[π€ Developer]
end
subgraph Brain [0xMemory Brain]
MCP[π MCP Server]
subgraph Storage [Dual Storage System]
MD["π Markdown Files\n(Source of Truth)"]
Vec["π Vector DB\n(Semantic Search)"]
end
end
User -->|Prompts| Agent
Agent <-->|Read/Write| MCP
MCP -->|Save Fact| MD
MD -.->|Sync| Vec
MCP -->|Search| Vec
style Brain fill:#f0f4f8,stroke:#333,stroke-width:2px
style Agent fill:#e1f5fe,stroke:#0277bd
style MCP fill:#fff9c4,stroke:#fbc02d
-
Capture (The Ear)
- Manual: You explicitly tell it: "Remember that we use Poetry for deps."
- Auto-Extraction: You dump a raw chat log, and 0xMemory uses a local LLM (or API) to distill it into atomic facts: "Fact: Project uses Poetry. Decision: Switched from pipenv on 2024-01-15."
-
Storage (The Hippocampus)
- Source of Truth: Everything is saved to
.0xmemory/memory/*.md. These are standard Markdown files. You can edit, delete, or version control them with Git. - Indexing: Every save triggers a background sync to a local ChromaDB vector store. This turns text into mathematical embeddings for semantic search.
- Source of Truth: Everything is saved to
-
Recall (The Voice)
- Hybrid Search: Use Vector Search (conceptual matches) + Keyword Search (exact matches).
- Context Injection: When you ask "How do I install dependencies?", 0xMemory finds the relevant facts and injects them into your AI's context window before it answers.
- Project-Scoped Brains: One brain per repository. Context never leaks.
- Cross-LLM Compatible: Works with Cursor, Claude Desktop, Windsurf, and Gemini CLI.
- Hybrid Search: Combines keyword matching with semantic vector search for 100% recall.
- Human-Editable: Your memory is just
brain.mdandfacts.md. Edit them like code. - Knowledge Extraction:
0xmemory extractturns messy chat logs into structured facts. - Dual Storage:
- Read: Fast semantic search via ChromaDB.
- Write: Durable Markdown files for version control.
- Git Automation: Auto-commit memory changes (
feat: learned 3 new facts). - Memory Decay: Old, unused memories fade away to keep context fresh.
- Reinforce Tool: Manually strengthen important memories.
- Context Window Control: Smartly truncate context to fit token limits.
- Session Summary: Auto-summarize chat logs into concise insights.
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activatepip install oxmemoryGo to your project root and create a brain:
cd my-project
0xmemory init*This creates a .0xmemory/ directory. Add .0xmemory/brain.md to your editor and describe your project high-level goals.*
Start the memory server:
0xmemory serve --transport httpAdd this to your MCP config:
{
"mcpServers": {
"0xMemory": {
"url": "http://localhost:8000/sse",
"transport": "sse"
}
}
}Add to claude_desktop_config.json:
{
"mcpServers": {
"0xmemory": {
"command": "0xmemory",
"args": ["serve"],
"cwd": "/absolute/path/to/your/project"
}
}
}Best for keeping a clean, high-quality brain.
- Teach: "Remember that we use
blackfor formatting." - Verify: "What are our formatting rules?"
- Correct: Open
.0xmemory/memory/facts.mdand edit the text directly if the AI got it wrong.
Best for fast-moving development sessions.
- Dump: Provide a messy brain dump or paste a conversation logs.
- Extract: Run
0xmemory extract "..." - Review: 0xMemory uses an LLM (Groq/Ollama) to parse out the facts for you.
Your brain is transparent. Here's what's inside .0xmemory/:
| File | Purpose |
|---|---|
brain.md |
The Core. High-level architecture, goals, and user context. |
memory/facts.md |
Technical facts (e.g., "API runs on port 8000"). |
memory/decisions.md |
Decision logs (e.g., "Why we chose HTMX over React"). |
sessions/ |
Archived chat logs for historical retrieval. |
.store/ |
(Git-ignored) Local ChromaDB vector index. |
As your memory grows, you can optimize how Cursor uses it.
Cursor reads .0xmemory/*.md files directly into its context window.
- β Fast - no tool calls needed
- β Uses tokens - can fill context with large memories
Force Cursor to use the recall tool (vector search) instead of reading files directly. This scales to unlimited memories with zero token cost until needed.
Step 1: Create .cursorignore in your project root:
.0xmemory/memory/*.md
Step 2: Copy the rules template to your project:
cp examples/cursorrules.template .cursorrulesOr create a minimal .cursorrules:
# 0xMemory Rules
You have a long-term memory system called 0xMemory.
When you need project context or past decisions, use the `recall` tool to search for it.
ALWAYS check `recall` before saying "I don't know".We provide ready-to-use context files for different AI agents. Copy these to your project root:
| File | For | Usage |
|---|---|---|
examples/cursorrules.template |
Cursor IDE | Copy as .cursorrules |
examples/CLAUDE.md |
Claude Code/Desktop | Copy as CLAUDE.md |
examples/GEMINI.md |
Gemini CLI | Copy as GEMINI.md |
examples/AGENT.md |
Any AI agent | Universal template |
Each template includes:
- Full tools and resources reference
- Behavior guidelines
- Customization section for your project context
We are building the standard for local AI memory.
- Bugs? Open an issue.
- Ideas? Discussions are open.
- Code? PRs welcome!