- Complete Quickstart to understand basic operations
- Ensure you have LLM Providers configured
- Have data that contains dates/times (years or full dates)
What Temporal Mode Does
- Builds events and timestamps from your text during cognify
- Lets you ask time-based questions like “before 1980”, “after 2010”, or “between 2000 and 2006”
- Uses
SearchType.TEMPORAL
to retrieve the most relevant events and answer with temporal context
Step 1: Add Data
Add data with temporal information using the standardadd
function.
This simple example uses one string that gets treated as a single document. In practice, you can add multiple documents, files, or entire datasets - the temporal processing works the same way across all your data.
Step 2: Cognify with Temporal Mode
Settemporal_cognify=True
to extract events/timestamps instead of the default entity-graph pipeline.
Only datasets you pass (or all by default) are processed. Temporal mode runs an event/timestamp pipeline and stores temporal nodes in the graph.
This example uses a single dataset for simplicity. In practice, you can process multiple datasets simultaneously by passing a list of dataset names, or omit the
datasets
parameter to process all available datasets.Step 3: Ask Time-aware Questions
UseSearchType.TEMPORAL
and phrase your query with time hints.
- If the query has clear dates, the retriever filters events by time and ranks them
- If no dates are detected, it falls back to event/entity graph retrieval and still answers
- Increase
top_k
to inspect more candidate events
Optional: Limit to Specific Datasets
Using the HTTP API
If your server is running, you can run temporal search via the API by settingsearch_type
to "TEMPORAL"
:
For now, enabling temporal processing at cognify time is easiest in Python with
temporal_cognify=True
.Full Working Example
Checkexamples/python/temporal_example.py
for a complete script that:
- Adds two biographies (with dates)
- Runs
cognee.cognify(temporal_cognify=True)
- Queries with
SearchType.TEMPORAL
for time-aware answers