Knowledge sources

Pro

Where the agents' knowledge comes from, grouped by door: the environment itself, sampled data, files and links people shared, answers they gave. Each source says when it was last read and whether that's overdue; a failed read says why.

Markdown

Preview

Install

With the Candor CLI

First time? Get started sets up the registry and theme. Or with shadcn directly: npx shadcn@latest add @candor/knowledge-sources

Brings in: button, freshness-stamp, know, locale, status-dot, utils · npm: lucide-react@^1.67.0

Usage

TSX · The example above
"use client"

import type { KnowSource } from "@/lib/know"
import { KnowledgeSources } from "@/components/knowledge-sources"

const ago = (m: number) => new Date(Date.now() - m * 60_000).toISOString()

const sources: KnowSource[] = [
  { id: "k1", door: "config", label: "Staging: code and schema", readAt: ago(60 * 5), everyHours: 24, status: "succeeded", extent: "4 repos · 86 tables · 142 migrations" },
  { id: "k2", door: "config", label: "Production: code and schema", readAt: ago(60 * 52), everyHours: 24, status: "succeeded", extent: "4 repos · 86 tables · 139 migrations" },
  { id: "k3", door: "file", label: "Data model notes v3.pdf", addedBy: "Priya", readAt: ago(60 * 24 * 12), status: "succeeded", extent: "24 pages" },
  { id: "k4", door: "file", label: "Data residency rules.xlsx", addedBy: "Dana", readAt: null, status: "running" },
  { id: "k5", door: "link", label: "wiki.acme.example/platform/handbook", addedBy: "Maya", readAt: ago(60 * 24 * 3), status: "failed", error: "The page needs a sign-in Keel doesn't have. Export it as PDF and add it as a file." },
  { id: "k6", door: "answer", label: "“partner tier is being replaced by region”", addedBy: "Priya", readAt: ago(60 * 24 * 9), status: "succeeded" },
]

export default function Example() {
  return <KnowledgeSources className="max-w-xl" sources={sources} onAdd={() => {}} onReread={() => {}} />
}

<KnowledgeSources>

PropTypeDefaultDescription
sourcesrequiredKnowSource[]—Every source, grouped by where it came from, each with when it was last read and any error.
onAdd(() => void) | undefined—Shows an Add button; called when it's clicked.
onReread((id: string) => void) | undefined—Shows a read-again button on each source not already being read; called with its id.
classNamestring | undefined—Extra classes for the outer element.

Strings

The fixed words, in English by default. Change any of them under knowledgeSources in <LocaleProvider strings={{ … }}>; the table is exported as knowledgeSourcesStrings.

KeyEnglish
labelKnowledge sources
sourcesSources
addAdd
emptyNothing has been read yet.
readingNowReading now
fromfrom {name}
rereadRe-read
rereadSourceRe-read {name}
doorConfigConfiguration
doorDataData, sampled
doorFileFiles
doorLinkLinks
doorAnswerAnswers you gave
doorReleaseNotesRelease notes