NebulaGraph Enterprise Integration Guide
This guide explains how to use NebulaGraph Enterprise as the vector graph store backend for MemMachine’s episodic memory.Overview
MemMachine now supports NebulaGraph Enterprise for episodic memory storage. NebulaGraph provides:- High performance dual read and write, with high QPS and low latency
- Separate compute and storage architecture allows for large dataset and high QPS scenarios with independent scaling
- GQL (ISO/IEC 76120) - standardized graph query language
- Horizontal scalability for large-scale deployments
- Enterprise-grade features including high availability, 0-downtime update & upgrade, LDAP, backup/restore, monitoring, etc.
Prerequisites
1. NebulaGraph Enterprise
You need NebulaGraph Enterprise 5.2.1 or later. NebulaGraph is designed to handle graphs with trillions of edges and vertices and delivers millisecond latency at high concurrency, enabling real-time insights where performance matters most.2. Python Dependencies
Install the NebulaGraph Python client:Quick Start
Step 1: Configure MemMachine
Use the sample configuration file:Step 2: Update Episodic Memory Configuration
Point episodic memory to use NebulaGraph:Step 3: Run MemMachine
Configuration Reference
Basic Configuration
Index Tuning
Control when indexes are created:Vector Index Configuration
NebulaGraph supports two vector index algorithms:IVF (Inverted File Index) - Recommended for Most Use Cases
Balanced performance with good accuracy:- General-purpose applications
- Large datasets (>100K vectors)
- Need for fast indexing
- Acceptable ~85-90% recall
ivf_nlist: 256 (default), 512 (large datasets), 1024 (very large datasets)ivf_nprobe: 8 (default), 16 (higher accuracy), 32 (maximum accuracy)
HNSW (Hierarchical Navigable Small World) - For High Accuracy
Higher recall with more memory usage:- Precision-critical applications
- Smaller datasets (<1M vectors)
- Sufficient memory available
- Need ~95-98% recall
hnsw_max_degree: 16 (default), 32 (high accuracy), 64 (maximum accuracy)hnsw_ef_construction: 200 (default), 400 (better quality)hnsw_ef_search: 40 (default), 100 (higher recall), 200 (maximum recall)
Similarity Metric Support
NebulaGraph has native support for three of the four similarity metrics. The search mode (ANN or KNN) depends on both index availability and the metric’s capabilities:| Metric | NebulaGraph Function | Index Metric | ANN Supported? |
|---|---|---|---|
EUCLIDEAN | euclidean() ASC | L2 | Yes — vector index required |
DOT | inner_product() DESC | IP | Yes — vector index required |
COSINE | cosine() DESC | — | No — KNN only (NebulaGraph limitation) |
MANHATTAN | — | — | No — unsupported, raises error |
COSINEalways uses exact KNN search regardless of whether an index exists. NebulaGraph’scosine()function does not support theAPPROXIMATEkeyword.DOT(inner product) andCOSINEare mathematically different: DOT is the raw dot product; COSINE normalizes by vector magnitudes.MANHATTANis not supported by NebulaGraph and will raise an error.
Force Exact Search
Disable ANN and always use exact vector search:- Small datasets (<10K vectors)
- Require 100% recall
- Debugging/testing
Getting Help
- MemMachine Issues: https://github.com/memm-ai/memmachine/issues
- NebulaGraph Website: https://www.nebula-graph.io/

