Skip to main content

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:
Update the configuration with your NebulaGraph connection details:
Note: MemMachine automatically creates the schema, graph type, and graph on startup - no manual database setup required!

Step 2: Update Episodic Memory Configuration

Point episodic memory to use NebulaGraph:

Step 3: Run MemMachine

That’s it! MemMachine will now use NebulaGraph for episodic memory storage.

Configuration Reference

Basic Configuration

Index Tuning

Control when indexes are created:

Vector Index Configuration

NebulaGraph supports two vector index algorithms: Balanced performance with good accuracy:
When to use IVF:
  • General-purpose applications
  • Large datasets (>100K vectors)
  • Need for fast indexing
  • Acceptable ~85-90% recall
Tuning guidelines:
  • 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:
When to use HNSW:
  • Precision-critical applications
  • Smaller datasets (<1M vectors)
  • Sufficient memory available
  • Need ~95-98% recall
Tuning guidelines:
  • 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: Key points:
  • COSINE always uses exact KNN search regardless of whether an index exists. NebulaGraph’s cosine() function does not support the APPROXIMATE keyword.
  • DOT (inner product) and COSINE are mathematically different: DOT is the raw dot product; COSINE normalizes by vector magnitudes.
  • MANHATTAN is not supported by NebulaGraph and will raise an error.
Disable ANN and always use exact vector search:
When to use exact search:
  • Small datasets (<10K vectors)
  • Require 100% recall
  • Debugging/testing

Getting Help