Retrieval Results
The chunks a retrieval step pulled, with relevance. Near-misses are dimmed rather than dropped — when an answer is wrong, "what did it nearly retrieve" is the useful question.
src/components/ui/retrieval-results.tsxAbout
From the component's own source, where it was written.
The chunks a retrieval step pulled, with their relevance.
Chunks below threshold are still listed, dimmed, rather than dropped. When an answer is wrong the useful question is usually "what did it nearly retrieve" — a list that silently hides the near-misses cannot answer it.
Scores use ConfidenceMeter's banding rather than a raw number, for the same reason: a cosine similarity of 0.82 is not a calibrated probability and printing two decimals implies a precision it does not have.
Install
npx astralyx-ui add retrieval-results
Usage
import { RetrievalResults } from '@/components/ui/retrieval-results'
<RetrievalResults chunks={chunks} query={question} threshold={0.5} />Composer
Change the props and the source below follows.
Configuration now lives in CSS. The @theme directive replaces tailwind.config.js for token definitions, and utilities are generated from the tokens you declare.
- section
- Configuration
- updated
- 2026-03-14
<RetrievalResults
chunks={chunks}
query={question}
threshold={0.5}
/>Examples
Chunks
<RetrievalResults chunks={chunks} query={question} />API
Generated from the source, so it cannot fall behind the code. One table per exported component, then hooks, functions and types.
RetrievalResults
Extends Omit<ComponentProps<'div'>, 'children'>.
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | 'Retrieved context' | — |
| chunks | RetrievedChunk[] | required | { id, score, content, source, page?, metadata? } with score 0–1. |
| query | ReactNode | — | — |
| threshold | number | 0.5 | Below it a chunk is dimmed, never hidden. |
| defaultExpanded | string[] | — | — |
Types
RetrievedChunk
The chunks a retrieval step pulled, with their relevance.
| Field | Type | Description |
|---|---|---|
| id | string | — |
| score | number | 0–1. |
| content | ReactNode | — |
| source | string | — |
| page? | number | — |
| metadata? | Record<string, string> | — |
Behaviour
| Topic | Detail | Description |
|---|---|---|
| scores | banded | Rendered through ConfidenceMeter rather than as a number — a cosine similarity of 0.82 is not a calibrated probability. |