From d8fe8ec48f61e4e463f5b833df4fb93563faf5ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=AD=E9=98=B3=E9=98=B3?= Date: Wed, 6 Aug 2025 20:42:33 +0800 Subject: [PATCH] feat: illumination fix --- src/memos/graph_dbs/neo4j.py | 16 ---------------- src/memos/templates/mem_reader_prompts.py | 2 ++ 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/memos/graph_dbs/neo4j.py b/src/memos/graph_dbs/neo4j.py index 666bf030..86e1b5d7 100644 --- a/src/memos/graph_dbs/neo4j.py +++ b/src/memos/graph_dbs/neo4j.py @@ -332,9 +332,6 @@ def get_node(self, id: str, include_embedding: bool = True) -> dict[str, Any] | Returns: Dictionary of node fields, or None if not found. """ - logger.warning( - "[Neo4jGraphDB.get_node] `include_embedding=False` is not supported in Neo4j. Ignoring this flag." - ) where_user = "" params = {"id": id} @@ -361,9 +358,6 @@ def get_nodes(self, ids: list[str], include_embedding: bool = True) -> list[dict - Assumes all provided IDs are valid and exist. - Returns empty list if input is empty. """ - logger.warning( - "[Neo4jGraphDB.get_node] `include_embedding=False` is not supported in Neo4j. Ignoring this flag." - ) if not ids: return [] @@ -849,9 +843,6 @@ def export_graph(self, include_embedding: bool = True) -> dict[str, Any]: "edges": [ { "source": ..., "target": ..., "type": ... }, ... ] } """ - logger.warning( - "[Neo4jGraphDB.get_node] `include_embedding=False` is not supported in Neo4j. Ignoring this flag." - ) with self.driver.session(database=self.db_name) as session: # Export nodes node_query = "MATCH (n:Memory)" @@ -935,10 +926,6 @@ def get_all_memory_items(self, scope: str, include_embedding: bool = True) -> li Returns: list[dict]: Full list of memory items under this scope. """ - if include_embedding: - logger.warning( - "[Neo4jGraphDB.get_node] `include_embedding=True` is not supported in Neo4j. Ignoring this flag." - ) if scope not in {"WorkingMemory", "LongTermMemory", "UserMemory", "OuterMemory"}: raise ValueError(f"Unsupported memory type scope: {scope}") @@ -967,9 +954,6 @@ def get_structure_optimization_candidates( - Isolated nodes, nodes with empty background, or nodes with exactly one child. - Plus: the child of any parent node that has exactly one child. """ - logger.warning( - "[Neo4jGraphDB.get_node] `include_embedding=True` is not supported in Neo4j. Ignoring this flag." - ) where_clause = """ WHERE n.memory_type = $scope diff --git a/src/memos/templates/mem_reader_prompts.py b/src/memos/templates/mem_reader_prompts.py index 412424c2..c1d982f9 100644 --- a/src/memos/templates/mem_reader_prompts.py +++ b/src/memos/templates/mem_reader_prompts.py @@ -2,6 +2,8 @@ Your task is to extract memories from the perspective of user, based on a conversation between user and assistant. This means identifying what user would plausibly remember — including their own experiences, thoughts, plans, or relevant statements and actions made by others (such as assistant) that impacted or were acknowledged by user. Please perform: 1. Identify information that reflects user's experiences, beliefs, concerns, decisions, plans, or reactions — including meaningful input from assistant that user acknowledged or responded to. +If the message is from the user, extract user-relevant memories; if it is from the assistant, only extract factual memories that the user acknowledged or responded to. + 2. Resolve all time, person, and event references clearly: - Convert relative time expressions (e.g., “yesterday,” “next Friday”) into absolute dates using the message timestamp if possible. - Clearly distinguish between event time and message time.