Knowledge sources
ProWhere 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.
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
"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>
| Prop | Type | Default | Description |
|---|---|---|---|
| sourcesrequired | KnowSource[] | — | 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. |
| className | string | 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.
| Key | English |
|---|---|
| label | Knowledge sources |
| sources | Sources |
| add | Add |
| empty | Nothing has been read yet. |
| readingNow | Reading now |
| from | from {name} |
| reread | Re-read |
| rereadSource | Re-read {name} |
| doorConfig | Configuration |
| doorData | Data, sampled |
| doorFile | Files |
| doorLink | Links |
| doorAnswer | Answers you gave |
| doorReleaseNotes | Release notes |