Time-based prospective memories for reminders and future context
Foresight memories are prospective - they look forward in time. Unlike episodic memories that record the past, foresight memories have a validity window defined by start_time and end_time. They’re ideal for reminders, deadlines, and future-relevant context.Foresight is also a core component of the MemCell. It lets the system store predictions, plans, and expiring information so your agent can act proactively.
Important: Foresight memory extraction is only available in assistant scene mode. Group chat scenes do not extract foresight memories.
When a conversation mentions future events, EverMemOS extracts foresight memories with time bounds:
Copy
User: "Remind me to call John next Tuesday at 2pm" ↓Extracted Foresight Memory:- Content: "Call John"- start_time: Next Tuesday 2:00 PM- end_time: Next Tuesday 3:00 PM (default 1 hour window)
When you search with current_time, only foresight memories within their valid window are returned.
Every piece of knowledge has a shelf life. Foresight introduces validity intervals: a start time and an end time that define when the memory is relevant.
Short-term Validity
“I’m in a meeting right now.”
Valid for: 1 hour.
After 1 hour, this fact is archived or treated as past context.
Long-term Validity
“My office is in Berlin.”
Valid for: Indefinite (until contradicted).
The system assumes this stays true unless explicitly changed.
Foresight memories are automatically extracted when conversations mention future events:
Copy
import uuidfrom datetime import datetimedef store_message(group_id: str, sender: str, content: str): """Store a message that may create foresight memories.""" message = { "group_id": group_id, "group_name": "Personal Assistant", "message_id": str(uuid.uuid4()), "create_time": datetime.now().isoformat() + "Z", "sender": sender, "sender_name": "User" if sender != "assistant" else "Assistant", "content": content } response = requests.post( f"{BASE_URL}/api/v0/memories", json=message, headers=headers ) return response.json()# Messages that create foresight memoriesstore_message("assistant_alice", "user_alice", "Remind me to submit the report by Friday 5pm")store_message("assistant_alice", "user_alice", "I have a dentist appointment next Monday at 10am")store_message("assistant_alice", "user_alice", "The project deadline is March 15th")store_message("assistant_alice", "user_alice", "Don't forget to call Mom this weekend")
# Scenario: It's Monday 9am# This foresight memory is INCLUDED (within window):# "Dentist appointment Monday 10am" (start: Mon 10am, end: Mon 11am)# This foresight memory is EXCLUDED (not yet started):# "Submit report Friday 5pm" (start: Fri 4pm, end: Fri 5pm)# But if searching for "what do I have coming up", it may still appear# This foresight memory is EXCLUDED (already passed):# "Call John last Friday" (end_time in the past)
# Foresight extraction ONLY works with assistant scenemeta = { "scene": "assistant", # Required ...}# Group chat scene does NOT extract foresightmeta = { "scene": "group_chat", # No foresight extraction ...}
Foresight extraction depends on clear temporal references in the conversation:
Copy
# Good: Clear temporal reference"Remind me to call John next Tuesday at 2pm" # Extracted with precise time# Ambiguous: May not extract correctly"I should probably call John sometime" # No clear time reference# Complex: May partially extract"Let's meet either Monday or Tuesday, I'll confirm later" # Uncertain
from datetime import datetime, timezone# Always use UTC for current_time parametercurrent_time = datetime.now(timezone.utc).isoformat()# Or use explicit timezoneimport pytztz = pytz.timezone("America/New_York")current_time = datetime.now(tz).isoformat()