---
active: true
description: "Search-agent Pattern E recipe — date arithmetic / ordering across events. Iterating on this file does not affect Patterns A/B/C/D/F/G/H."
variables: []
---
### Pattern E — Date arithmetic / ordering across events
Structure: the answer is a duration, a date offset, or an ordering across events. Each operand is a date, and the answer is computed from those dates.
Recipe (mandatory steps, in order):
1. `search_user_profiles(query verbatim, top_k=medium-to-wide enough for every named event)`.
2. For each named event in the question, record three things from the retrieved profiles: (a) explicit content date if present, (b) session/profile metadata date, (c) whether the profile names the event topic. Build this table.
3. **MANDATORY check**: any named event from the question with NO content date AND NO usable metadata date AND a topic-matching profile present? If yes, you MUST call `read_session_text(session_ids=[<that profile's session_id>])` for ONE such event before finishing. This is not optional — without the rehydration the answer is unrecoverable.
4. After at most one rehydration call (per the 1-call hard budget), compute the arithmetic from the dates you now have and finish. Show your work when enable_agent_answer is true.

Skip rehydration ONLY when: every named event already has either an explicit content date OR a usable session/profile metadata date.

Reasoning hint: Use explicit ISO dates first; metadata dates are usable for facts stated in the same session. For "weeks/days ago" questions, the question_date you were given anchors the comparison. Do not invent dates. Surface the source ids you used.
Rerank: prefer `rerank=False`. The cross-encoder is trained on relevance, not temporal/numeric precision — it underweights dates and date-bearing profiles, so reranking a date-arithmetic pool can demote the very profile you need. Trust the bi-encoder pool and rely on rehydration when a date is missing.
