Merged
Conversation
…ublic into feat/neo4j-community
fridayL
approved these changes
Jul 21, 2025
Collaborator
fridayL
left a comment
There was a problem hiding this comment.
Code Review & Summary for PR #121 – Neo4j Community Edition Support
1. Neo4j Community Edition Support
-
New Classes & Configs
Neo4jCommunityGraphDBandNeo4jCommunityGraphDBConfigare introduced.- These provide Neo4j Community Edition compatibility by disabling multi-database and vector index features (which are enterprise-only).
-
User Isolation & Vector Database
- Enforces per-user isolation via a mandatory
user_namefield. - Embeddings are handled by an external vector database (Qdrant), not Neo4j itself.
- Enforces per-user isolation via a mandatory
-
Indexing
- Only creates basic B-tree property indexes on Neo4j.
- Vector payload indexes are managed in Qdrant.
-
Unsupported Operations
- Multi-DB, DB creation, and destructive DB drop operations are explicitly disallowed or raise clear errors.
2. Factory and Configuration Updates
- Factory Methods
- Both
GraphDBConfigFactoryandGraphStoreFactoryare updated to support the"neo4j-community"backend.
- Both
- Example Configuration
- A sample config file (
tree_config_community.json) is added showing how to use Neo4j Community with Qdrant for vectors.
- A sample config file (
3. Example Scripts
- Quickstart Example
simple_openapi_memos_neo4j_community.py: Shows how to set up MOS with OpenAI API, Neo4j Community, and Qdrant.- Demonstrates memory add/get/search, conversation, and filtering out embeddings from display results.
4. Vector DB Abstraction & Qdrant
- Interface Expansion
get_by_idsandensure_payload_indexesare now abstract methods in the base vector DB interface.- Qdrant backend implements these, allowing multi-id fetches and idempotent payload index creation.
5. Code Quality and Minor Changes
- Refactoring
- Node parsing logic is moved to instance methods for subclass extensibility.
- Unused debug and Chinese comments are removed.
- Bug Fixes
- Fixes around node parsing, edge deletion, and property handling.
Summary
This PR enables MemOS to use Neo4j Community Edition as a graph backend by:
- Separating enterprise-specific logic,
- Integrating Qdrant for vector search,
- Enforcing per-user logical isolation,
- Providing clear example usage and configuration.
Impact:
Greatly broadens deployability—users can now run MemOS with open-source Neo4j and Qdrant, no enterprise license needed.
Code Quality:
Code is modular and maintainable, with good extensibility for future data backends.
Overall:
A significant improvement for open-source and multi-tenant deployments. Well-structured, well-documented, and easy to adopt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary:
feat: support Neo4j Community Edition with Qdrant integration
user_nameget_by_idsandensure_payload_indexesin base VecDB interfaceneo4j-communitybackendtree_config_community.jsonas an example config using Neo4j Community + Qdrantsimple_openapi_memos_neo4j_community.pyto demonstrate core functionality:This change enables full MemOS support for open-source Neo4j deployments, expanding accessibility and ease of adoption.
Fix: #95
Reviewer: @(reviewer)
Checklist: