Knowledge base manager

A React block (a whole screen) in Beamline's AI workspace app.

What your assistant knows and whether it is fresh: sources with live sync status (syncing with progress, out of date, failed with the reason and Retry), the chunks each source became, and a test bench where you ask a question and see the cited answer beside the chunks it was built from.

Use it for

  • The admin screen behind an AI assistant: connect sources, watch them sync, fix failures, and test what the assistant answers from them.
  • Any retrieval system whose owners need to see its sources, their freshness and what a question retrieves.

Not for

Anatomy

  • header: title, totals (sources, chunks rolling as they grow, last sync) and the one primary action, Add source
  • sources: a filter (all / needs attention), then one row per source: kind icon, name, where it lives, chunk count, and its state in words with a glyph (synced and when, syncing with a progress bar, queued, out of date with Sync now, failed with the reason and Retry); a row menu syncs or removes
  • test bench (tab): a question field and Ask; the answer streams with numbered citations, and the chunks it retrieved sit beside it, scored, the ones the answer used checked
  • gaps (on an idle bench): this week's questions with no good answer and how often each was asked, each with Test
  • chunks (tab): the selected source's chunks with a search that marks the words

Variants

  • 0: room: one column under 48rem (sources, then the bench); sources and bench side by side from 48rem; chunks in a grid from 64rem

States

  • loading (skeleton rows)
  • no sources yet (what goes here, Add source)
  • every source synced / some need attention (the filter counts them)
  • source syncing (progress, or a moving bar when the total is unknown), queued, out of date, failed
  • chunk count unknown (—)
  • test: idle (suggested questions), searching, answering, answered, nothing relevant found (says so and which sources were searched), error with Retry

Keyboard

  • Sources are a list of buttons: Tab or arrows reach each, Enter selects it for the Chunks tab
  • Each row's menu: Enter or Space opens; Sync now and Remove
  • Question field: Enter asks
  • Tabs: arrows move between Test and Chunks

Motion

A syncing source fills its bar and its chunk count rolls up; when it finishes the spinner closes into a check and the words morph (Syncing → Synced just now). A new answer flows in at reading pace, then its sources list arrives. Rows that change state never move. Idle: nothing runs.

Props

PropTypeDefaultDescription
sources (required)KnowledgeSource[]—Sources managed by the knowledge index, with their sync state and chunk counts. Required.
chunksContextChunk[] | null—Chunks of the selected source; null while they load.
testKnowledgeTest—Current test question, streamed answer and retrieval results; defaults to null before a test.
suggestionsstring[]—Questions to try on an empty bench.
gaps{ question: string; count: number }[]—Questions customers asked that found no good answer, most asked first: the gaps to fill.
loadingboolean—Shows the loading state while data or an operation is pending. Defaults to false.
onAsk(question: string) => void—Runs the request using the entered question; no handler by default.
onSync(id: string) => void—Sync one source now (also Retry for a failed one).
onRemove(id: string) => void—Runs the remove action for the chosen item; no handler by default.
onAddSource() => void—Starts adding a knowledge source; no handler by default.
className / classNames / style / refstring / KnowledgeBaseClassNames / CSSProperties / Ref<HTMLElement>—className: Classes on the documented visual root; no override by default. classNames: Classes for the named visual parts; no part overrides by default. style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default.
selectedstring[] (legacy: string)—Stable selected row IDs. Legacy scalar selected opens a record; use openSource for that.
defaultSelectedstring[] (legacy: string)—Initial selected row IDs; defaults to an empty list.
onSelectedChange((ids: string[]) => void)—Reports selected row IDs; opening a record uses onOpenSourceChange.
titlestring—Title over the screen. Default "Knowledge base".
classNamestring—Classes on the documented visual root; no override by default.
classNamesPartial<Record<"root" | "header" | "title" | "filter" | "answer" | "source" | "grid" | …—Classes for the named visual parts; no part overrides by default.
styleCSSProperties—Inline styles on the documented visual root; no inline overrides by default.
refRef<HTMLElement>—Receives the documented root element; no ref by default.
sortListSort—
manualboolean—Server owns ordering, filters, search and page slicing. Default false.
totalnumber | null—Deprecated: Use rowCount. Canonical rowCount wins, including null.
errorReactNode | Error—Errors retain the last completed rows. Error objects are rendered by their message.
onQueryChange((query: string) => void)—
pagenumber—One-based requested page. Default 1.
filtersListFilters—
querystring—
onRetry(() => void | Promise<unknown>)—
defaultSortListSort—
onSortChange((sort: ListSort) => void)—
defaultFiltersListFilters—
onFiltersChange((filters: ListFilters) => void)—
defaultQuerystring—
selectableboolean—
emptyLabelstring—
allowSelectAllMatchingboolean—
onSelectAllMatching((scope: { rowCount: number; query: string; filters: ListFilters; }) => void)—
paginationboolean—Enable page controls explicitly. Page-related props also enable them, unless onEndReached is supplied.
defaultPagenumber—
onPageChange((page: number) => void)—
pageSizenumber—Positive rows per page. Default 25.
defaultPageSizenumber—
onPageSizeChange((pageSize: number) => void)—
rowCountnumber | null—Total matching rows on the server. null means unknown. Local grids calculate it before slicing.
onEndReached(() => void | Promise<unknown>)—Append mode: fetch another batch. The app appends it to the supplied rows.
hasMoreboolean—Whether another batch exists; defaults to true with onEndReached. False stops requests.
loadingMoreboolean—An append request is pending; retain every loaded row.
openSourcestring | null—
defaultOpenSourcestring | null—
onOpenSourceChange((id: string | null) => void)—

Built from

Dependencies

lucide-react

Import

import { KnowledgeBase } from "@beamline/knowledge-base";

Get it

Knowledge base manager is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent

More in AI workspace

  • AI agent workspace: Threads, a conversation that opens on the thread's earlier turns (each with its trace, the tools the agent called, a cited answer and any table it…
  • Agent runs monitor: Every run of your agents in one place: success rate, run time, tokens and spend; the last runs as a strip of status blocks; a live table where running…
  • Agent monitor: Agents in production and on test. Monitor shows every agent or one over 24 hours, 7 or 14 days: runs, tokens, estimated cost and average run time counted…
  • Conversation history: Past conversations with an assistant, ready to pick up again: the list by day with bookmarks and unsent drafts, a search through every message that…
  • Reading library: A read-it-later library: saved views that are live filters (a query with every unreadable part named, the number that matches now, saved with a name; a…
  • Artifact workbench: Where the things an assistant makes are checked before they leave: every document, piece of code, small app and data result from a conversation, each…
  • AI image studio: Write a prompt, pick a shape, a style and how many, and watch the variations generate side by side; each one opens full screen and can be upscaled or…
  • Voice agent: A voice agent in three layouts on one session: a workspace with the agent's orb large on a stage (the line being said shows under it, questions to ask…
  • Model playground: Try one prompt on up to three models side by side: pick each model with its price and speed in view, set the system prompt, temperature and length once…
  • Model inspector: A design model's objects without needing the 3D view: the model tree, where objects with the same name are told apart by id and path; the selected…
  • Model issues: Issues pinned to the objects of a design model. The queue says the scope beside every count (open in the project, on the loaded models, on this version)…
  • Agent builder: An agent's configuration beside an assistant that proposes tools. Ask for what the agent should do and the assistant's proposal lists each tool with why…
  • Workflow composer: A workflow drafted from a sentence and finished by hand. The prompt drafts steps that arrive one by one on the graph (a draft cut short keeps what came…
  • Data binding: Bind an object's properties to a view model. Each property says whether it is bound, incomplete or mismatched. A binding takes its source from the…

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.