Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

feat: Show new chunk count when adding a dataset (#207)

cachho13bac72e25f2
diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py
index ff4d94c19..c944ecfee 100644
--- a/embedchain/embedchain.py
+++ b/embedchain/embedchain.py
@@ -102,12 +102,14 @@ class EmbedChain:
ids = list(data_dict.keys())
documents, metadatas = zip(*data_dict.values())
+ chunks_before_addition = self.count()
+
self.collection.add(
documents=documents,
metadatas=list(metadatas),
ids=ids
)
- print(f"Successfully saved {src}. Total chunks count: {self.collection.count()}")
+ print(f"Successfully saved {src}. New chunks count: {self.count() - chunks_before_addition}")
def _format_result(self, results):
return [