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: reset (#169)

cachhof3888cc7a871
diff --git a/README.md b/README.md
index e28aedefa..4636f841a 100644
--- a/README.md
+++ b/README.md
@@ -323,6 +323,15 @@ All options for query and...
*coming soon*
+## Other methods
+
+### Reset
+Resets the database and deletes all embeddings. Irreversible. Requires reinitialization afterwards.
+
+```python
+app.reset()
+```
+
# How does it work?
Creating a chat bot over any dataset needs the following steps to happen
diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py
index 12a6697a6..2835171e0 100644
--- a/embedchain/embedchain.py
+++ b/embedchain/embedchain.py
@@ -299,6 +299,14 @@ class EmbedChain:
return prompt
+ def reset(self):
+ """
+ Resets the database. Deletes all embeddings irreversibly.
+ `App` has to be reinitialized after using this method.
+ """
+ self.db_client.reset()
+
+
class App(EmbedChain):
"""
The EmbedChain app.