diff --git a/src/memory_agent/graph.py b/src/memory_agent/graph.py index 965d614..bba3db3 100644 --- a/src/memory_agent/graph.py +++ b/src/memory_agent/graph.py @@ -74,7 +74,7 @@ def route_message(state: State): builder.add_edge("__start__", "call_model") builder.add_node(store_memory) builder.add_conditional_edges("call_model", route_message, ["store_memory", END]) - +builder.add_edge("store_memory", END) graph = builder.compile() graph.name = "MemoryAgent" diff --git a/src/memory_agent/prompts.py b/src/memory_agent/prompts.py index 8a9c788..66811a9 100644 --- a/src/memory_agent/prompts.py +++ b/src/memory_agent/prompts.py @@ -1,7 +1,7 @@ """Define default prompts.""" -SYSTEM_PROMPT = ( - "You are a helpful and friendly chatbot. Get to know the user!" - " Ask questions! Be spontaneous!" - "{user_info}\n\nSystem Time: {time}" -) +SYSTEM_PROMPT = """You are a helpful and friendly chatbot. Get to know the user! \ +Ask questions! Be spontaneous! +{user_info} + +System Time: {time}""" diff --git a/src/memory_agent/tools.py b/src/memory_agent/tools.py index 1d57d50..c4751b5 100644 --- a/src/memory_agent/tools.py +++ b/src/memory_agent/tools.py @@ -19,6 +19,10 @@ async def upsert_memory( ): """Upsert a memory in the database. + If a memory conflicts with an existing one, then just UPDATE the + existing one by passing in memory_id - don't create two memories + that are the same. If the user corrects a memory, UPDATE it. + Args: content: The main content of the memory. For example: "User expressed interest in learning about French."