MobileAgent
MobileAgent copied to clipboard
Memory issue
Is there any problem with the memory part? The variable insight here seems to be an empty string all the time. What is the purpose of this variable?
if memory_switch:
prompt_memory = get_memory_prompt(insight)
chat_action = add_response("user", prompt_memory, chat_action)
output_memory = inference_chat(chat_action, 'gpt-4o', API_url, token)
chat_action = add_response("assistant", output_memory, chat_action)
status = "#" * 50 + " Memory " + "#" * 50
print(status)
print(output_memory)
print('#' * len(status))
output_memory = output_memory.split("### Important content ###")[-1].split("\n\n")[0].strip() + "\n"
if "None" not in output_memory and output_memory not in memory:
memory += output_memory
If your task does not require remembering task-related content, the agent will not add anything to the memory unit. This has the benefit of reducing the interference of irrelevant information.