Skip to main content

FalkorDB graph store plugin for Mem0

Project description

license PyPI version Codecov Forum Discord

mem0-falkordb

Try Free

FalkorDB graph store plugin for Mem0. Adds FalkorDB as a graph memory backend without modifying any Mem0 source code.

Installation

pip install mem0-falkordb

You also need Mem0 installed separately:

pip install mem0ai

Quick Start

from mem0_falkordb import register
register()

from mem0 import Memory

config = {
    "graph_store": {
        "provider": "falkordb",
        "config": {
            "host": "localhost",
            "port": 6379,
            "database": "mem0",
        },
    },
    # Add your LLM and embedder config as usual
    "llm": {
        "provider": "openai",
        "config": {"model": "gpt-4o-mini"},
    },
}

m = Memory.from_config(config)
m.add("I love pizza", user_id="alice")
results = m.search("what does alice like?", user_id="alice")

Configuration

Parameter Type Default Description
host str localhost FalkorDB server host
port int 6379 FalkorDB server port
database str mem0 Graph name prefix (each user gets {database}_{user_id})
username str None Authentication username (optional)
password str None Authentication password (optional)
base_label bool True Use __Entity__ base label

Per-User Graph Isolation

Each user automatically gets their own isolated FalkorDB graph (e.g. mem0_alice, mem0_bob). This leverages FalkorDB's native multi-graph support and provides:

  • Natural data isolation — no user_id filtering needed in Cypher queries
  • Simpler, faster queries — no WHERE clauses on user_id
  • Easy cleanupdelete_all simply drops the user's graph

Running FalkorDB

Using Docker:

docker run --rm -p 6379:6379 falkordb/falkordb

How It Works

This plugin uses Python's runtime patching to register FalkorDB into Mem0's existing factory system:

  1. GraphStoreFactory.provider_to_class gets a new "falkordb" entry
  2. GraphStoreConfig is patched to accept FalkorDBConfig
  3. A MemoryGraph class translates Mem0's graph operations to FalkorDB-compatible Cypher

Key Cypher Translations

Neo4j FalkorDB
elementId(n) id(n)
vector.similarity.cosine() db.idx.vector.queryNodes() procedure
db.create.setNodeVectorProperty() SET n.embedding = vecf32($vec)
CALL { ... UNION ... } subqueries Separate outgoing + incoming queries

Development

git clone <repo>
cd mem0-falkordb
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest

License

Apache-2.0

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

mem0_falkordb-0.3.2.tar.gz (99.3 kB view details)

Uploaded Source

Built Distribution

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

mem0_falkordb-0.3.2-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file mem0_falkordb-0.3.2.tar.gz.

File metadata

  • Download URL: mem0_falkordb-0.3.2.tar.gz
  • Upload date:
  • Size: 99.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mem0_falkordb-0.3.2.tar.gz
Algorithm Hash digest
SHA256 721a2cb90c0704933d71ec10d2ec98f79cf7cc254ce8015978222b4c529154f6
MD5 3671acf5f4460c83391712b2a5f83c1d
BLAKE2b-256 3a5b37a1fa7417f94d983c5e30b315a0eb7cc6838e502b8ca0bc83b267b244fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for mem0_falkordb-0.3.2.tar.gz:

Publisher: publish.yml on FalkorDB/mem0-falkordb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mem0_falkordb-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: mem0_falkordb-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mem0_falkordb-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f3010d63b0c2682ddd86ddb703bd7c0f420fd29a06692f6dc2e07a921205e773
MD5 ffebd38d6a0ed76195f282d5a8418e70
BLAKE2b-256 92cc8c29b9cf3947e7d3467bea5976618a1639f68a0a75dabeb40552f8d71df7

See more details on using hashes here.

Provenance

The following attestation bundles were made for mem0_falkordb-0.3.2-py3-none-any.whl:

Publisher: publish.yml on FalkorDB/mem0-falkordb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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