zerodb-mem0
Drop-in replacement for mem0ai backed by ZeroDB.
Same API. Free cloud storage. No Mem0 Cloud pricing.
Why switch?
| mem0ai | zerodb-mem0 | |
|---|---|---|
| Cloud storage | Mem0 Cloud (paid) | ZeroDB (free tier) |
| Self-hosted | Requires Qdrant/Postgres | Works out of the box |
| Benchmark | Not published | 100% Recall@1 (LongMemEval) |
| Knowledge graph | Basic | Full graph with GraphRAG |
| Provisioning | Manual setup | Auto-provision on first use |
| License | Apache-2.0 | MIT |
Installation
pip install zerodb-mem0
Migration (30 seconds)
Change one import:
# Before
from mem0 import Memory
# After
from zerodb_mem0 import Memory
That's it. Every method works the same.
Quick Start
from zerodb_mem0 import Memory
# Auto-provisions a free ZeroDB project on first use
m = Memory()
# Store memories
m.add("I love Italian food, especially pizza", user_id="alice")
m.add("I'm allergic to shellfish", user_id="alice")
m.add("My favorite restaurant is Pizzeria Delfina", user_id="alice")
# Search by meaning (not keywords)
results = m.search("food preferences", user_id="alice")
for r in results:
print(f" {r['memory']} (score: {r['score']:.2f})")
# Get all memories for a user
all_memories = m.get_all(user_id="alice")
print(f"Total memories: {len(all_memories)}")
# Delete a specific memory
m.delete(memory_id=results[0]["id"])
# Delete all memories for a user
m.delete_all(user_id="alice")
API Reference
Memory(api_key=None, project_id=None, base_url=None)
Create a memory client. Credentials are resolved in order:
- Constructor arguments
- Environment variables (
ZERODB_API_KEY,ZERODB_PROJECT_ID) - Config file (
~/.zerodb/config.json) - Auto-provision (free, no signup required)
Core Methods (mem0ai-compatible)
| Method | Description |
|---|---|
add(data, user_id=None, metadata=None) |
Store a memory |
search(query, user_id=None, limit=10) |
Semantic search |
get_all(user_id=None) |
Get all memories |
get(memory_id) |
Get a specific memory |
delete(memory_id) |
Delete a memory |
delete_all(user_id=None) |
Delete all user memories |
update(memory_id, data) |
Update a memory |
history(memory_id) |
Get memory history |
Extended Methods (ZeroDB-only)
These methods are not available in mem0ai:
| Method | Description |
|---|---|
reflect(entity_id, user_id=None) |
Generate insights from memories |
relate(subject, predicate, obj) |
Create knowledge graph edges |
graph_search(query, user_id=None) |
Hybrid vector + graph search |
Configuration
Environment Variables
export ZERODB_API_KEY="your-api-key"
export ZERODB_PROJECT_ID="your-project-id"
# Optional: custom API endpoint
export ZERODB_BASE_URL="https://api.ainative.studio"
Config File
// ~/.zerodb/config.json
{
"api_key": "your-api-key",
"project_id": "your-project-id"
}
Auto-Provisioning
If no credentials are found, zerodb-mem0 automatically creates a free ZeroDB project. The credentials are saved to ~/.zerodb/config.json for future use.
Use with AI Frameworks
LangChain
from zerodb_mem0 import Memory
from langchain.memory import ConversationBufferMemory
mem = Memory()
# Store conversation context
mem.add(f"User asked about {topic}", user_id=session_id)
# Recall relevant context
context = mem.search(user_message, user_id=session_id)
CrewAI
from zerodb_mem0 import Memory
mem = Memory()
# Agent stores learned facts
mem.add("Client prefers weekly updates", user_id="project-123")
# Another agent recalls context
facts = mem.search("client communication preferences", user_id="project-123")
Benchmark
ZeroDB achieves 100% Recall@1 on the LongMemEval benchmark, the standard evaluation for long-term memory systems.
License
MIT
Metadata
Release files for zerodb-mem0 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zerodb_mem0-0.1.0.tar.gz | 11.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zerodb_mem0-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.3 kB
Release files / zerodb_mem0-0.1.0.tar.gz
| Download URL | zerodb_mem0-0.1.0.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
03c985549745584057ee827ddc405c53c0d08bb9e29e25c801457d4a5314dc57
|
|
BLAKE2b-256 checksum How to use checksums |
5a78875ff365682ce32dda7039327bc72a2c0b8cbfaa6fa938e6d8d22ddf9c92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / zerodb_mem0-0.1.0-py3-none-any.whl
| Download URL | zerodb_mem0-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4182b934054798ca4221932894a9f2ad755899140c439728fd55afefd4551cb3
|
|
BLAKE2b-256 checksum How to use checksums |
47125fa067725d9f7d3b98d8adbfbb4fabe8b2a31a5a9ec0ef6c8c9eb6ec083b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|