Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ rich-toolkit==0.15.1
rignore==0.7.6
rpds-py==0.28.0
safetensors==0.6.2
schedule==1.2.2
scikit-learn==1.7.2
scipy==1.16.3
sentry-sdk==2.44.0
Expand Down
22 changes: 22 additions & 0 deletions src/memos/graph_dbs/neo4j_community.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,28 @@ def add_nodes_batch(self, nodes: list[dict[str, Any]], user_name: str | None = N
logger.error(f"[add_nodes_batch] Failed to add nodes: {e}", exc_info=True)
raise

def update_node(self, id: str, fields: dict[str, Any], user_name: str | None = None) -> None:
"""
Update node in Neo4j and sync key fields to Qdrant payload.

The parent implementation only updates Neo4j. For the community edition, which
relies on an external vector DB (Qdrant), key status/metadata fields must also
be propagated to the Qdrant payload so that vector searches reflect the latest
node state (e.g. archived memories are excluded correctly).
"""
super().update_node(id, fields, user_name)

sync_fields = {"status", "tags", "memory_type", "content", "sources"}
payload_updates = {k: v for k, v in fields.items() if k in sync_fields}
if payload_updates and self.vec_db:
try:
self.vec_db.update(id, VecDBItem(id=id, vector=None, payload=payload_updates))
except Exception as e:
logger.warning(
f"[update_node] Failed to sync fields {list(payload_updates)} "
f"to Qdrant for node {id}: {e}"
)

def get_children_with_embeddings(
self, id: str, user_name: str | None = None
) -> list[dict[str, Any]]:
Expand Down
Loading