feat: external knowledge bases (#1783)

* Initial plan

* Add backend support for external knowledge bases

Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com>

* Add frontend support for external knowledge bases with tabs UI

Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com>

* Add i18n translations for all languages (Traditional Chinese and Japanese)

Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com>

* Update knowledge base tab list styling to match plugins page

Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com>

* perf: margin-top for kb page

* refactor: switch RetrievalResultEntry to langbot_plugin pkg ones

* feat: knowledge retriever listing and creating

* stash

* refactor: unify sync mechanism for polymorphic components

* feat: use unified retireval result struct in retrieval test page

* chore: remove unused methods

* feat: retriever icon displaying

* feat: localagent retrieval with external kbs

* chore: bump version of langbot-plugin to 0.2.0b1

* fix: i18n

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com>
Co-authored-by: Junyan Qin <rockchinq@gmail.com>
This commit is contained in:
Copilot
2025-11-27 23:19:43 +08:00
committed by GitHub
parent 3c04eeaff9
commit a8481e43f0
33 changed files with 1924 additions and 161 deletions
+32 -3
View File
@@ -162,6 +162,25 @@ export interface KnowledgeBase {
updated_at?: string;
}
export interface ExternalKnowledgeBase {
uuid?: string;
name: string;
description: string;
created_at?: string;
plugin_author: string;
plugin_name: string;
retriever_name: string;
retriever_config?: Record<string, unknown>;
}
export interface ApiRespExternalKnowledgeBases {
bases: ExternalKnowledgeBase[];
}
export interface ApiRespExternalKnowledgeBase {
base: ExternalKnowledgeBase;
}
export interface ApiRespKnowledgeBaseFiles {
files: KnowledgeBaseFile[];
}
@@ -295,12 +314,22 @@ export interface ApiRespWebChatMessages {
messages: Message[];
}
export interface RetrieveResultContent {
type: 'text' | 'image_url' | 'image_base64' | 'file_url';
text?: string;
file_name?: string;
file_url?: string;
image_url?: string;
image_base64?: string;
}
export interface RetrieveResult {
id: string;
content?: RetrieveResultContent[];
metadata: {
file_id: string;
text: string;
uuid: string;
file_id?: string;
text?: string;
uuid?: string;
[key: string]: unknown;
};
distance: number;