Skip to content
Merged
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
4 changes: 2 additions & 2 deletions src/backend/base/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ faiss = [
"faiss-cpu==1.9.0.post1; python_version<'3.14'",
"faiss-cpu>=1.13.2; python_version>='3.14'",
]
qdrant = ["qdrant-client==1.9.2"]
qdrant = ["qdrant-client>=1.12.0,<2.0.0"]
weaviate = ["weaviate-client>=4.10.2,<5.0.0"]
chroma = [
"chromadb>=1.0.0,<2.0.0",
Expand Down Expand Up @@ -312,7 +312,7 @@ composio = [
ragstack = ["ragstack-ai-knowledge-store==0.2.1; python_version < '3.13'"]
opensearch = ["opensearch-py==2.8.0"]
atlassian = ["atlassian-python-api==3.41.16"]
mem0 = ["mem0ai>=0.1.34"]
mem0 = ["mem0ai>=2.0.2,<3.0.0"]
needle = ["needle-python>=0.4.0"]
sseclient = ["sseclient-py==1.8.0"]
openinference = ["openinference-instrumentation-langchain>=0.1.29"]
Expand Down
18 changes: 9 additions & 9 deletions src/backend/base/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Unit tests for Mem0MemoryComponent cloud validation."""

import os
from unittest.mock import patch
from unittest.mock import Mock, patch

import pytest
from lfx.components.mem0.mem0_chat_memory import Mem0MemoryComponent
Expand Down Expand Up @@ -29,3 +29,34 @@ def test_build_mem0_works_when_not_in_cloud(self, mock_memory):
component = Mem0MemoryComponent(openai_api_key="test-key")
component.build_mem0()
mock_memory.assert_called_once()

def test_build_search_results_uses_mem0_2_filters_for_search(self):
"""Test that search uses filters for Mem0 2.x entity scoping."""
memory = Mock()
memory.search.return_value = [{"memory": "hello"}]
component = Mem0MemoryComponent(_user_id="u").set(
existing_memory=memory,
ingest_message="hello",
search_query="x",
)

result = component.build_search_results()

assert result == [{"memory": "hello"}]
memory.add.assert_called_once_with("hello", user_id="u", metadata={})
memory.search.assert_called_once_with(query="x", filters={"user_id": "u"})

def test_build_search_results_uses_mem0_2_filters_for_get_all(self):
"""Test that get_all uses filters for Mem0 2.x entity scoping."""
memory = Mock()
memory.get_all.return_value = [{"memory": "hello"}]
component = Mem0MemoryComponent(_user_id="u").set(
existing_memory=memory,
ingest_message="hello",
)

result = component.build_search_results()

assert result == [{"memory": "hello"}]
memory.add.assert_called_once_with("hello", user_id="u", metadata={})
memory.get_all.assert_called_once_with(filters={"user_id": "u"})
Loading
Loading