Skip to content

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

Closed as not planned

Description

@zwcf5200

问题描述

问题1:Neo4jCommunityGraphDB update_node未同步Qdrant payload

严重性:High
影响范围:所有使用Neo4j社区版的用户

问题详情:

  • Neo4jCommunityGraphDB继承父类update_node方法,只更新Neo4j数据库
  • 不同步关键字段(status, tags, memory_type等)到Qdrant向量数据库
  • 导致Neo4j和Qdrant状态不一致,搜索可能返回已归档的记忆

问题2:schedule依赖缺失导致Thread-3启动失败

严重性:Critical
影响范围:MemOS核心功能(冲突检测、记忆归档)

问题详情:

  • reorganizer.py使用@require_python_package("schedule")装饰器
  • docker/requirements.txt缺少schedule模块定义
  • Thread-3启动时ImportError,冲突检测功能失效

已修复(dev分支)

Commit历史

Commit 修复内容
f3e7597 Neo4jCommunityGraphDB update_node同步Qdrant payload
c2447d8 load_dotenv指定路径+override确保环境变量加载
37b2e0f requirements.txt添加schedule==1.2.2依赖
12651c3 Dockerfile.dev pip代理禁用配置

修复详情

问题1修复(src/memos/graph_dbs/neo4j_community.py):

async def update_node(self, node_id: str, properties: dict) -> None:
    """Update node in Neo4j and sync key fields to Qdrant."""
    # 先更新Neo4j
    await super().update_node(node_id, properties)
    
    # 同步关键字段到Qdrant
    sync_fields = {"status", "tags", "memory_type", "content", "sources"}
    payload_updates = {k: v for k, v in properties.items() if k in sync_fields}
    if payload_updates:
        await self._qdrant.set_payload(payload_updates, {"node_id": node_id})

问题2修复(docker/requirements.txt):

schedule==1.2.2

问题3修复(docker/Dockerfile.dev):

RUN unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY no_proxy && \
    pip config set global.proxy "" && \
    pip install --upgrade pip --proxy="" && \
    pip install --no-cache-dir --proxy="" -r requirements.txt

验证结果

✅ Thread-3正常启动(is_alive=true)
✅ 冲突检测功能正常工作
✅ Neo4j和Qdrant状态同步一致


相关Issue

Activity

  1. MysticEEEE commented on Apr 11, 2026

    @MysticEEEE

    发现了同样的问题,requirements.txt缺少了部分依赖,requirements-full.txt里面的依赖版本又不对,有冲突。pyproject.toml里面有些一些关键依赖,但是也没有更新完整。

  2. added a commit that references this issue on Apr 19, 2026
    3a3cf52
  3. added
    area:coreMOS 编排层 / 框架底座 / 跨模块问题
    ai:taskDispatched to AI coding agent | 已派发给 AI 编码任务
    on May 26, 2026
  4. added
    types:bugSomething isn't working | 功能异常
    ai:codingAI agent is coding | AI 正在编码
    on Jun 1, 2026
  5. self-assigned this
    on Jun 4, 2026
  6. Memtensor-AI commented on Jun 4, 2026

    @Memtensor-AI
    Collaborator

    🤖 AutoDev has picked up this issue and started working on it.

    Task ID: 5b4f94ef52c83ca6
    Working branch: bugfix/autodev-1469
    Target branch: main
    Workflow: opsp (analysis → coding → testing → PR)

    I will post the PR link here once done. If I need more information, I will ask in the comments.

  7. Memtensor-AI commented on Jun 4, 2026

    @Memtensor-AI
    Collaborator

    ❌ AutoDev task 5b4f94ef52c83ca6 failed.

    Summary: AutoDev executor crashed before producing a result.
    Error: Claude SDK query failed: Claude Code process exited with code 143

  8. Memtensor-AI commented on Jun 4, 2026

    @Memtensor-AI
    Collaborator

    🤖 AutoDev has picked up this issue and started working on it.

    Task ID: 5b4f94ef52c83ca6
    Working branch: bugfix/autodev-1469
    Target branch: dev-20260604-v2.0.19
    Workflow: opsp (analysis → coding → testing → PR)

    I will post the PR link here once done. If I need more information, I will ask in the comments.

  9. Memtensor-AI commented on Jun 4, 2026

    @Memtensor-AI
    Collaborator

    ✅ AutoDev task 5b4f94ef52c83ca6 completed.

    Summary: 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.

    Base branch: dev-20260604-v2.0.19
    Branch: bugfix/autodev-1469
    Commit: 530be6f
    PR: #1886
    Assigned to: @MatthewZhuang, @CarltonXiang, @syzsunshine219
    Reviewers: @MatthewZhuang, @CarltonXiang, @syzsunshine219

  10. added
    ai:testingAI agent is running tests | AI 正在运行测试
    and removed
    ai:codingAI agent is coding | AI 正在编码
    ai:testingAI agent is running tests | AI 正在运行测试
    ai:taskDispatched to AI coding agent | 已派发给 AI 编码任务
    on Jun 4, 2026
  11. added
    status:in-progressSomeone or AI is working on it | 人工或 AI 正在处理
    area:databasegraph_db + vector_db | 图数据库与向量数据库
    and removed
    types:bugSomething isn't working | 功能异常
    area:coreMOS 编排层 / 框架底座 / 跨模块问题
    on Jul 7, 2026
  12. added theissue type on Jul 7, 2026
  13. github-actions commented on Aug 7, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale due to inactivity.

  14. added
    status:staleAuto-marked stale after 30d inactivity; closes 7d later unless exempt.
    on Aug 7, 2026
  15. github-actions commented on Aug 20, 2026

    @github-actions
    Contributor

    This issue has been automatically closed due to inactivity.

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

Metadata

Metadata

Labels

area:databasegraph_db + vector_db | 图数据库与向量数据库status:in-progressSomeone or AI is working on it | 人工或 AI 正在处理status:staleAuto-marked stale after 30d inactivity; closes 7d later unless exempt.

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions