fix: preserve reference time in LongMemEval search - #2411
wangxinyufighting wants to merge 1 commit into
Conversation
🤖 Open Code ReviewTarget: PR #2411 🔍 OpenCodeReview found 2 issue(s) in this PR. 1.
|
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Default fast mode and the agentic search path still lose the question reference time.
Review effort: Lite
Findings: None
What changed in this PR
Fixes LongMemEval relative-date search by propagating reference_time through clients, search contexts, and temporal parsing.
Changes:
- Adds optional reference-time client support.
- Preserves reference time across API and single-cube searches.
- Adds regression tests for propagation and parsing.
Review findings:
- Moderate: Default fast mode does not consume
reference_time. - Moderate: The agentic search path drops
reference_time.
| File | Summary |
|---|---|
tests/memories/textual/test_tree_task_goal_parser.py |
Tests temporal prompt reference dates. |
tests/memories/textual/test_tree_searcher.py |
Tests reference-time propagation. |
tests/evaluation/test_longmemeval_api_contract.py |
Tests client and API context contracts. |
src/memos/search/search_service.py |
Preserves reference time in search context. |
src/memos/multi_mem_cube/single_cube.py |
Propagates reference time to cube searches. |
src/memos/memories/textual/tree_text_memory/retrieve/task_goal_parser.py |
Uses reference time in fine-mode prompts. |
src/memos/memories/textual/tree_text_memory/retrieve/searcher.py |
Forwards reference time to the parser. |
evaluation/scripts/utils/client.py |
Adds reference-time client support. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
✅ Automated Test Results: PASSEDAll tests passed (13/13 executed). memos_python_core/changed-repo-python: 13/13. Duration: 12s Branch: |
Description
This PR fixes temporal search behavior for the LongMemEval evaluation.
LongMemEval questions may contain relative time expressions such as “yesterday” or “last week”. Previously, the question's reference date was not consistently propagated from the evaluation client to the API search context and temporal task parser. As a result, relative dates could be interpreted using the current time instead of the question date.
Implementation:
reference_timesupport to the open-source evaluation client.reference_timefield from its request payload.reference_timein API and single-cube search contexts.reference_timefrom the search context to the task parser.Dependencies: None.
Related Issue (Required): None
Type of change
How Has This Been Tested?
Focused tests: