Knowledge sources
4 sources- pricing-handbook.pdfFile · 2.4 MBQueued
- docs.example.comWebsite · 142 pagesQueued
- contracts-scan-2019.pdfFile · 8.4 MBQueued
- Legal templatesFolder · 38 filesQueued
The files, websites and folders an agent knows, each with its index progress and status. Upload files, add a website or connect a folder from one Add source menu, retry a failed source, remove one.
The files, websites and folders an agent knows, and how far each is indexed. Not FileUpload.
Four sources index two at a time, and a website joins a moment in: it queues, then indexes. The scanned PDF fails partway; Retry it and it runs to the end. Add source uploads files, adds a website (it queues, then indexes) or connects a folder. Remove a row, or Replay.
Your app indexes; pass each source's status and progress in as it moves. Set a failed source's error in plain words. onRetry should set it back to indexing at 0, and onRemove should drop it from sources: its row folds away in place and focus moves to the next row. onUpload gets rejected files with a reason: add them as failed rows. Only status changes are announced to screen readers.
import { KnowledgeSources } from "agentic-ds-kit";From contracts/knowledgesources.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
| sources | array | Yes | — | { id, name, type, status, progress?, size?, count?, error?, iconSrc? }[], in the order to show; rows are keyed by id. progress is 0 to 100 while indexing (left out, the bar is indeterminate). size is bytes for a file; count is pages for a site, files for a folder. error is the plain-words reason on a failed source. iconSrc is a favicon or logo; left out, the type icon shows. Empty renders a kit Empty. |
| type | file | site | folder | No | — | Each source's type. Shown as an icon and a word (File, Website, Folder). |
| status | queued | indexing | ready | failed | No | — | Each source's status, always an icon plus a word. ready is quiet (a muted check alone, with Ready as hidden text and a Tooltip; green only while its check draws on a live change), so colour marks only failed and indexing. indexing shows a still brand mark, a shimmering Indexing… and a Progress bar with its percent on its own line under the name and detail, which grows in when indexing starts and folds away when it ends; failed shows the reason in place of the detail, in secondary text, so only the status is red. |
| onUpload | function | No | — | (accepted: File[], rejected: { file, reason }[]) => void. Adds Upload files to the Add source menu (maxSizeLabel is its muted hint); it opens the file picker. Files that miss accept or pass maxFileSize come back in rejected with a plain-words reason; add them as failed sources with that reason as error. |
| onAddWebsite | function | No | — | (address) => void. Adds Add a website: the same menu switches to a step with one address field and an Add button. The address comes trimmed, without http(s):// or a trailing slash; one that does not parse or is already a site in sources gets an inline error that keeps what was typed. |
| onConnectFolder | function | No | — | (key) => void. With folders, adds Connect a folder: the menu switches to the list of folders; picking one closes the menu. |
| folders | array | No | — | { key, name, detail? }[], the folders that can still be connected. Empty shows All folders connected. |
| accept | string | No | — | The file input accept list, also checked on upload (".pdf,.docx,.md", "image/*"). |
| maxFileSize | number | No | — | Largest file in bytes; bigger files come back in onUpload's rejected list. |
| maxSizeLabel | string | No | — | The muted hint under Upload files, e.g. "PDF, DOCX or MD, max 20 MB". |
| onRetry | function | No | — | (id) => void. Failed rows show a Retry icon Button (RotateCcw, Tooltip Retry, named Retry {name}) just before the status, which stays right beside Remove. Set the source back to queued or indexing at 0; its bar fills again. |
| onRemove | function | No | — | (id) => void. Every row shows a Remove icon Button (X while queued or indexing, Trash2 after). Drop the source from sources; its row folds away in place. |
| title | string | No | — | Header title, Card name and list name. Default KitLabels knowledgeSources ("Knowledge sources"). |
Choose files Button in a dashed drop zone (or a compact Button-only row) plus a list of file rows with progress, done, and error states.
A list of usage limits, one a row: the limit's name, how much is used of it, a bar, and a short note.
A filterable catalogue of integrations: search, a category filter with an optional Connected segment, and one tile per provider that ends in a status word (Not connected, Connected, Needs attention, Paused, Connecting…, Coming soon) and at most one action (Connect, Manage, or a sync Switch), with an optional overflow menu in the tile head. connectFlow "detail" opens a Drawer with what it can access and Connect or Disconnect.
An assistant reply with inline citation marks that preview their passage in a hover card, and sources folded into one pill with site icons.