Skip to content

The agent engineering platform.

Session deletion method in motorhead memory (#6609)

Hrag Balian2518e6c95b37
diff --git a/langchain/memory/motorhead_memory.py b/langchain/memory/motorhead_memory.py
index 4113265e13..56576f15a2 100644
--- a/langchain/memory/motorhead_memory.py
+++ b/langchain/memory/motorhead_memory.py
@@ -86,3 +86,7 @@ class MotorheadMemory(BaseChatMemory):
headers=self.__get_headers(),
)
super().save_context(inputs, outputs)
+
+ def delete_session(self) -> None:
+ """Delete a session"""
+ requests.delete(f"{self.url}/sessions/{self.session_id}/memory")