ric9176 commited on
Commit
db781d4
·
1 Parent(s): d1b9872

refactor: simplify graph state

Browse files
Files changed (2) hide show
  1. agent/utils/nodes.py +1 -4
  2. agent/utils/state.py +0 -1
agent/utils/nodes.py CHANGED
@@ -176,10 +176,7 @@ async def write_memory(state: AgentState, config: RunnableConfig, store: BaseSto
176
  await store.aput(namespace, "user_memory", {"memory": new_memory.content})
177
 
178
  # Update the state with the new memory
179
- return {
180
- **state,
181
- "user_memories": {"memory": new_memory.content}
182
- }
183
 
184
  # Initialize tool node
185
  tool_node = ToolNode(tool_belt)
 
176
  await store.aput(namespace, "user_memory", {"memory": new_memory.content})
177
 
178
  # Update the state with the new memory
179
+ return state
 
 
 
180
 
181
  # Initialize tool node
182
  tool_node = ToolNode(tool_belt)
agent/utils/state.py CHANGED
@@ -4,4 +4,3 @@ from langgraph.graph.message import add_messages
4
  class AgentState(TypedDict):
5
  messages: Annotated[list, add_messages]
6
  context: list # Store retrieved context
7
- user_memories: Optional[dict] # Store user memory information
 
4
  class AgentState(TypedDict):
5
  messages: Annotated[list, add_messages]
6
  context: list # Store retrieved context