Add timestamps to your memories to maintain chronological accuracy and historical context
📢 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.
The Memory Timestamps feature allows you to specify when a memory was created, regardless of when it’s actually added to the system. This powerful capability enables you to:
Maintain accurate chronological ordering of memories
Import historical data with proper timestamps
Create memories that reflect when events actually occurred
Build timelines with precise temporal information
By leveraging custom timestamps, you can ensure that your memory system maintains an accurate representation of when information was generated or events occurred.
Custom timestamps offer several important benefits:• Historical Accuracy: Preserve the exact timing of past events and information.• Data Migration: Seamlessly migrate existing data while maintaining original timestamps.• Time-Sensitive Analysis: Enable time-based analysis and pattern recognition across memories.• Consistent Chronology: Maintain proper ordering of memories for coherent storytelling.
When adding new memories, you can specify a custom timestamp to indicate when the memory was created. This timestamp will be used instead of the current time.
When specifying a custom timestamp, you should provide a Unix timestamp (seconds since epoch). This is an integer representing the number of seconds that have elapsed since January 1, 1970 (UTC).For example, to create a memory with a timestamp of January 1, 2023:
Copy
# January 1, 2023 timestampjanuary_2023_timestamp = 1672531200 # Unix timestamp for 2023-01-01 00:00:00 UTCmessages = [ {"role": "user", "content": "I'm travelling to SF"}]client.add(messages, user_id="user1", timestamp=january_2023_timestamp)
If you have any questions, please feel free to reach out to us using one of the following methods: