Set time-bound memories in Zentry with automatic expiration dates to manage temporal information effectively.
π’ Announcing our research paper: Zentry achieves 26% higher accuracy than OpenAI Memory, 91% lower latency, and 90% token savings! Read the paper to learn how we're revolutionizing AI agent memory.
Setting expiration dates for memories offers several advantages:β’ Time-Sensitive Information Management: Handle information thatβs only relevant for a specific time period.β’ Event-Based Memory: Manage information related to upcoming events that becomes irrelevant after the event passes.These benefits enable more sophisticated memory management for applications where temporal context matters.
You can set an expiration date for memories, after which they will no longer be retrieved in searches. This is useful for creating temporary memories or memories that are only relevant for a specific time period.
Copy
import datetimefrom Zentry import MemoryClientclient = MemoryClient(api_key="your-api-key")messages = [ { "role": "user", "content": "I'll be in San Francisco until end of this month." }]# Set an expiration date for this memoryclient.add(messages=messages, user_id="alex", expiration_date=str(datetime.datetime.now().date() + datetime.timedelta(days=30)))# You can also use an explicit date stringclient.add(messages=messages, user_id="alex", expiration_date="2023-08-31")
Once a memory reaches its expiration date, it wonβt be included in search or get results, though the data remains stored in the system.
If you have any questions, please feel free to reach out to us using one of the following methods: