Skip to content

Add NebulaGraph Enterprise 5.2.1 Support for Episodic Memory#1054

Merged
sscargal merged 8 commits into
MemMachine:mainfrom
wenhaocs:haowen/nebula5.0
Mar 13, 2026
Merged

Add NebulaGraph Enterprise 5.2.1 Support for Episodic Memory#1054
sscargal merged 8 commits into
MemMachine:mainfrom
wenhaocs:haowen/nebula5.0

Conversation

@wenhaocs

@wenhaocs wenhaocs commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Purpose of the change

This PR adds NebulaGraph Enterprise as an alternative vector graph store backend for episodic memory, alongside the existing Neo4j support. Users can now choose between Neo4j and NebulaGraph based on their deployment and scalability needs.

Description

Motivation

NebulaGraph has the follow features:

  • High performance dual read and write, with high QPS and low latency
  • Separete compute and storage architecture allows for large dataset and high QPS scenarios with indepdent 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.

Core Implementation

  1. Add src/memmachine/common/vector_graph_store/nebula_graph_vector_graph_store.py which implements vector_graph_store.py

  2. Added NebulaGraphConf in src/memmachine/common/configuration/database_conf.py

  3. Added NebulaGraph client management to src/memmachine/common/resource_manager/database_manager.py

  4. Added nebula = ["nebula5-python>=5.0.0"] optional dependency

Fixes/Closes

Fixes #(issue number)

Type of change

[Please delete options that are not relevant.]

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g., code style improvements, linting)
  • Documentation update
  • Project Maintenance (updates to build scripts, CI, etc., that do not affect the main project)
  • Security (improves security without changing functionality)

How Has This Been Tested?

All Nebula related tests are base on a local Nebula cluster.
Note that the CI environment does not have Nebula cluster set yet. These tests will be skipped until the environment is ready.

New Test Files:

  • tests/memmachine/common/vector_graph_store/test_nebula_graph_vector_graph_store.py
    • 12 integration tests

Enhanced Test Files:

  • tests/memmachine/episodic_memory/declarative_memory/test_declarative_memory.py
  • tests/memmachine/episodic_memory/long_term_memory/test_long_term_memory.py
  • Added parameterized fixtures for both Neo4j and NebulaGraph

[Please delete options that are not relevant.]

  • Unit Test
  • Integration Test
  • End-to-end Test
  • Test Script (please provide)
  • Manual verification (list step-by-step instructions)

Test Results: [Attach logs, screenshots, or relevant output]

Checklist

[Please delete options that are not relevant.]

  • I have signed the commit(s) within this pull request
  • My code follows the style guidelines of this project (See STYLE_GUIDE.md)
  • I have performed a self-review of my own code
  • I have commented my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • Confirmed all checks passed
  • Contributor has signed the commit(s)
  • Reviewed the code
  • Run, Tested, and Verified the change(s) work as expected

Screenshots/Gifs

[If applicable, add screenshots or GIFs that show the changes in action. This is especially helpful for API responses. Otherwise, delete this section or type "N/A".]

Further comments

[Add any other relevant information here, such as potential side effects, future considerations, or any specific questions for the reviewer. Otherwise, type "None".]

@wenhaocs wenhaocs marked this pull request as ready for review February 6, 2026 00:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds NebulaGraph Enterprise 5.x as an alternative vector graph store backend for episodic memory, alongside existing Neo4j support.

Changes:

  • Introduces NebulaGraphVectorGraphStore implementation and wiring via DatabaseManager + new NebulaGraphConf.
  • Adds NebulaGraph optional dependency extras and new/updated integration tests to exercise both backends.
  • Adds documentation for NebulaGraph setup and updates install guide to reflect optional graph DB choice.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/memmachine/episodic_memory/long_term_memory/test_long_term_memory.py Adds NebulaGraph fixtures and parametrizes tests to run on Neo4j and NebulaGraph.
tests/memmachine/episodic_memory/declarative_memory/test_declarative_memory.py Same parametrization approach for declarative memory tests across both backends.
tests/memmachine/common/vector_graph_store/test_nebula_graph_vector_graph_store.py Adds NebulaGraph vector graph store integration test suite.
src/memmachine/common/vector_graph_store/nebula_graph_vector_graph_store.py Implements NebulaGraph-backed VectorGraphStore including vector search, schema/index management, CRUD.
src/memmachine/common/resource_manager/database_manager.py Adds optional NebulaGraph client lifecycle management and backend auto-detection in get_vector_graph_store.
src/memmachine/common/configuration/database_conf.py Adds NebulaGraphConf and extends supported providers + parsing/serialization.
pyproject.toml Adds nebula optional dependency group.
packages/server/pyproject.toml Adds nebula optional dependency group for the server package.
docs/nebula_graph_integration_guide.mdx New integration guide for NebulaGraph setup and tuning.
docs/install_guide/install_guide.mdx Updates install instructions to allow choosing Neo4j or NebulaGraph Enterprise.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/memmachine/common/resource_manager/database_manager.py
Comment thread docs/nebula_graph_integration_guide.mdx Outdated
Comment thread src/memmachine/common/vector_graph_store/nebula_graph_vector_graph_store.py Outdated
Comment thread src/memmachine/common/vector_graph_store/nebula_graph_vector_graph_store.py Outdated
Comment thread src/memmachine/common/vector_graph_store/nebula_graph_vector_graph_store.py Outdated
Comment thread tests/memmachine/episodic_memory/declarative_memory/test_declarative_memory.py Outdated
@o-love o-love requested a review from edwinyyyu February 6, 2026 22:20

@sscargal sscargal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wenhaocs Please review and address the items highlighted by CoPilot. Thanks.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/memmachine/episodic_memory/declarative_memory/test_declarative_memory.py Outdated
Comment thread tests/memmachine/episodic_memory/long_term_memory/test_long_term_memory.py Outdated
Comment thread src/memmachine/common/vector_graph_store/nebula_graph_vector_graph_store.py Outdated
@sscargal

Copy link
Copy Markdown
Contributor

Thanks for the updates.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/nebula_graph_integration_guide.mdx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/memmachine/common/vector_graph_store/nebula_graph_vector_graph_store.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/nebula_graph_integration_guide.mdx
Comment thread docs/nebula_graph_integration_guide.mdx
Comment thread src/memmachine/common/vector_graph_store/nebula_graph_vector_graph_store.py Outdated
@wenhaocs wenhaocs changed the title Add NebulaGraph Enterprise 5.0 Support for Episodic Memory Add NebulaGraph Enterprise 5.2.1 Support for Episodic Memory Feb 13, 2026
@wenhaocs wenhaocs requested a review from Copilot February 17, 2026 20:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml Outdated
Comment thread docs/nebula_graph_integration_guide.mdx Outdated
Comment thread src/memmachine/common/vector_graph_store/neo4j_vector_graph_store.py Outdated
Comment thread src/memmachine/common/vector_graph_store/nebula_graph_vector_graph_store.py Outdated
Comment thread src/memmachine/common/configuration/database_conf.py Outdated
Comment thread src/memmachine/common/vector_graph_store/nebula_graph_vector_graph_store.py Outdated
Comment thread src/memmachine/common/vector_graph_store/nebula_graph_vector_graph_store.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/server/pyproject.toml Outdated
Comment thread tests/memmachine/episodic_memory/long_term_memory/test_long_term_memory.py Outdated
Comment thread docs/nebula_graph_integration_guide.mdx

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/memmachine/common/vector_graph_store/nebula_graph_vector_graph_store.py Outdated
Comment thread sample_configs/episodic_memory_config.nebula.sample Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/memmachine/common/vector_graph_store/nebula_graph_vector_graph_store.py Outdated
Comment thread src/memmachine/common/vector_graph_store/nebula_graph_vector_graph_store.py Outdated
Comment thread src/memmachine/common/vector_graph_store/nebula_graph_vector_graph_store.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/memmachine/common/configuration/database_conf.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/memmachine/common/resource_manager/database_manager.py Outdated
wenhaocs added 3 commits March 6, 2026 15:13
fix test

fix todo

update config

Now nebula testing is optional until the ci environment is set. Add an integration doc.

5.2.0

address comments

add conftest

address comment of fixed credentials

address comments

Update docs/nebula_graph_integration_guide.mdx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: haowen <19355821+wenhaocs@users.noreply.github.com>

exclude bool check in int check

create range index when the number of nodes reach the threshold

create embedding for edges and add range index for future extendibility

handle different metric type

fix doc string

fix doc string

address comments

add more test cases and fix bugs

remove backticks and unify version in the doc string

sanitize

fix comment

fix comment

Signed-off-by: wenhaocs <19355821+wenhaocs@users.noreply.github.com>
- Change memmachine.common.* to memmachine_server.common.*
- Use OrderedValue instead of OrderedPropertyValue
- Update nebula-related imports for new package structure
- All 28 tests passing

Signed-off-by: wenhaocs <19355821+wenhaocs@users.noreply.github.com>
Signed-off-by: wenhaocs <19355821+wenhaocs@users.noreply.github.com>
@sscargal sscargal added this to the v0.3.1 milestone Mar 11, 2026
Signed-off-by: wenhaocs <19355821+wenhaocs@users.noreply.github.com>
Signed-off-by: wenhaocs <19355821+wenhaocs@users.noreply.github.com>
Signed-off-by: wenhaocs <19355821+wenhaocs@users.noreply.github.com>
Signed-off-by: wenhaocs <19355821+wenhaocs@users.noreply.github.com>

@sscargal sscargal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sscargal sscargal merged commit 09a837e into MemMachine:main Mar 13, 2026
45 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants