Cross-LLM memory layer for AI agents - local, human-editable, Git-native
Project description
๐ง 0xMemory
Give your AI a brain that lives in your repo.
0xMemory is a cross-LLM memory layer that gives AI coding agents (Cursor, Claude, Gemini) persistent, portable memory.
Stop explaining your project to every new chat session. 0xMemory stores context in human-readable Markdown files that any agent can find.
How It Works
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ You: "Remember that we use PostgreSQL for auth." โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ 0xMemory MCP Server โ โ
โ โ Saves to Markdown โ Indexes in Vector DB โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ Later: "What database do we use?" โ
โ Agent: "You use PostgreSQL for auth." โ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| Feature | Description |
|---|---|
| Persistent | Facts and decisions stored in .0xmemory/memory/ as Markdown |
| Private | Vector search runs 100% locally on your machine |
| Portable | Works with Cursor, Claude Desktop, and any MCP client |
| Git-Native | Your memory is just files. Commit, diff, and push them. |
Quick Start
Step 1: Set Up Environment
# Create and activate a virtual environment (recommended)
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install 0xMemory
pip install oxmemory
Step 2: Initialize
cd /path/to/your/project
0xmemory init
This creates a .0xmemory/ folder. Edit .0xmemory/brain.md to describe your project.
Step 3: Start the Server
0xmemory serve --transport http
Note: First run downloads a small embedding model (~80MB). If it times out, just run it again.
Step 4: Connect Your AI
Cursor IDE
Add to your MCP config (.cursor/mcp.json or via Settings โ Features โ MCP):
{
"mcpServers": {
"0xMemory": {
"url": "http://localhost:8000/sse",
"transport": "sse"
}
}
}
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"0xmemory": {
"command": "0xmemory",
"args": ["serve"],
"cwd": "/absolute/path/to/your/project"
}
}
}
Usage
Disciplined Mode (Local, Free)
Tell your agent what to remember. No API keys required.
You: "We use Pydantic v2 for all models. Remember that."
Agent: โ
Memory saved.
Lazy Mode (Cloud-Powered)
Dump messy notes, 0xMemory extracts the knowledge for you.
- Add an API key to
.env(e.g.,GROQ_API_KEY) - Run:
0xmemory extract "We decided to switch to Postgres because Mongo was too slow for complex joins."
- 0xMemory saves:
- Decision: Switch to Postgres
- Reasoning: Mongo slow for complex joins
LLM Providers
The extract tool uses an LLM to parse knowledge from text. Configure via .env:
| Provider | Env Variable | Free Tier | Notes |
|---|---|---|---|
| Groq | GROQ_API_KEY |
14,400 req/day | Recommended for dev |
| Gemini | GEMINI_API_KEY |
20 req/day | Save for demos |
| OpenRouter | OPENROUTER_API_KEY |
Pay-as-you-go | Many models |
| Ollama | OLLAMA_API_BASE |
Unlimited | Fully local |
Example .env:
# Pick one (or more for fallback)
GROQ_API_KEY=gsk_xxx...
GEMINI_API_KEY=AIza...
# For remote Ollama (e.g., Google Colab + ngrok)
OLLAMA_API_BASE=https://your-tunnel.ngrok.io
0xMemory tries providers in order: Ollama โ Groq โ OpenRouter โ Gemini.
Available Tools
Once connected, your AI agent has access to these MCP tools:
| Tool | What It Does |
|---|---|
remember |
Save a Fact, Decision, Learning, or Preference |
recall |
Search memories using semantic search |
list |
List all memories with optional filters |
forget |
Remove a memory by ID |
update |
Update an existing memory |
status |
Get brain statistics |
extract |
Auto-extract knowledge from text (requires LLM) |
And these read-only resources:
| Resource | Content |
|---|---|
brain://context |
Your project's brain.md file |
brain://facts |
All stored technical facts |
brain://decisions |
Log of architectural decisions |
brain://full |
Combined full context |
Project Structure
After running 0xmemory init, your project gets a .0xmemory/ folder:
.0xmemory/
โโโ brain.md # ๐ Your project context (edit this!)
โโโ config.yaml # Server and LLM settings
โโโ memory/ # AI-managed memory files
โ โโโ facts.md # Technical facts ("API uses port 3000")
โ โโโ decisions.md # Architectural decisions with reasoning
โ โโโ learnings.md # Lessons learned, gotchas, tips
โ โโโ preferences.md # Coding style preferences
โโโ documents/ # (Optional) Docs for RAG ingestion
โโโ sessions/ # Chat session history archives
โโโ .store/ # Vector database (auto-generated, gitignored)
โโโ chroma/ # ChromaDB embeddings for semantic search
What Each File Does
| File/Folder | Purpose |
|---|---|
brain.md |
You write this. High-level project description, architecture, goals. The AI reads this first. |
config.yaml |
Configuration for LLM providers, embedding models, and server settings. |
memory/*.md |
AI writes these. Extracted knowledge from your conversations. Human-readable and editable. |
documents/ |
Drop markdown/text files here for document-based retrieval (RAG). |
sessions/ |
Archived chat sessions for context continuity. |
.store/ |
Local vector database (ChromaDB). Enables semantic search. Auto-generated, safe to delete (rebuilds from markdown). |
CLI Reference
| Command | Description |
|---|---|
0xmemory init |
Create a new brain in current directory |
0xmemory serve |
Start MCP server (add --transport http for Cursor) |
0xmemory status |
Show brain statistics |
0xmemory add "..." |
Manually add a memory |
0xmemory search "..." |
Search memories |
0xmemory forget <id> |
Delete a memory by ID |
0xmemory update <id> "..." |
Update a memory's content |
0xmemory extract "..." |
Extract knowledge via LLM |
0xmemory export |
Export memories to JSON/CSV |
0xmemory rebuild |
Rebuild vector index from Markdown |
0xmemory doctor |
Check configuration health |
0xmemory config --show |
View current configuration |
Useful flags:
0xmemory serve --transport http --port 9000 # Custom port
0xmemory serve --debug # Verbose logging
0xmemory export -o backup.json # Export to JSON
0xmemory export -o data.csv --type fact # Export facts to CSV
Advanced: Token Optimization
As your memory grows, you can optimize how Cursor uses it.
Default Mode (Direct Access)
Cursor reads .0xmemory/*.md files directly into its context window.
- โ Fast - no tool calls needed
- โ Uses tokens - can fill context with large memories
Token Saver Mode
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 .cursorrules
Or 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".
AI Context Templates
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
Troubleshooting
| Problem | Solution |
|---|---|
| First run timeout | Normal on slow connections. Download resumes on retry. |
| Port 8000 in use | Use 0xmemory serve --port 9000 and update your config |
| Model download stuck | Check internet connection, then run again |
| Connection refused | Make sure 0xmemory serve is running in a terminal |
| Cursor shows red light | Restart the server, then refresh MCP in Cursor settings |
Health check: When running in HTTP mode, visit http://localhost:8000/health to verify the server is up.
License
Built for developers who want their AI to actually remember things.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oxmemory-1.0.5.tar.gz.
File metadata
- Download URL: oxmemory-1.0.5.tar.gz
- Upload date:
- Size: 185.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
966076c1e4c8159392229f12f42e0289b11aa0af8974083b5f549ce5af53680d
|
|
| MD5 |
ffe3304ba6c643b0e9607f041c53b9ec
|
|
| BLAKE2b-256 |
7d857783b1ef2c0c50be7f5636201bc77d76f54fca8697000c26e1a565a16e02
|
Provenance
The following attestation bundles were made for oxmemory-1.0.5.tar.gz:
Publisher:
publish.yml on MANOJ-80/0xMemory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oxmemory-1.0.5.tar.gz -
Subject digest:
966076c1e4c8159392229f12f42e0289b11aa0af8974083b5f549ce5af53680d - Sigstore transparency entry: 814849882
- Sigstore integration time:
-
Permalink:
MANOJ-80/0xMemory@2155f7c56f160881367fff74f6522e0281e88de5 -
Branch / Tag:
refs/tags/v1.0.5 - Owner: https://github.com/MANOJ-80
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2155f7c56f160881367fff74f6522e0281e88de5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file oxmemory-1.0.5-py3-none-any.whl.
File metadata
- Download URL: oxmemory-1.0.5-py3-none-any.whl
- Upload date:
- Size: 42.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
694afa999d163c074c4f9fb918bdcc6fa2f23cdd3b7b31fc7ae3ca6beb5b0a2e
|
|
| MD5 |
816d9fa6d0daeee647f6142fb1f64498
|
|
| BLAKE2b-256 |
6110396d517327b6292aa1637197ff3a297ec8164f4f897960cf12e1e5e33f51
|
Provenance
The following attestation bundles were made for oxmemory-1.0.5-py3-none-any.whl:
Publisher:
publish.yml on MANOJ-80/0xMemory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oxmemory-1.0.5-py3-none-any.whl -
Subject digest:
694afa999d163c074c4f9fb918bdcc6fa2f23cdd3b7b31fc7ae3ca6beb5b0a2e - Sigstore transparency entry: 814849883
- Sigstore integration time:
-
Permalink:
MANOJ-80/0xMemory@2155f7c56f160881367fff74f6522e0281e88de5 -
Branch / Tag:
refs/tags/v1.0.5 - Owner: https://github.com/MANOJ-80
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2155f7c56f160881367fff74f6522e0281e88de5 -
Trigger Event:
release
-
Statement type: