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]>
99 lines
2.9 KiB
TypeScript
99 lines
2.9 KiB
TypeScript
import {
|
|
BookOpen,
|
|
Bot,
|
|
CpuAi,
|
|
Database,
|
|
DatabaseBackup,
|
|
KeyRound,
|
|
Layers,
|
|
Library,
|
|
LockKeyhole,
|
|
Monitor,
|
|
Plug,
|
|
Users,
|
|
SlidersHorizontal,
|
|
UserRound,
|
|
Variable,
|
|
Wrench,
|
|
type LucideIcon,
|
|
} from "lucide-react";
|
|
import type { BUN_SQLITE_COBBLE_USER_TYPES } from "@/db/types/db";
|
|
import canListUsers from "@/src/utils/rbac/can-list-users";
|
|
import canManageCrew from "@/src/utils/rbac/can-manage-crew";
|
|
|
|
export type SettingsPage = {
|
|
title: string;
|
|
url: string;
|
|
Icon: LucideIcon;
|
|
/**
|
|
* Shown and served to super admins only.
|
|
*/
|
|
super_admin_only?: boolean;
|
|
/**
|
|
* Who sees it, when that's an RBAC rule rather than super admins only.
|
|
*/
|
|
can_view?: (params: { user_types?: BUN_SQLITE_COBBLE_USER_TYPES[] | null }) => boolean;
|
|
};
|
|
|
|
export const SettingsComputersPath = "/admin/settings/computers";
|
|
export const SettingsBackupsPath = "/admin/settings/backups";
|
|
export const SettingsDatabasePath = "/admin/settings/database";
|
|
|
|
/**
|
|
* The `/admin/settings/*` sub pages, listed in the rail on every settings
|
|
* page. The first one is where `/admin/settings` lands.
|
|
*/
|
|
export const SettingsPages: SettingsPage[] = [
|
|
{
|
|
title: "General",
|
|
url: "/admin/settings/general",
|
|
Icon: SlidersHorizontal,
|
|
},
|
|
{ title: "Profile", url: "/admin/settings/profile", Icon: UserRound },
|
|
{
|
|
title: "Change password",
|
|
url: "/admin/settings/change-password",
|
|
Icon: KeyRound,
|
|
},
|
|
{ title: "Secrets", url: "/admin/settings/secrets", Icon: LockKeyhole },
|
|
{ title: "Bots", url: "/admin/settings/bots", Icon: Bot, can_view: canManageCrew },
|
|
{ title: "Workspaces", url: "/admin/settings/workspaces", Icon: Layers, can_view: canManageCrew },
|
|
{ title: "Computers", url: SettingsComputersPath, Icon: Monitor, can_view: canManageCrew },
|
|
{ title: "MCPs", url: "/admin/settings/mcps", Icon: Plug, can_view: canManageCrew },
|
|
{ title: "Tools", url: "/admin/settings/tools", Icon: Wrench, can_view: canManageCrew },
|
|
{ title: "Skills", url: "/admin/settings/skills", Icon: BookOpen, can_view: canManageCrew },
|
|
{ title: "Knowledgebases", url: "/admin/settings/knowledgebases", Icon: Library, can_view: canManageCrew },
|
|
{
|
|
title: "Users",
|
|
url: "/admin/settings/users",
|
|
Icon: Users,
|
|
can_view: canListUsers,
|
|
},
|
|
{
|
|
title: "Models",
|
|
url: "/admin/settings/models",
|
|
Icon: CpuAi,
|
|
super_admin_only: true,
|
|
},
|
|
{
|
|
title: "Environment",
|
|
url: "/admin/settings/environment",
|
|
Icon: Variable,
|
|
super_admin_only: true,
|
|
},
|
|
{
|
|
title: "Backups",
|
|
url: SettingsBackupsPath,
|
|
Icon: DatabaseBackup,
|
|
super_admin_only: true,
|
|
},
|
|
{
|
|
title: "Database",
|
|
url: SettingsDatabasePath,
|
|
Icon: Database,
|
|
super_admin_only: true,
|
|
},
|
|
];
|
|
|
|
export const SettingsDefaultPath = "/admin/settings/general";
|