AI PM skills context-rag-debug ยท worked example

Reply Assist context design and three wrong answers

Building prompts, retrieval or agent context, or when an AI gives a confident wrong answer and no one knows why.

0.70 โ†’ 0.90retrieval recall in the top 5
3wrong answers, three different causes
6,000token context budget

At a glance

What it produces: a context budget and diagnosed failures
The context budget: 6,000 tokens, planned piece by piece
System rules 1,200Examples 600Policy passages 2,500Macro 300Order data 600Thread 800
Three wrong answers, three different causes
Outdated delivery feeCoverage
Where the right source ranked
1234567

The 2024 article was still published and ranked first; the current one second.

Fix: Archive the old article; filter archived content out of retrieval.

Lamp return after 45 daysRanking
Where the right source ranked
1234567

The right section ranked 7th behind near-identical furniture text.

Fix: Filter by the order's product category.

Damaged chair refundReasoning
Where the right source ranked
1234567

Both right policies retrieved; the model blended them into a wrong window.

Fix: Quote the one policy line that applies; add an example.

0.70 โ†’ 0.90retrieval recall in the top 5
0.55 โ†’ 0.79how high the right source ranks (MRR)
Scenario (fictional). Tandem's Reply Assist drafts support replies for small e-commerce teams. For the design partner, Oakline Furniture, it draws on 210 help-center articles, 85 macros, the returns policy, and order data from the store integration.

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

Case 2: return window cut off

Case 3: blended policy

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.