Skip to main content
Every call to POST /v1/context-pack produces a decision receipt — a complete record of what evidence was included, what was excluded, and why.

What a Receipt Contains

SectionDescription
EvidenceEvery span selected for the context pack, with relevance scores and provenance
ExclusionsEvery span considered but dropped, with the reason
Token AccountingExact budget breakdown (prefix, working set, total used, remaining)
Channel ContributionsHow many candidates each retrieval channel produced and how many were selected
ConflictsContradictions detected between included evidence
AssumptionsAny degradation notes (e.g., “Semantic search unavailable”)
Policy SummaryThe access policy that was applied

Why Receipts Matter

Debugging

When an agent gives a wrong answer, the receipt tells you exactly where the pipeline broke:
  • Was the evidence missing from the store entirely? (Not ingested)
  • Was it retrieved but excluded by policy? (Access control issue)
  • Was it retrieved but lost to budget constraints? (Need a larger budget)
  • Was it retrieved but flagged as redundant? (Duplicate detection was too aggressive)
  • Was it retrieved but had low relevance? (Query or indexing issue)

Compliance

In regulated industries, receipts prove why the model received specific information. Every decision is traceable to a specific span, artifact, and scoring computation.

Evaluation

Receipts enable systematic evaluation of the retrieval and packing pipeline. You can measure recall, precision, and coverage across thousands of queries by comparing receipt data against ground truth.

Accessing Receipts

Every context pack response includes a receipt_id:
pack = client.context_pack(query="...", workspace_id="ws-1")

# Get the full receipt
receipt = client.get_receipt(pack["receipt_id"])
You can also browse receipts in the Receipt UI at GET /ui.

Exclusion Reasons

ReasonDescription
BUDGETSpan was relevant but the token budget was full
POLICYSpan was blocked by the request’s access policy
REDUNDANCYSpan was too similar to an already-included span
LOW_RELEVANCESpan scored below the relevance threshold
PRIVATESpan was marked private via feedback
MARKED_WRONGSpan was flagged as incorrect via feedback
OUTDATEDSpan was flagged as outdated via feedback

Receipt Persistence

Receipts are stored in the database and are queryable by workspace. They are the permanent audit trail for every memory decision your agents make.