Kanshō

Docs / Memory and context /

RetrievedContextInspector

Inspects the memory chunks retrieved for a given query: relevance scores and content previews.

Preview

Retrieved for this answer

What language does the user prefer and what project are they working on?

3 used · 54 tokens added to prompt

  • RetrievedUserrel 94%18 tok

    User prefers TypeScript over JavaScript for all new projects.

  • RetrievedUserrel 88%22 tok

    Repo name: kansho-ui — the component library being built in public.

  • RetrievedUserrel 71%14 tok

    User timezone: Europe/Brussels (UTC+2 in summer).

  • IgnoredUserrel 29%21 tok

    Joey was exploring React Query v4 for the XFA dashboard (Q1 2026).

  • IgnoredSessionrel 11%17 tok

    Q1 sprint planning complete — shipping authentication redesign.

Variants

All retrieved (nothing ignored)

Retrieved for this answer

What is the user's timezone?

2 used · 23 tokens added to prompt

  • RetrievedUserrel 97%14 tok

    User timezone: Europe/Brussels (UTC+2 in summer).

  • RetrievedUserrel 81%9 tok

    User location: Antwerp, Belgium.

All ignored (low relevance query)

Retrieved for this answer

What's the weather like in Tokyo today?

0 used · 0 tokens added to prompt

  • IgnoredUserrel 8%18 tok

    User prefers TypeScript over JavaScript.

  • IgnoredUserrel 4%12 tok

    Repo name: kansho-ui.

Props

PropTypeDescription
query*stringThe query or question that triggered memory retrieval — shown in the header.
items*RetrievedItem[]All candidate facts considered during retrieval, both used and ignored.
classNamestringAdditional CSS classes for the section root.

* required.

Usage

import { RetrievedContextInspector } from "@/components/memory/retrieved-context-inspector";

<RetrievedContextInspector
  query="What language does the user prefer?"
  items={[
    {
      id: "r-1",
      fact: "User prefers TypeScript over JavaScript.",
      scope: "user-scoped",
      op: "retrieved",
      relevance: 0.94,
      tokens: 18,
    },
    {
      id: "r-2",
      fact: "Q1 sprint planning complete.",
      scope: "session-scoped",
      op: "ignored",
      relevance: 0.11,
      tokens: 17,
    },
  ]}
/>