mem0ai-azure-mysql 0.1.116.2__py3-none-any.whl → 0.1.116.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -114,6 +114,8 @@ class MemoryGraph:
114
114
  logger.info(f"Searching for query in neo4j: {query} with filters: {filters}")
115
115
  entity_type_map = self._retrieve_nodes_from_data(query, filters)
116
116
  search_output = self._search_graph_db(node_list=list(entity_type_map.keys()), filters=filters)
117
+ print(f'entity_type_map: {entity_type_map}')
118
+ print(f'search_output: {search_output}')
117
119
 
118
120
  if not search_output:
119
121
  return []
@@ -156,12 +158,14 @@ class MemoryGraph:
156
158
  base_url=rerank_config.get("base_url"),
157
159
  )
158
160
  docs = [f'{item["source"]} {item["relationship"]} {item["destination"]}' for item in search_output]
161
+ print(f'docs: {docs}')
159
162
  response = co.rerank(
160
163
  model=rerank_config.get("model"),
161
164
  query=query,
162
165
  documents=docs,
163
166
  top_n=self.top_k,
164
167
  )
168
+ print(f'response.results: {response.results}')
165
169
 
166
170
  reranked_results = []
167
171
  for result in response.results:
@@ -172,6 +176,7 @@ class MemoryGraph:
172
176
  original_output["destination"],
173
177
  result.relevance_score
174
178
  ])
179
+ print(f'reranked_results: {reranked_results}')
175
180
  return reranked_results
176
181
 
177
182
  def delete_all(self, filters):
@@ -362,7 +367,16 @@ class MemoryGraph:
362
367
  ans = self.graph.query(cypher_query, params=params)
363
368
  result_relations.extend(ans)
364
369
 
365
- return result_relations
370
+ # Remove duplicates, key is (source, relationship, destination)
371
+ seen = set()
372
+ unique_relations = []
373
+ for rel in result_relations:
374
+ key = (rel["source"], rel["relationship"], rel["destination"])
375
+ if key not in seen:
376
+ seen.add(key)
377
+ unique_relations.append(rel)
378
+
379
+ return unique_relations
366
380
 
367
381
  def _get_delete_entities_from_search_output(self, search_output, data, filters):
368
382
  """Get the entities to be deleted from the search output."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mem0ai-azure-mysql
3
- Version: 0.1.116.2
3
+ Version: 0.1.116.3
4
4
  Summary: Long-term memory for AI Agents with Azure DefaultAzureCredential authentication and MySQL history database support
5
5
  Requires-Python: <4.0,>=3.9
6
6
  Requires-Dist: azure-identity>=1.23.1
@@ -88,7 +88,7 @@ mem0/llms/vllm.py,sha256=vVrz7uGjNqVgX3YNBLWNWA4ctEVK9sZxxaOOKYRQQdM,3802
88
88
  mem0/llms/xai.py,sha256=pUdxDH0-p1fVct66IMMkMl3Rgcdm1d4ko2aOT6feYWU,1764
89
89
  mem0/memory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
90
90
  mem0/memory/base.py,sha256=uwk-rL60CbErBDt9-bMVK4laALtc4wd2oeVskVzxd3c,1315
91
- mem0/memory/graph_memory.py,sha256=xjFqkXa0lhAgHlIwdsMu11jT34dZG81VOCmlflbaqTk,32019
91
+ mem0/memory/graph_memory.py,sha256=45OxECfg-wj17nRSWJ0RN5vim91skY3SPCO4jwK9opM,32605
92
92
  mem0/memory/kuzu_memory.py,sha256=ootVNrq9KLw3uV-MdCuC-ZjAHiafWOi0AVpjkcGDFOI,30338
93
93
  mem0/memory/main.py,sha256=8BmnRKIeRxO5hZ9tivEDjv087JYYpbP1EtLR0H_Syn0,76818
94
94
  mem0/memory/memgraph_memory.py,sha256=Kg8sk-YSCK2bR9qHcRWPkuBqMugHznD34qLpQjjgZ1E,27870
@@ -120,7 +120,7 @@ mem0/vector_stores/supabase.py,sha256=RCegadYW4Q8CT_NSeCywUVW01TLJQT4mDzeStNHEJH
120
120
  mem0/vector_stores/upstash_vector.py,sha256=dAIef-bIB6AE_dVR8UpVWZUPQs-wLhqfxEHyyXO5kQU,9073
121
121
  mem0/vector_stores/vertex_ai_vector_search.py,sha256=RaaPLTTbTPftlg7nm9WTROOhurSxqnAyx-g3tYoxv0I,24659
122
122
  mem0/vector_stores/weaviate.py,sha256=v91CA79Z_zJBohwaXlOW6jtudDlGq0kYKQFHMHGqUy4,11833
123
- mem0ai_azure_mysql-0.1.116.2.data/data/README.md,sha256=1kzUMONek69u8WrI7zxwFevzYBYiI7-1NTLjSl8_6kg,1235
124
- mem0ai_azure_mysql-0.1.116.2.dist-info/METADATA,sha256=Vv4AcU-LaxIyGcrHm63MSZpGN0rTgJitYsn0ITdyAgg,4155
125
- mem0ai_azure_mysql-0.1.116.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
126
- mem0ai_azure_mysql-0.1.116.2.dist-info/RECORD,,
123
+ mem0ai_azure_mysql-0.1.116.3.data/data/README.md,sha256=1kzUMONek69u8WrI7zxwFevzYBYiI7-1NTLjSl8_6kg,1235
124
+ mem0ai_azure_mysql-0.1.116.3.dist-info/METADATA,sha256=TbxK0ZR_1-XLew5KMypKxALUt_XaPh4Uv7TfyCFJg2o,4155
125
+ mem0ai_azure_mysql-0.1.116.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
126
+ mem0ai_azure_mysql-0.1.116.3.dist-info/RECORD,,