mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-11 22:51:10 +00:00
add conditional delete
This commit is contained in:
parent
2c14b958a9
commit
46ce7d8cb7
1 changed files with 4 additions and 0 deletions
|
|
@ -95,6 +95,10 @@ class LlamaIndexEsMemoryStore(BaseMemoryStore):
|
|||
def delete(self, node: MemoryNode):
|
||||
return self.es_store.delete(node.memory_id)
|
||||
|
||||
def delete_conditional(self, filter_dict: Dict = {}):
|
||||
nodes = self.retrieve_memories(filter_dict=filter_dict, top_k=10000)
|
||||
self.batch_delete(nodes)
|
||||
|
||||
def update(self, node: MemoryNode, update_embedding: bool = True):
|
||||
# TODO update without embedding?
|
||||
self.delete(node)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue