Files
cobble/src/components/general/extension-add-select.tsx
T
tbenandClaude Opus 5.5 e7b23b7454 Add knowledgebases
Knowledgebases give bots RAG over documents, scoped like extensions: to
particular bots, to a workspace, or to every bot, with their own button
beside Tools in the composer. Documents are chunked and embedded by the
file-ingest worker with the install's embedding model, which is now an
install-wide setting rather than a per-bot one.

- Word search runs on an FTS5 index ranked by BM25, with a scored LIKE
  fallback for scripts written without spaces.
- Changing the embedding model re-indexes documents automatically.
- Ingest jobs wait without spending attempts while every embedding model
  rests, fail at once on errors retrying can't fix, and keep passages
  searchable by words when the model refuses.
- Settings > Knowledgebases shows each knowledgebase's and document's
  index state: spinner, warning, grey check (words only) or green check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 16:41:01 +01:00

37 lines
1.2 KiB
TypeScript

import type { BotExtensionKind, BotExtensionsPayload } from "@/src/types";
import { extensionOptionValue, parseExtensionOptionValue } from "@/src/utils/extension-option-value";
import extensionNoun from "@/src/utils/extension-noun";
import InlineAddSelect from "./inline-add-select";
type Props = {
id: string;
addable: BotExtensionsPayload["addable"];
loading?: boolean;
onAdd: (params: { kind: BotExtensionKind; id: number }) => void;
/**
* What the picker offers, for its placeholder.
*/
noun?: string;
};
/**
* Picks an MCP server, tool, skill or knowledgebase to give a bot.
*/
export default function ExtensionAddSelect({ id, addable, loading, onAdd, noun = "tool, MCP server or skill" }: Props) {
return (
<InlineAddSelect
id={id}
noun={noun}
options={addable.map((item) => ({
value: extensionOptionValue(item),
title: `${extensionNoun({ kind: item.kind })}: ${item.name}`,
}))}
loading={loading}
onAdd={({ value }) => {
const picked = parseExtensionOptionValue({ value });
if (picked) onAdd(picked);
}}
/>
);
}