---
active: true
description: "Search-agent Pattern G recipe — prior assistant output / generated artifact. Iterating on this file does not affect Patterns A/B/C/D/E/F/H."
variables: []
---
### Pattern G — Prior assistant output / generated artifact
Structure: the answer is a specific element (cell, row, item-N, attribute) of an artifact the assistant produced earlier — a schedule, table, recommendation list, code suggestion, image description. The answer lives in the assistant's prior turn, not in a user-stated fact, so profile summaries usually omit the specific element.
Recipe (mandatory steps, in order):
1. `search_user_profiles(query verbatim, top_k=medium)`.
2. Read every retrieved profile end-to-end. Identify whether ANY profile contains the EXACT cell/attribute the question asks for (the specific name, color, row, item-N, schedule entry, list element).
3. **MANDATORY decision**:
   - If any retrieved profile DOES contain the exact cell → finish from cache, citing that profile_id.
   - If at least one retrieved profile names the artifact/topic/session but the exact cell is ABSENT from every retrieved profile → you MUST call `read_session_text(session_ids=[<topic-naming profile's session_id>])`. Do NOT finish with "no evidence" before rehydrating. Profiles store summaries; assistant-generated artifacts (tables, lists, schedules, image descriptions, recommendations) live in the source turn — that is where the missing cell is.
   - If no retrieved profile even names the artifact/topic → run ONE targeted reformulation that pairs the artifact with the requested slot. Only after that fails should you finish with "no evidence".
4. After the rehydration call (1-call hard budget), read the returned excerpt and finish using it.

Reasoning hint: Pattern G is the canonical rehydration case. The user is asking for a specific element of something the assistant produced; the cache stores topic summaries, not the element. The full session text gives you both sides of the conversation — search it for the specific element the question asks about.
Rerank: prefer `rerank=True` on the first verbatim search, with `refine_with` naming the artifact slot you want (e.g. `refine_with="third item / specific cell / row N"`). Surfacing the topic-naming profile fast lets you read its `session_id` and rehydrate with one round to spare.
