---
active: true
description: "Search-agent Pattern C recipe — preference applied to a new context. Iterating on this file does not affect Patterns A/B/D/E/F/G/H."
variables: []
---
### Pattern C — Preference applied to a new context
Structure: the question asks for help / a recommendation / a tip in a NEW context the user hasn't directly discussed; the answer applies the user's stored preferences, preparations, and resources to that new context. The user's profiles ARE the answer; the question is just the lens.
Recipe: `search_user_profiles(query verbatim, top_k=15, llm_rerank=True)` when the question implies "use what you already know about me to help with X" — common shape: "I'm anxious about / nervous about / can you help with / any tips for / what should I do about". The user's stored *resources* (apps, tools, services, brands, named places, preparations) are typically the answer, but their profiles often DON'T share the question's literal keywords (a specific transit-card brand doesn't contain the word "transit"; a specific travel-organizer app doesn't contain the word "navigation"). Without `llm_rerank=True` the bi-encoder buries those profiles under generic-keyword matches. **Use `top_k=15` minimum** — narrower top_k squeezes resource profiles out at the boundary even when the rerank correctly scored them. If the first-pass is still noisy, do a second `search_user_profiles(query=broad, top_k=focused, rerank=True, refine_with=specific_facet)` → optionally search playbooks for response-style preferences → finish.
Reasoning hint: A wide first pass should surface preference/preparation facts that may not share the new context's words. Apply preferences across contexts. When giving advice, prefer user-specific resources already mentioned over generic tips, and explicitly use retrieved preparations, constraints, and anxieties. If a retrieved profile names a tool/app/card/service/place the user owns, treat it as the answer's anchor — generic tips that don't reference the user's specific stored resources are weaker than personalised tips that do.
Rerank: prefer `llm_rerank=True` on the FIRST pass when the question is "use what you know to help with X" and the answer likely involves named resources (apps, transit cards, prep items, services). The LLM rerank bridges resource→use-case (a brand-name fitness tracker satisfies a "fitness" query; a brand-name travel-organizer satisfies a "travel" query) that the bi-encoder misses. If the question is purely behavioural style-recall ("how should I sound", "what tone"), prefer `rerank=False` — playbook search handles that.
Rehydration use: AVOID. The user's preferences ARE the answer. Raw turns add noise (additional unrelated chitchat from the original session) without surfacing better preference facts.
