The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.
Python agentic-memoryagentic-memory-systemagentsaiai-agentschatgptgenaillmlong-term-memorymemorymemory-managementpythonragstate-management
Fix pytests (#2157)
Dev Khanta9d13839091a
diff --git a/tests/vector_stores/test_elasticsearch.py b/tests/vector_stores/test_elasticsearch.pyindex c4c7a1708..ed1872b66 100644--- a/tests/vector_stores/test_elasticsearch.py+++ b/tests/vector_stores/test_elasticsearch.py@@ -196,27 +196,31 @@ class TestElasticsearchDB(unittest.TestCase):}}self.client_mock.search.return_value = mock_response-+# Perform searchquery_vector = [0.1] * 1536results = self.es_db.search(query=query_vector, limit=5)-+# Verify search callself.client_mock.search.assert_called_once()search_args = self.client_mock.search.call_args[1]-+# Verify search parametersself.assertEqual(search_args["index"], "test_collection")body = search_args["body"]- self.assertIn("script_score", body["query"])- self.assertEqual(- body["query"]["script_score"]["script"]["params"]["query_vector"],- query_vector- )+ # Verify KNN query structure+ self.assertIn("query", body)+ self.assertIn("bool", body["query"])+ self.assertIn("must", body["query"]["bool"])++ # Verify KNN parameters+ knn_query = body["query"]["bool"]["must"][-1]["knn"]["vector"]+ self.assertEqual(knn_query["vector"], query_vector)+ self.assertEqual(knn_query["k"], 5)+# Verify resultsself.assertEqual(len(results), 1)- self.assertIsInstance(results[0], OutputData)self.assertEqual(results[0].id, "id1")self.assertEqual(results[0].score, 0.8)self.assertEqual(results[0].payload, {"key1": "value1"})