File size: 795 Bytes
015bec7
b77da2b
ec9cdad
5c83bd9
015bec7
 
5c83bd9
 
c6421b9
b77da2b
 
 
 
 
c6421b9
b77da2b
015bec7
c6421b9
873e08b
c6421b9
 
 
 
 
 
 
 
 
 
b77da2b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from typing import Any
from langmem import create_search_memory_tool
from typing import Dict, Any, Optional,Annotated
from langchain.tools import tool,ToolRuntime
from langgraph.prebuilt import InjectedState
from langgraph.store.base import BaseStore
from typing import Literal
  # Correct import path

search_memory_tool = create_search_memory_tool(
    namespace=(
        "emails", 
        "{user_id}", 
        "{sender_email_id}" 
    )
)



@tool
def give_previous_context(memory_summary: str) -> str:
    """
   Args:
        memory_summary: Structured summary containing sender identity,
                        past context, new facts stored, and suggested tone.
                        
    """
    return memory_summary

context_agent_tools=[search_memory_tool,give_previous_context]