Principle:24kchengYe MemoMind Temporal Query Analysis
| Knowledge Sources | |
|---|---|
| Domains | NLP, Temporal_Reasoning |
| Last Updated | 2026-10-28 00:00 GMT |
Overview
Technique that extracts time constraints from natural language queries (e.g., "last week", "in June 2024") to enable temporal filtering during memory retrieval.
Description
Users often include temporal references in their queries: "What did I do last summer?", "Meetings from last week", "events in January". Temporal query analysis parses these natural language temporal expressions into concrete date ranges (start_date, end_date) that can be used to filter search results.
Two analyzer implementations exist:
- DateparserQueryAnalyzer: uses the `dateparser` library for fast, rule-based parsing of relative and absolute temporal expressions.
- TransformerQueryAnalyzer: uses a fine-tuned transformer model for more complex temporal reasoning.
When a temporal constraint is detected, the retrieval pipeline adds a temporal retrieval pass that filters facts by their occurred_start/occurred_end dates within the extracted range.
Usage
Use this principle when search queries may contain temporal references that should constrain results. It is essential for memory systems where users ask time-sensitive questions about past events.
Theoretical Basis
The analysis pipeline:
# Abstract temporal analysis (not real implementation)
analysis = analyzer.analyze(query, reference_date=now)
if analysis.temporal_constraint:
start_date = analysis.temporal_constraint.start_date
end_date = analysis.temporal_constraint.end_date
# Filter: only facts where occurred_start in [start_date, end_date]
Relative temporal terms ("yesterday", "last week") are resolved against a reference date (defaulting to the current time). Absolute terms ("June 2024") are parsed directly.