File size: 285 Bytes
754cec9
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
#scr/memory.py

from langgraph.checkpoint.memory import MemorySaver

class CustomMemorySaver(MemorySaver):
    def should_save(self, state: dict, key: str) -> bool:
        # Exclude 'messages' from being saved
        if key == 'messages':
            return False
        return True