remove the change in vector_store_action_op

This commit is contained in:
caozouying.czy 2025-08-28 14:33:38 +08:00
parent 8dba31f2b2
commit 6decf51793
2 changed files with 3 additions and 44 deletions

View file

@ -42,7 +42,7 @@ flow:
type: "str"
description: "workspace id"
required: true
memory_dicts:
memory_list:
type: "list"
description: "A list of retrieved task memory corresponding to the current task."
required: true
@ -68,15 +68,6 @@ flow:
description: "The utility/freq threshold for deleting task memory."
required: true
agent_task:
flow_content: react_op
description: "A React-capable agent that can utilize web search and code execution tools."
input_schema:
query:
type: "str"
description: "current query"
required: true
vector_store:
flow_content: vector_store_action_op
description: "directly operate the vector store."
@ -105,23 +96,6 @@ flow:
description: "A list of conversation trajectory information, including message content and score. This field does not need to be filled in, the system will complete it automatically."
required: false
retrieve_task_memory_simple:
flow_content: build_query_op >> recall_vector_store_op >> merge_memory_op
description: "Retrieve the most relevant top_k memory experience from historical memory based on the query to help solve tasks better now"
input_schema:
query:
type: "str"
description: "current query"
required: true
summary_task_memory_simple:
flow_content: simple_summary_op >> update_vector_store_op
description: "Summarize trajectories or messages into memories"
input_schema:
trajectories:
type: "list"
description: "A list of conversation trajectory information, including message content and score. This field does not need to be filled in, the system will complete it automatically."
required: false
op:
# retriever ops

View file

@ -1,7 +1,7 @@
from flowllm import C, BaseLLMOp
from flowllm.schema.vector_node import VectorNode
from reme_ai.schema.memory import vector_node_to_memory, dict_to_experience, BaseMemory
from reme_ai.schema.memory import vector_node_to_memory, dict_to_memory, BaseMemory
@C.register_op()
@ -35,27 +35,12 @@ class VectorStoreActionOp(BaseLLMOp):
elif action == "load":
path: str = self.context.path
def memory_dict_to_node(memory_dict: dict) -> VectorNode:
memory: BaseMemory = dict_to_experience(memory_dict=memory_dict)
memory: BaseMemory = dict_to_memory(memory_dict=memory_dict)
return memory.to_vector_node()
result = self.vector_store.load_workspace(workspace_id=workspace_id,
path=path,
callback_fn=memory_dict_to_node)
elif action == "update_freq":
memory_ids: list = self.context.memory_ids
result = self.vector_store.update_freq(workspace_id=workspace_id, node_ids=memory_ids)
elif action == "update_utility":
memory_ids: list = self.context.memory_ids
result = self.vector_store.update_utility(workspace_id=workspace_id, node_ids=memory_ids)
elif action == "utility_based_delete":
freq_threshold: int = self.context.freq_threshold
utility_threshold: float = self.context.utility_threshold
result = self.vector_store.utility_based_delete(workspace_id=workspace_id,
freq_threshold=freq_threshold,
utility_threshold=utility_threshold)
else:
raise ValueError(f"invalid action={action}")