Skip to content

Retrieval Console

Why the answer said what it said: what is connected, how stale it is, what the query was allowed to see, what fitted in the window and what fell out — plus the failed-search state a debugging tool is most needed in.

7 blocks66 lineslucide-reactAdded 10 Sept 2026

What's included

  • app/retrieval-console-page.tsx
  • 7 blocks it is built from, installed with it
  • Needs lucide-react

Works with

  • React
  • Next.js
  • Tailwind CSS
  • TypeScript

npx hoverlab add retrieval-console-page

Or over MCP, from your editor's agent — no account needed.

License

Free to read, copy and install, for personal and non-commercial projects. Shipping it in client work or a paid product needs Pro ($79 once). The source lands in your repo and stops being ours — no attribution, nothing to upgrade.

Was this useful?

Preview

Retrieval

What is connected, how current it is, what the query could see, and what actually made it into the answer.

Knowledge freshness

Answers can only be as current as the source they come from. The oldest connected source was last read 6 weeks ago, so anything changed since then may not be reflected yet.

  • Help centre

    Website · 4 domains

    Up to date · last read 11 minutes ago

    486 docs

  • Internal handbook

    Notion workspace

    Partly indexed · last read 2 hours ago

    812 of 1,340 documents searchable — the remaining 528 cannot be cited yet.

    1,340 docs

  • Past tickets

    Zendesk · resolved only

    Behind · last read 9 days ago

    22,190 docs

  • Policy documents

    Google Drive folder

    Not syncing · last read 6 weeks ago

    The connected account lost access to the folder on 3 August. The 74 documents already indexed are still being answered from, at the age above.

    74 docs

How old the sources are

Relevance ranking says which document matched. It says nothing about whether the document is still true, and that is the question a reader has once the answer surprises them.

What it can see

Citations tell you what an answer used. Scope tells you what it could have used, which is the question behind "why did it not know that".

Retrieved context

4 chunks for “why did northwind not get the volume price”, ranked by similarity

  1. Document: Pricing handbook· §4.2 — Volume breaksStrong match0.910.91

    Accounts above 1,200 units per order qualify for the tier-two rate of $8.40, held for the duration of the contract year. The break is applied per order, not per quarter, so a single large order beats two smaller ones of the same total volume.

  2. Support ticket: Ticket #4192· Northwind Retail · resolvedPartial match0.780.78

    Customer asked why their November order did not get the tier-two price. Their October and November orders were 700 units each — combined they clear the break, individually they do not. Confirmed with finance that this is working as intended.

  3. Table: warehouse.orders· 2,481 rows scannedPartial match0.640.64

    Aggregated order volume by account for the trailing four quarters, filtered to accounts with more than one order in the period.

  4. Web page: supplier.example.com· Lead times · fetched todayWeak match0.410.41

    Standard lead time for the winter blend is 21 days from purchase order. Expedited shipping is available at a 15% surcharge and reduces this to 9 days.

Context for this reply

27.0k of 32.0k tokens · 84%

  • System promptAgent role and house rules1.4k4%
  • Tool definitions9 tools, JSON schema3.1k10%
  • ConversationLast 14 turns8.2k26%
  • refunds-policy.mdWhole file · pinned by you4.8k15%
  • Q3-support-metrics.csvRows 1–200 of 4,8124.4k14%
  • escalation-runbook.md3 of 9 sections, ranked by the query2.9k9%
  • Held for the replyRoom the answer needs2.2k7%

Left out to make it fit

The model did not see any of this. If an answer looks like it ignored a document, start here.

  • Q3-support-metrics.csv — rows 201–4,812Too large for the window. Only the first 200 rows were sent.96.0k
  • contract-meridian-2024.pdfRanked 8th; seven chunks fitted. Pin it to force it in.18.3k
  • Conversation turns 1–6Aged out of the rolling history window.7.1k

Sources(4)

  1. Database table: Q3 revenue cohortswarehouse.arr_monthly

    Supports: The 6.1% churn figure for accounts under 20 seats

    2,463 accounts · lost ARR $1.24M · seat_band < 20

    Read

  2. Database table: Activation funnel, Jul–Sepwarehouse.events

    Supports: The claim that a second integration predicts retention

    Accounts with ≥2 connected sources churned at 1.6%; with 1 source, 6.4%.

    Read

  3. Document: Pricing handbookdocs/pricing-handbook.md

    Supports: That the volume break applies per order rather than per quarter

    The break is applied per order, not per quarter, so a single large order beats two smaller ones of the same total volume.

    Read

    This document has changed twice since it was indexed.

  4. Web page: Supplier lead times (opens in a new tab)supplier.example.com

    Supports: The 21-day reorder window

    Read

Every figure above traces to one of these. Nothing was inferred without a source.

I could not find this in anything I can read.

Rather than guess at a number that has to be exact, here is where I looked and what came closest.

what is our EU VAT registration number

Searched

  • Company handbook214 documents· 0 matches
  • Analytics warehouse18 tables· 0 matches
  • help.acme.com480 pages· 0 matches

Closest, but below the threshold

Tax registrations usually live in the finance drive, which is not connected.

The real page, rendered in your current theme — every section below is a live block, not a screenshot.

Built from

All blocks
  1. Index Freshness PanelA green tick means the connector works, not that the answers are current. Freshness as an age in words per source, the headline taken from the stalest one, and a failed sync that still says what age it is answering from.
  2. Retrieval Freshness ListRetrieved sources ranked by how stale they are, because a confident answer from a two-year-old document is the failure people do not catch.
  3. Context Scope ListWhich sources this answer may draw on, shown as a scope the user can read before asking rather than a citation list after.
  4. Retrieved Context ChunksThe RAG debugging surface: ranked passages with similarity as a meter, matched spans in real mark elements, and filter chips wired as a radiogroup so arrows move between them.
  5. Context Window BudgetWhat is in the context and what fell out of it — a stacked budget with the reply reserve drawn as a segment, and the dropped chunks named with the reason, which is the part nobody ships.
  6. Answer Source CitationsThe published footnotes under an answer — ordered list, real cite and time elements, the claim each source supports, and a staleness warning written in words rather than shown as an amber dot.
  7. Nothing Found, Answered HonestlyThe refusal screen: says plainly that nothing was found, shows where it looked and the near-misses below threshold, and offers the two real ways out instead of inventing an answer.

Only want one section? Open it and copy that block instead — browse Retrieval & Context.

Source

app/retrieval-console-page.tsx
/**
 * Why the answer said what it said — the RAG side of an assistant, as an
 * operable screen.
 *
 * The question this page exists to answer is not "is retrieval working".
 * It is "is retrieval working *now*, on the documents I think it has, and
 * did the thing it just told me actually come from one of them". Those are
 * three different questions and most consoles answer only the first.
 *
 * So the order is: what is connected, how stale it is, what it was allowed
 * to look at, what it found, what fitted, and what it cited.
 *
 *   index status     a green tick means the connector works, which is not
 *                    the same as the answers being current
 *   freshness        so the previous sentence has somewhere to be answered
 *   scope            what the query was permitted to see. A retrieval bug
 *                    and a permissions boundary look identical from the
 *                    outside, and only this list tells them apart
 *   chunks           the passages themselves, ranked
 *   budget           what fitted in the window and what fell out of it —
 *                    the most common cause of "it ignored the document I
 *                    gave it", and invisible without this
 *   citations        the published footnotes, which is the only part of
 *                    this page an end user ever sees
 *
 * The empty state is last and it is not an afterthought. A retrieval
 * console that cannot show you a failed search is a console you can only
 * use when you do not need it: <RetrievalEmptyState> says plainly that
 * nothing was found, where it looked, and what the near-misses were, which
 * is the difference between debugging and guessing.
 */

import * as React from 'react'
import { RetrievalIndexStatus } from '@/components/retrieval-index-status'
import { RetrievalFreshnessList } from '@/components/retrieval-freshness-list'
import { ContextScopeList } from '@/components/context-scope-list'
import { ContextChunkCards } from '@/components/context-chunk-cards'
import { ContextWindowBudget } from '@/components/context-window-budget'
import { SourceCitationList } from '@/components/source-citation-list'
import { RetrievalEmptyState } from '@/components/retrieval-empty-state'

export default function RetrievalConsolePage() {
  return (
    <main className="min-h-screen bg-background text-foreground">
      <section className="mx-auto w-full max-w-5xl px-6 pb-2 pt-12">
        <h1 className="text-2xl font-bold tracking-tight">Retrieval</h1>
        <p className="mt-1 text-sm text-muted-foreground">
          What is connected, how current it is, what the query could see, and
          what actually made it into the answer.
        </p>
      </section>

      <RetrievalIndexStatus />
      <RetrievalFreshnessList />
      <ContextScopeList />

      <ContextChunkCards />
      <ContextWindowBudget />
      <SourceCitationList />

      {/* The state a debugging tool is most needed in. */}
      <RetrievalEmptyState />
    </main>
  )
}

How to use it

  1. 1. Copy each of the 7 blocks above into components/ — each block page has its own copy button.
  2. 2. Drop this file at app/retrieval-console-page.tsx. The imports already point at @/components/…, so they resolve with no edits.
  3. 3. Delete the sections you do not want. Every block takes props, so the copy changes without the layout moving.

For AI

The component, its props, the design tokens it expects and the command that installs it — as one prompt. Paste it into Claude, Cursor, v0 or ChatGPT and what they build around it will match the rest of the catalog instead of inventing its own system.

See the prompt

More App Screens

Open the full page for this page

Dashboard Overview

The screen an app opens on: shell, header, KPI row, chart and activity feed — numbers first, shape second, changes last.

App Screens5 blocks47 lines
Open the full page for this page

AI Assistant Screen

An agent working inside a real app: a transcript down the middle — reasoning, answer, then the one card that can act — with what it may read and what it noticed demoted to a rail.

App Screens7 blocks110 lines
Open the full page for this page

Project Board

A kanban board inside the app shell, with tabs that admit the board is one view among several and a header whose primary action is creating work.

App Screens3 blocks42 lines
Open the full page for this page

Customer List Screen

The canonical CRUD list — header, toolbar, sortable table and pagination framed as one panel instead of three stacked cards.

App Screens5 blocks37 lines
Open the full page for this page

Onboarding

A wizard for the session someone finishes and a checklist for the one they do not, with the only genuinely blocking step in front of both.

App Screens3 blocks45 lines
Open the full page for this page

Search Results

Built around the state a search page is in most of the time — empty — so recent queries lead and the facets sit in a sidebar that survives growing to twelve.

App Screens4 blocks47 lines
Open the full page for this page

Agent Run Detail

One run opened up in the order you would debug it — intent, actions, the retries that are invisible in both, then cost.

App Screens4 blocks49 lines
Open the full page for this page

Approvals Inbox

The queue, the same queue sorted by how long things have waited, and the policy that decided both — with the policy last so it is not scrolled past forever.

App Screens3 blocks45 lines
Open the full page for this page

Assistant Chat

The blank thread answered with real starter prompts, the model picker with the three numbers the choice turns on, and the four surfaces a session grows into — attachments, branches, canvas, threads.

App Screens6 blocks68 lines
Open the full page for this page

Agent Run Inspector

The three states an agent screen usually omits: the wait before the first token, the trace after something broke with retries costed in the open, and the diff it wants a person to accept.

App Screens5 blocks61 lines
Open the full page for this page

AI Editor

Five ways to reach a model without the cursor leaving the sentence — slash menu, inline completion, selection toolbar, action menu, property inspector — and the two surfaces that say where the answer came from.

App Screens7 blocks64 lines
Open the full page for this page

Records Table

A table after real people have used it — columns reordered from the keyboard, a selection bar that asks page-or-all, subtotals that survive collapsing, cells edited in place, and the empty state its own filters produced.

App Screens8 blocks71 lines
Open the full page for this page

Analytics

The saved view and the comparison window first, because every figure below depends on both — then six charts, none of which load a charting library.

App Screens8 blocks68 lines
Open the full page for this page

Alerting

Thresholds with how often each has actually fired, what that produced, where it went — and the digest settings that exist because of the answer.

App Screens5 blocks54 lines
Open the full page for this page

Import Data

The flow between an empty product and a useful one, in the order it goes wrong: sample data offered with equal weight, a file, a URL, the column mapping everything stalls on, and an upload that survives the connection dropping.

App Screens7 blocks64 lines
Open the full page for this page

Account Setup

A profile form where the role options state what they actually change, the avatar crop works from the keyboard, and a navigation guard names the fields it is about to throw away.

App Screens4 blocks53 lines
Open the full page for this page

App Shell

The furniture that is on every screen and belongs to none — navbar, mobile drawer, command palette, shortcut sheet, header search, scope switcher, and the two shapes a detail view takes without losing the list.

App Screens8 blocks68 lines
Open the full page for this page

Workspace Activity

Backwards from now and forwards from it on one screen — a day-grouped timeline, a month grid where a busy Tuesday never changes the row height, and the state both are in on day one.

App Screens3 blocks51 lines
Open the full page for this page

First Run

What the product looks like while onboarding happens: a tour step anchored to the control it explains, the skeletons of the slowest load it will ever do, and the checklist that outlives both.

App Screens3 blocks50 lines