Skip to main content

Drop-in mem0ai replacement backed by ZeroDB. Same API, free cloud storage.

Project description

zerodb-mem0

Drop-in replacement for mem0ai backed by ZeroDB.

Same API. Free cloud storage. No Mem0 Cloud pricing.

PyPI License: MIT

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:

  1. Constructor arguments
  2. Environment variables (ZERODB_API_KEY, ZERODB_PROJECT_ID)
  3. Config file (~/.zerodb/config.json)
  4. 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zerodb_mem0-0.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zerodb_mem0-0.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file zerodb_mem0-0.1.0.tar.gz.

File metadata

  • Download URL: zerodb_mem0-0.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for zerodb_mem0-0.1.0.tar.gz
Algorithm Hash digest
SHA256 03c985549745584057ee827ddc405c53c0d08bb9e29e25c801457d4a5314dc57
MD5 7704e635bdc5363c8c360a4baa63f445
BLAKE2b-256 5a78875ff365682ce32dda7039327bc72a2c0b8cbfaa6fa938e6d8d22ddf9c92

See more details on using hashes here.

File details

Details for the file zerodb_mem0-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zerodb_mem0-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for zerodb_mem0-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4182b934054798ca4221932894a9f2ad755899140c439728fd55afefd4551cb3
MD5 7101f36efaba9dc5c4c99d95871658ef
BLAKE2b-256 47125fa067725d9f7d3b98d8adbfbb4fabe8b2a31a5a9ec0ef6c8c9eb6ec083b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page