From 1f2d20244eed18ae0a96e754a72e515126e4e32e Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Wed, 17 Jun 2026 23:18:51 +0300 Subject: [PATCH] feat(ai-chat): show RAG indexing coverage in AI settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Display "Indexed N of M pages" on the AI provider settings page so admins can see how much of the wiki is covered by vector-RAG semantic search. - page-embedding.repo: add countIndexedPages() — distinct non-deleted pages that have stored embeddings in the workspace - page.repo: add countByWorkspace() — total non-deleted pages - ai-settings.service: compute both counts in getMasked() (Promise.all) and return them with the masked settings; inject PageEmbeddingRepo + PageRepo - MaskedAiSettings / IAiSettings: add indexedPages + totalPages - ai-provider-settings: render a dimmed coverage line under "Embedding model" - i18n: add the "Indexed {{indexed}} of {{total}} pages" key (en-US, ru-RU) --- .../public/locales/en-US/translation.json | 1 + .../public/locales/ru-RU/translation.json | 1 + .../components/ai-provider-settings.tsx | 9 +++++++ .../workspace/services/ai-settings-service.ts | 3 +++ .../repos/ai-chat/page-embedding.repo.ts | 24 +++++++++++++++++++ .../src/database/repos/page/page.repo.ts | 14 +++++++++++ .../integrations/ai/ai-settings.service.ts | 14 ++++++++++- apps/server/src/integrations/ai/ai.types.ts | 3 +++ 8 files changed, 68 insertions(+), 1 deletion(-) diff --git a/apps/client/public/locales/en-US/translation.json b/apps/client/public/locales/en-US/translation.json index f5b9f4bd..f99cfc2b 100644 --- a/apps/client/public/locales/en-US/translation.json +++ b/apps/client/public/locales/en-US/translation.json @@ -92,6 +92,7 @@ "Import pages": "Import pages", "Import pages & space settings": "Import pages & space settings", "Importing pages": "Importing pages", + "Indexed {{indexed}} of {{total}} pages": "Indexed {{indexed}} of {{total}} pages", "invalid invitation link": "invalid invitation link", "Invitation signup": "Invitation signup", "Invite by email": "Invite by email", diff --git a/apps/client/public/locales/ru-RU/translation.json b/apps/client/public/locales/ru-RU/translation.json index 3d93ec67..25ff2530 100644 --- a/apps/client/public/locales/ru-RU/translation.json +++ b/apps/client/public/locales/ru-RU/translation.json @@ -92,6 +92,7 @@ "Import pages": "Импорт страниц", "Import pages & space settings": "Импорт страниц и настройки пространства", "Importing pages": "Импортирование страниц", + "Indexed {{indexed}} of {{total}} pages": "Проиндексировано {{indexed}} из {{total}} страниц", "invalid invitation link": "недействительная ссылка-приглашение", "Invitation signup": "Регистрация по приглашению", "Invite by email": "Пригласить по электронной почте", diff --git a/apps/client/src/features/workspace/components/settings/components/ai-provider-settings.tsx b/apps/client/src/features/workspace/components/settings/components/ai-provider-settings.tsx index 47a70a7e..6458f2e4 100644 --- a/apps/client/src/features/workspace/components/settings/components/ai-provider-settings.tsx +++ b/apps/client/src/features/workspace/components/settings/components/ai-provider-settings.tsx @@ -188,6 +188,15 @@ export default function AiProviderSettings() { {...form.getInputProps("embeddingModel")} /> + {settings && ( + + {t("Indexed {{indexed}} of {{total}} pages", { + indexed: settings.indexedPages ?? 0, + total: settings.totalPages ?? 0, + })} + + )} +