Query memories by time range and understand how knowledge evolved.
Temporal Queries
Time is a first-class dimension in CortexDB. Every episode has a timestamp, and the complete history of when information was learned is preserved.
Time-Range Filtering
# What happened last week?
results = client.search(
query="deployment issues",
time_range="7d",
tenant_id="my-app",
)
# Search within a specific date range
results = client.search(
query="database for payments",
time_range="30d",
tenant_id="my-app",
)
Temporal Relationships
The knowledge graph tracks when relationships started and changed:
entity = client.entity(
entity_id="ent_payments",
tenant_id="my-app",
)
for rel in entity.relationships:
print(f"{rel.relationship} -> {rel.target_entity_id}")
print(f" Since: {rel.created_at}")
This allows CortexDB to answer questions about how knowledge has evolved over time, like "What database did we use for payments before the migration?"