Cross-LLM memory layer for AI agents - local, human-editable, Git-native
Project description
0xMemory
🧠 Cross-LLM Memory Layer for AI Agents
0xMemory gives your AI coding agents specific, persistent, and portable memory.
Instead of explaining your project structure or coding preferences to every new chat session in Cursor, Claude, or Gemini, 0xMemory stores this context in your repo where any agent can find it.
✨ Features
- 🧠 Persistent Memory: Facts, decisions, and learnings are stored in human-readable Markdown files (
.0xmemory/memory/). - ⚡ Two Modes:
- Lazy Mode: Dump raw text, let 0xMemory extract facts (requires API keys).
- Disciplined Mode: Let the Agent (Claude/Cursor) extract facts itself and just tell 0xMemory to
rememberthem. No 0xMemory API keys needed!
- 🔌 Cross-Agent Compatible: Works with Cursor, Claude Desktop, Gemini, and any MCP-compliant client.
- 🔍 vector Search: Semantic retrieval helps agents find relevant past decisions and facts.
- 📄 Human Editable: All memory is just Markdown. You can edit, delete, or version control it with Git.
- 🚀 Local First: Your data stays in your repo. No external vector DBs required.
🚀 Quick Start
1. Installation
# Clone and install
git clone https://github.com/manoj-80/0xMemory.git
cd 0xMemory
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
2. Initialize a Brain
Go to your project directory and run:
cd /path/to/my/project
0xmemory init
This creates a .0xmemory/ folder. Edit .0xmemory/brain.md to add your initial project context!
3. Connect your AI Agent
🖱️ Cursor (IDE)
- Go to Settings > Cursor Settings > Models > MCP.
- Click Add new MCP server.
- Name:
0xmemory - Type:
SSE - URL:
http://localhost:8000/sse
Note: You must have the server running:
0xmemory serve --transport http
JSON Configuration (Advanced)
If you are configuring via a settings file (e.g., settings.json or generic MCP client config), use:
{
"mcpServers": {
"0xMemory": {
"url": "http://localhost:8000/sse",
"transport": "sse"
}
}
}
🤖 Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"0xmemory": {
"command": "0xmemory",
"args": ["serve"],
"cwd": "/absolute/path/to/your/project"
}
}
}
🛠️ Usage
Once connected, your AI agent has access to these Tools:
remember: Save important info."Remember that we use Poetry for dependency management."
recall: Search past memories."What did we decide about database migrations?"
extract: Auto-extract knowledge from a conversation."Extract the key decisions from these meeting notes..."
And these Resources (Context):
brain://context: Reads yourbrain.md(Project Overview).brain://facts: List of all stored facts.brain://decisions: Log of architectural decisions.
🧠 How to Extract Knowledge
You have two powerful ways to build your memory:
1. Lazy Mode (The "Dump" Method)
Best for: Meeting notes, long documentation, or messy brain dumps.
- Requirement: Add an API key (
GEMINI_API_KEY, etc.) to your.envfile. - Action: Run
0xmemory extract "paste your long text here". - Result: 0xMemory uses the cloud LLM to analyze the text and automatically creates facts, decisions, and outcomes in
.0xmemory/memory/.
2. Disciplined Mode (The "Agent" Method)
Best for: coding sessions in Cursor/Claude. No API keys required for 0xMemory!
- Action: Just talk to your Agent normally.
- Prompt: When you decide something important, tell the Agent:
"Using the
remembertool, save the fact that we decided to use PostgreSQL because of its JSONB support." - Result: The Agent (which already has context) calls the tool directly. 0xMemory simply stores it.
🧠 The Separation of Powers
0xMemory is designed with a strict separation of concerns:
-
Human Territory (
.0xmemory/brain.md)- Writable by: YOU (The Human) only.
- Readable by: The Agent.
- Purpose: High-level strategy, mission statements, and "Supreme Laws" (e.g., "Always use TypeScript").
- Note: The Agent is forbidden from editing this file. It is your space to lead.
-
AI Territory (
.0xmemory/memory/*.md)- Writable by: The Agent (via
remembertool). - Readable by: The Agent (via
recalltool). - Purpose: Tactical details, API schemas, decision logs, and user preferences.
- Writable by: The Agent (via
📁 Directory Structure
.0xmemory/
├── brain.md # Main project context (Human curated)
├── config.yaml # Configuration
├── memory/ # AI memory (Auto-managed)
│ ├── facts.md
│ ├── decisions.md
│ ├── learnings.md
│ └── preferences.md
├── sessions/ # Chat session archives
└── .store/ # ChromaDB vector index (Git ignored)
⌨️ CLI Commands
| Command | Description |
|---|---|
0xmemory init |
Initialize a brain in the current directory |
0xmemory serve |
Start the MCP server (stdio or http) |
0xmemory status |
View brain statistics |
0xmemory add |
Manually add a memory |
0xmemory forget |
Delete a memory by ID |
0xmemory update |
Update a memory's content |
0xmemory search |
Search for memories |
0xmemory extract |
Extract knowledge from text |
0xmemory export |
Export memories to JSON/CSV |
0xmemory rebuild |
Rebuild vector index from Markdown |
0xmemory doctor |
Run health checks on configuration |
🧪 Real-World Testing
We have a detailed guide with 4 real-life scenarios (Context Switching, Decision Logs, etc.) to verify your setup.
👉 Read the Real-World Testing Guide
Pro Tip: Check the Optimizing Token Usage section in the guide to learn how to scale to infinite memory using
.cursorignore.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
This project is licensed under the MIT License.
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.4.tar.gz.
File metadata
- Download URL: oxmemory-1.0.4.tar.gz
- Upload date:
- Size: 182.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d624ce1d06ce76c9b2d137551c1d1b623238e0a7d1f4761c02a5cb03ad01f07
|
|
| MD5 |
0241ed0da9ce9eacbd6a82f37cb474fc
|
|
| BLAKE2b-256 |
f1ec526878be7bac6e81668d2430d920327aab553f49a3cabd8f3d0e90727812
|
Provenance
The following attestation bundles were made for oxmemory-1.0.4.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.4.tar.gz -
Subject digest:
5d624ce1d06ce76c9b2d137551c1d1b623238e0a7d1f4761c02a5cb03ad01f07 - Sigstore transparency entry: 814749765
- Sigstore integration time:
-
Permalink:
MANOJ-80/0xMemory@f748b50eacecc1b19b35caef921f621117772f63 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/MANOJ-80
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f748b50eacecc1b19b35caef921f621117772f63 -
Trigger Event:
release
-
Statement type:
File details
Details for the file oxmemory-1.0.4-py3-none-any.whl.
File metadata
- Download URL: oxmemory-1.0.4-py3-none-any.whl
- Upload date:
- Size: 41.7 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 |
a2d4a7111ddbe1f8825a78e3b405520b6d7933749525e6d7f546dfcf496cec02
|
|
| MD5 |
4d109a0986ce4a9b68649cd682691bf6
|
|
| BLAKE2b-256 |
7eb5a841d0e351ba1feaa976a8e93dfa31d449887895cc306be60bcc62401a1e
|
Provenance
The following attestation bundles were made for oxmemory-1.0.4-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.4-py3-none-any.whl -
Subject digest:
a2d4a7111ddbe1f8825a78e3b405520b6d7933749525e6d7f546dfcf496cec02 - Sigstore transparency entry: 814749770
- Sigstore integration time:
-
Permalink:
MANOJ-80/0xMemory@f748b50eacecc1b19b35caef921f621117772f63 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/MANOJ-80
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f748b50eacecc1b19b35caef921f621117772f63 -
Trigger Event:
release
-
Statement type: