Retrieved context inspector
What memory was pulled for the current answer — relevance score and token cost per item, with ignored low-relevance hits shown dimmed. Makes retrieval auditable and cost-aware.
Included in the single kansho full pack. Components are not offered as separate installs.
Retrieval for one answer
“Write the incident postmortem for the audit drift.”
3 used · 109 tokens added to prompt
- RetrievedUserrel 92%38 tok
Avery prefers one-paragraph postmortems with a checklist.
- RetrievedOrgrel 81%44 tok
Production cut-overs need two approvals above 0.5% drift.
- RetrievedSessionrel 64%27 tok
Current session lock is on audit.logs since 14:02.
- IgnoredUserrel 22%0 tok
Avery lives in Example City, Exampleland.
Component documentation
Retrieved Context Inspector
components/memory/retrieved-context-inspector.tsxPurpose
Shows which memory facts a retrieval query used or ignored, including relevance and token cost.
Appropriate use
Use to explain prompt context selection and its cost for one answer.
Example
components/memory/retrieved-context-inspector.tsx has a representative live example in the "Retrieval for one answer" section on /components/retrieved-context-inspector.
States
Each item is retrieved or ignored and includes a memory scope, relevance from zero to one, and token cost; an empty items array is supported as a summary with no rows.
API and props
RetrievedContextInspector accepts query, items, and className; each RetrievedItem supplies id, fact, scope, op, relevance, and tokens.
Dependencies
Direct imports are React, Lucide icons, StatusPill, Tag, shared memory types, and cn.
Accessibility
Operation, scope, relevance percentage, tokens, and fact text are all explicit; decorative meter layers are presentation only.
Limitations
It does not run retrieval, clamp scores, total tokens, rank items, or expose the underlying prompt.
Source
Source: components/memory/retrieved-context-inspector.tsx.
Full pack
components/memory/retrieved-context-inspector.tsx is documented at /components/retrieved-context-inspector and installs only through the single Kansho full pack; no individual component install is offered.