Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
spike-spiegel-21 committed Dec 31, 2024
1 parent d5ad209 commit f0bd050
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mem0/memory/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,9 @@ def _add_to_vector_store(self, messages, metadata, filters):
def _add_to_graph(self, messages, filters):
added_entities = []
if self.api_version == "v1.1" and self.enable_graph:
if filters.get("user_id"):
filters["user_id"] = filters["user_id"]
else:
if filters.get("user_id") is None:
filters["user_id"] = "user"

data = "\n".join([msg["content"] for msg in messages if "content" in msg and msg["role"] != "system"])
added_entities = self.graph.add(data, filters)

Expand Down

0 comments on commit f0bd050

Please sign in to comment.