Twelve records, one question.
An AI support agent is handling a refund ticket, with twelve items from different data sources available as context: tool call results like the invoice and shipment lookups, policy documents from the knowledge base, the conversation history, and one error from a failed refund check. Only a few of them belong in front of the model. Needlepath reads the full context and the question, keeps four items, and drops the rest before they go through expensive LLM processing.
Can invoice 4471 still be refunded, and for how much?
200 tokens
12 records sent- get_invoice(4471) tool result not selected
- Refund policy v4 document 42 tok
Refund policy v4. A paid order may be refunded within 30 days of the invoice date. Refunds are issued to the original payment method and settle within 10 business days.
- Shipping and delivery policy v2 document not selected
- Data retention policy v7 document not selected
- get_shipment(4471) tool result not selected
- get_account(acct-2213) tool result not selected
- Customer, message 1 user input 36 tok
Hi, I paid for two chairs on invoice 4471 with expedited shipping and they still are not here. I do not want them anymore. Can I get my money back?
- Agent, message 1 model reply not selected
- Customer, message 2 user input 22 tok
Thank you. If the refund goes through, does the expedited shipping I paid come back too?
- gateway timeout on refund preview error record 35 tok
A failed tool call from earlier in the session, sent to Needlepath like any other record. Recent errors earn their place: a model about to promise a refund needs to know the refund preview just failed.
{"error": "upstream_timeout", "operation": "refund_preview", "invoice_id": 4471, "attempt": 1, "retryable": true}
- issue_refund tool schema not selected
- SSO and SCIM provisioning guide, revision 12 document not selected
- before
- 1,660
- after
- 135
- saved
- 1,525
The engine selected. The packet above is what the model reads, assembled from your own records.
- fallback_used
- false
- tokens_saved
- 1,525
- gate.engaged
- true
- gate.reason
- engage:needle
- usage.outcome
- engaged
- usage.charge_multiplier
- 1.0
Read the raw request and response for decision 1, with the wire reason strings
{
"request_id": "nm-demo-2026-08-m1",
"task": {
"prompt": "Can invoice 4471 still be refunded, and for how much?"
},
"budget": {
"max_context_tokens": 200,
"operating_point": "np-2026-07-r2"
}
} {
"request_id": "nm-demo-2026-08-m1",
"policy_version": "np-2026-07-r2",
"rendered_context": "Relevant State\n\n1. gateway timeout on refund preview (payments-api)\n{\"error\": \"upstream_timeout\", \"operation\": \"refund_preview\", \"invoice_id\": 4471, \"attempt\": 1, \"retryable\": true}\n\n2. Customer, message 1 (chat)\nHi, I paid for two chairs on invoice 4471 with expedited shipping and they still are not here. I do not want them anymore. Can I get my money back?\n\n3. Refund policy v4 (handbook)\nRefund policy v4. A paid order may be refunded within 30 days of the invoice date. Refunds are issued to the original payment method and settle within 10 business days.\n\n4. Customer, message 2 (chat)\nThank you. If the refund goes through, does the expedited shipping I paid come back too?",
"selected": [
{
"record_id": "r-payment-error",
"kind": "error",
"title": "gateway timeout on refund preview",
"source": "payments-api",
"score": 12.970833333333333,
"reason": "hard context: recent error",
"excerpt": "{\"error\": \"upstream_timeout\", \"operation\": \"refund_preview\", \"invoice_id\": 4471, \"attempt\": 1, \"retryable\": true}",
"excerpt_format": "plain",
"selected_tokens": 35
},
{
"record_id": "r-turn-1",
"kind": "user_input",
"title": "Customer, message 1",
"source": "chat",
"score": 44.97,
"reason": "hard context: current request: current request; keyword overlap; semantic tag overlap",
"excerpt": "Hi, I paid for two chairs on invoice 4471 with expedited shipping and they still are not here. I do not want them anymore. Can I get my money back?",
"excerpt_format": "plain",
"selected_tokens": 36
},
{
"record_id": "r-refund-policy",
"kind": "external_data",
"title": "Refund policy v4",
"source": "handbook",
"score": 4.929166666666666,
"reason": "hard context: recent relevant result: keyword overlap",
"excerpt": "Refund policy v4. A paid order may be refunded within 30 days of the invoice date. Refunds are issued to the original payment method and settle within 10 business days.",
"excerpt_format": "plain",
"selected_tokens": 42
},
{
"record_id": "r-turn-3",
"kind": "user_input",
"title": "Customer, message 2",
"source": "chat",
"score": 38.98166666666667,
"reason": "hard context: current request; semantic tag overlap",
"excerpt": "Thank you. If the refund goes through, does the expedited shipping I paid come back too?",
"excerpt_format": "plain",
"selected_tokens": 22
}
],
"tokens_before": 1660,
"tokens_after": 135,
"tokens_saved": 1525,
"records_available": 12,
"records_selected": 4,
"fallback_used": false,
"selection_error": null,
"reduction_ratio": 0.9186746987951807,
"engine_latency_ms": 1.5790799999990668,
"gate": {
"engaged": true,
"reason": "engage:needle"
},
"usage": {
"outcome": "engaged",
"charge_multiplier": "1.0",
"currency": "USD"
}
}