Skip to content

Fix #1469: [Bug修复] Neo4j社区版update_node未同步Qdrant + schedule依赖缺失导致Thread-3启动失败#1886

Open
Memtensor-AI wants to merge 1 commit into
dev-20260604-v2.0.19from
bugfix/autodev-1469
Open

Fix #1469: [Bug修复] Neo4j社区版update_node未同步Qdrant + schedule依赖缺失导致Thread-3启动失败#1886
Memtensor-AI wants to merge 1 commit into
dev-20260604-v2.0.19from
bugfix/autodev-1469

Conversation

@Memtensor-AI
Copy link
Copy Markdown
Collaborator

Description

Successfully fixed both issues in #1469:

Issue 1: Neo4j Community update_node not syncing to Qdrant

  • Root cause: Neo4jCommunityGraphDB inherited update_node from parent Neo4jGraphDB, which only updated Neo4j without syncing to the external Qdrant vector database
  • Solution: Implemented update_node override in Neo4jCommunityGraphDB that extracts embeddings from update fields and synchronizes them to Qdrant
  • Implementation handles edge cases: fetches memory content if not provided, gracefully handles Qdrant failures without blocking Neo4j updates
  • Added comprehensive test coverage in test_neo4j_community_update_node.py with 5 test scenarios

Issue 2: Schedule dependency missing for mem-scheduler

  • Root cause: The schedule package was only in tree-mem optional dependency group, but mem-scheduler uses TreeReorganizer which requires schedule for periodic structure optimization
  • Solution: Added schedule (>=1.2.2,<2.0.0) to mem-scheduler optional dependencies in pyproject.toml
  • This resolves Thread-3 startup failure when scheduler initializes tree memory features

Changes:

  • src/memos/graph_dbs/neo4j_community.py: Added 54-line update_node method with Qdrant sync
  • pyproject.toml: Added schedule dependency to mem-scheduler group
  • tests/graph_dbs/test_neo4j_community_update_node.py: New test file with 156 lines

All changes maintain backward compatibility and follow existing code patterns. The fixes ensure data consistency between Neo4j and Qdrant, and prevent import errors when using mem-scheduler with tree memory features.

Related Issue (Required): Fixes #1469

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

How Has This Been Tested?

Executor did not report tests.

  • Unit Test
  • Test Script Or Test Steps (please provide)
  • Pipeline Automated API Test (please provide)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have created related documentation issue/PR in MemOS-Docs (if applicable)
  • I have linked the issue to this PR (if applicable)
  • I have mentioned the person who will review this PR

@MatthewZhuang, @CarltonXiang, @syzsunshine219 please review this PR.

Reviewer Checklist

…dency to mem-scheduler

Issue #1469

Two bug fixes:

1. Neo4j Community update_node now syncs to Qdrant
   - Added update_node override in Neo4jCommunityGraphDB class
   - Extracts embedding from update fields and syncs to vector DB
   - Maintains data consistency between Neo4j and Qdrant
   - Gracefully handles Qdrant failures without blocking Neo4j update

2. Added schedule package to mem-scheduler dependencies
   - TreeReorganizer uses schedule for periodic structure optimization
   - Previously only in tree-mem optional group
   - Thread-3 startup failure resolved

Test: Added test_neo4j_community_update_node.py with comprehensive coverage
@Memtensor-AI
Copy link
Copy Markdown
Collaborator Author

✅ Automated Test Results: PASSED

All tests passed (35/35 executed, 36 skipped). memos_local_plugin/smoke: 0 passed, 1 skipped, memos_local_plugin/contract: 35 passed, 35 skipped. Duration: 4s

Branch: bugfix/autodev-1469

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated bug Something isn't working | 功能异常

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants