At a glance
The 2024 article was still published and ranked first; the current one second.
Fix: Archive the old article; filter archived content out of retrieval.
The right section ranked 7th behind near-identical furniture text.
Fix: Filter by the order's product category.
Both right policies retrieved; the model blended them into a wrong window.
Fix: Quote the one policy line that applies; add an example.
Context design
| Piece | Where it lives | Budget (tokens) |
|---|---|---|
| Role, tone rules, length rule, escalation rule, output format | System prompt (cached) | 1,200 |
| Two canonical drafts (order status, return request) | System prompt (cached) | 600 |
| Policy and help-center passages | Retrieved, top 5, current versions only | 2,500 |
| Matching macro | Retrieved, top 1 | 300 |
| The order named in the ticket, plus the last 2 orders | Per request, from the store API | 600 |
| The ticket thread, last 6 messages | Per request | 800 |
| Total | 6,000 |
Chunking: one chunk per policy section, with the article title, product category and updated date stored as metadata. Hybrid search, because customers type exact product and order names.
Retrieval measurement
40 labeled questions, each with the article that answers it.
| recall@5 | MRR | |
|---|---|---|
| Before fixes | 0.70 | 0.55 |
| After fixes | 0.90 | 0.79 |
Case 1: outdated delivery fee
- Question: "How much is white-glove delivery to Denver?"
- Expected: $149, from Delivery options (updated 2026-03).
- Retrieved: Delivery options (2024) at rank 1 with $129; the current article at rank 2.
- Type: coverage. Both articles were published, so the content itself was wrong, not the search.
- Fix: archived the 2024 article; retrieval now filters out
status: archived; added a check that flags two articles with the same title. - Eval case added:
delivery-fee-denver, withmust_not_include: ["$129"].
Case 2: return window cut off
- Question: "Can I return a lamp after 45 days?"
- Expected: yes, decor has a 60-day window, from Returns policy, Decor section.
- Retrieved: the Decor section at rank 7. Ranks 1 to 5 were furniture return chunks with near-identical wording.
- Type: ranking.
- Fix: added the product category from the order as a retrieval filter, so a lamp order pulls the Decor section first.
- Eval case added:
return-window-decor-45d.
Case 3: blended policy
- Question: "Can I get a refund for the damaged chair instead of a replacement?"
- Retrieved: Damaged items at rank 1 and Refunds at rank 2. Both correct.
- Draft: "You're eligible for a full refund within 60 days." Damaged items get a refund or replacement within 14 days of delivery; 60 days is the decor return window.
- Type: reasoning. Right evidence, wrong combination.
- Fix: instruction to quote the single policy line that applies and to name the policy it comes from; a canonical example of choosing between two policies.
- Eval case added:
damaged-chair-refund, graded by the faithfulness judge.
Not a context problem
A customer asked about a promise made on a phone call. No source can contain it. Not a coverage gap to fill: the draft should say it can't see phone notes and route to the agent. Added to should-escalate.