Compare commits

..

3 Commits

Author SHA1 Message Date
Junyan Qin
9ae0c263dc fix: update documentation links and translations for knowledge engine 2026-03-09 20:31:50 +08:00
Junyan Qin
a4e66f6459 feat: update version to 4.9.0 in pyproject.toml, __init__.py, and uv.lock 2026-03-09 20:10:01 +08:00
huanghuoguoguo
2a74a8d6ae Feat/dbm20 rag (#2037)
* feat(rag): add knowledge base migration from v4.9.0 to plugin architecture

Rewrite dbm020 to backup old knowledge_bases data and preserve
external_knowledge_bases table. Add migration API endpoints and
frontend dialog so users can opt-in to auto-install LangRAG plugin
and restore their knowledge bases with original UUIDs preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(rag): query marketplace for actual plugin version instead of 'latest'

The marketplace API does not support 'latest' as a version string.
Fetch the plugin info first to get latest_version, then use that
concrete version for installation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(rag): add data-only migration option and fix dialog width

Add option to migrate knowledge base data without auto-installing
the LangRAG plugin (for offline/intranet environments). Also
narrow the migration dialog to match other confirmation dialogs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: to red and no more

* fix lint

* fix ruff lint

* feat: add external migration

* fix: show

* feat: add external plugin auto download

* feat: update migration messages for knowledge base in multiple languages

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Junyan Qin <rockchinq@gmail.com>
2026-03-09 20:05:38 +08:00
11 changed files with 85 additions and 28 deletions

View File

@@ -422,12 +422,12 @@ export default function HomeSidebar({
const language = localStorage.getItem('langbot_language');
if (language === 'zh-Hans' || language === 'zh-Hant') {
window.open(
'https://docs.langbot.app/zh/insight/guide.html',
'https://docs.langbot.app/zh/insight/guide',
'_blank',
);
} else {
window.open(
'https://docs.langbot.app/en/insight/guide.html',
'https://docs.langbot.app/en/insight/guide',
'_blank',
);
}

View File

@@ -23,9 +23,9 @@ export const sidebarConfigList = [
route: '/home/bots',
description: t('bots.description'),
helpLink: {
en_US: 'https://docs.langbot.app/en/usage/platforms/readme.html',
zh_Hans: 'https://docs.langbot.app/zh/usage/platforms/readme.html',
ja_JP: 'https://docs.langbot.app/ja/usage/platforms/readme.html',
en_US: 'https://docs.langbot.app/en/usage/platforms/readme',
zh_Hans: 'https://docs.langbot.app/zh/usage/platforms/readme',
ja_JP: 'https://docs.langbot.app/ja/usage/platforms/readme',
},
}),
new SidebarChildVO({
@@ -44,9 +44,9 @@ export const sidebarConfigList = [
route: '/home/pipelines',
description: t('pipelines.description'),
helpLink: {
en_US: 'https://docs.langbot.app/en/usage/pipelines/readme.html',
zh_Hans: 'https://docs.langbot.app/zh/usage/pipelines/readme.html',
ja_JP: 'https://docs.langbot.app/ja/usage/pipelines/readme.html',
en_US: 'https://docs.langbot.app/en/usage/pipelines/readme',
zh_Hans: 'https://docs.langbot.app/zh/usage/pipelines/readme',
ja_JP: 'https://docs.langbot.app/ja/usage/pipelines/readme',
},
}),
new SidebarChildVO({
@@ -65,8 +65,8 @@ export const sidebarConfigList = [
route: '/home/monitoring',
description: t('monitoring.description'),
helpLink: {
en_US: 'https://docs.langbot.app/en/features/monitoring.html',
zh_Hans: 'https://docs.langbot.app/zh/features/monitoring.html',
en_US: '',
zh_Hans: '',
},
}),
new SidebarChildVO({
@@ -84,9 +84,9 @@ export const sidebarConfigList = [
route: '/home/knowledge',
description: t('knowledge.description'),
helpLink: {
en_US: 'https://docs.langbot.app/en/usage/knowledge/readme.html',
zh_Hans: 'https://docs.langbot.app/zh/usage/knowledge/readme.html',
ja_JP: 'https://docs.langbot.app/ja/usage/knowledge/readme.html',
en_US: 'https://docs.langbot.app/en/usage/knowledge/readme',
zh_Hans: 'https://docs.langbot.app/zh/usage/knowledge/readme',
ja_JP: 'https://docs.langbot.app/ja/usage/knowledge/readme',
},
}),
new SidebarChildVO({
@@ -105,9 +105,9 @@ export const sidebarConfigList = [
route: '/home/plugins',
description: t('plugins.description'),
helpLink: {
en_US: 'https://docs.langbot.app/en/usage/plugin/plugin-intro.html',
zh_Hans: 'https://docs.langbot.app/zh/usage/plugin/plugin-intro.html',
ja_JP: 'https://docs.langbot.app/ja/usage/plugin/plugin-intro.html',
en_US: 'https://docs.langbot.app/en/usage/plugin/plugin-intro',
zh_Hans: 'https://docs.langbot.app/zh/usage/plugin/plugin-intro',
ja_JP: 'https://docs.langbot.app/ja/usage/plugin/plugin-intro',
},
}),
];

View File

@@ -36,11 +36,11 @@ export default function NewVersionDialog({
const getUpdateDocsUrl = () => {
const language = i18n.language;
if (language === 'zh-Hans' || language === 'zh-Hant') {
return 'https://docs.langbot.app/zh/deploy/update.html';
return 'https://docs.langbot.app/zh/deploy/update';
} else if (language === 'ja-JP') {
return 'https://docs.langbot.app/ja/deploy/update.html';
return 'https://docs.langbot.app/ja/deploy/update';
} else {
return 'https://docs.langbot.app/en/deploy/update.html';
return 'https://docs.langbot.app/en/deploy/update';
}
};

View File

@@ -1,4 +1,5 @@
import { useEffect, useState } from 'react';
import Link from 'next/link';
import { useForm } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';
import { z } from 'zod';
@@ -264,9 +265,12 @@ export default function KBForm({
<p className="text-muted-foreground">
{t('knowledge.noEnginesAvailable')}
</p>
<p className="text-sm text-muted-foreground">
<Link
href="/home/plugins"
className="text-sm text-primary hover:underline"
>
{t('knowledge.installEngineHint')}
</p>
</Link>
</div>
);
}

View File

@@ -5,7 +5,6 @@
.knowledgeListContainer {
width: 100%;
margin-top: 2rem;
padding-left: 0.8rem;
padding-right: 0.8rem;
display: grid;

View File

@@ -562,8 +562,7 @@ function MarketPageContent({
{/* Recommendation Lists */}
{!searchQuery &&
componentFilter === 'all' &&
selectedTags.length === 0 &&
currentPage === 1 && (
selectedTags.length === 0 && (
<div className="pt-4">
<RecommendationLists
lists={recommendationLists}

View File

@@ -1,6 +1,12 @@
import { PluginMarketCardVO } from './PluginMarketCardVO';
import { useTranslation } from 'react-i18next';
import { Badge } from '@/components/ui/badge';
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from '@/components/ui/tooltip';
import {
Wrench,
AudioWaveform,
@@ -9,6 +15,7 @@ import {
ExternalLink,
Book,
FileText,
Info,
} from 'lucide-react';
import { useState } from 'react';
import { Button } from '@/components/ui/button';
@@ -46,6 +53,13 @@ export default function PluginMarketCardComponent({
Parser: <FileText className="w-4 h-4" />,
};
// Plugins that only contain KnowledgeRetriever components are deprecated
const isDeprecated = (() => {
if (!cardVO.components) return false;
const keys = Object.keys(cardVO.components);
return keys.length > 0 && keys.every((k) => k === 'KnowledgeRetriever');
})();
return (
<div
className="w-[100%] h-auto min-h-[8rem] sm:min-h-[9rem] bg-white rounded-[10px] shadow-[0px_0px_4px_0_rgba(0,0,0,0.2)] p-3 sm:p-[1rem] hover:shadow-[0px_3px_6px_0_rgba(0,0,0,0.12)] transition-all duration-200 hover:scale-[1.005] dark:bg-[#1f1f22] relative"
@@ -66,8 +80,34 @@ export default function PluginMarketCardComponent({
<div className="text-[0.65rem] sm:text-[0.7rem] text-[#666] dark:text-[#999] truncate w-full">
{cardVO.pluginId}
</div>
<div className="text-base sm:text-[1.2rem] text-black dark:text-[#f0f0f0] truncate w-full">
{cardVO.label}
<div className="flex items-center gap-1.5 w-full min-w-0">
<div className="text-base sm:text-[1.2rem] text-black dark:text-[#f0f0f0] truncate">
{cardVO.label}
</div>
{isDeprecated && (
<TooltipProvider delayDuration={200}>
<Tooltip>
<TooltipTrigger
asChild
onClick={(e) => e.preventDefault()}
>
<Badge
variant="outline"
className="text-[0.6rem] px-1.5 py-0 h-4 flex-shrink-0 border-red-400 text-red-500 dark:border-red-500 dark:text-red-400 gap-0.5 cursor-help"
>
{t('market.deprecated')}
<Info className="w-2.5 h-2.5" />
</Badge>
</TooltipTrigger>
<TooltipContent
side="top"
className="max-w-[240px] text-xs"
>
{t('market.deprecatedTooltip')}
</TooltipContent>
</Tooltip>
</TooltipProvider>
)}
</div>
</div>

View File

@@ -483,6 +483,9 @@ const enUS = {
allComponents: 'All Components',
requestPlugin: 'Request Plugin',
viewDetails: 'View Details',
deprecated: 'Deprecated',
deprecatedTooltip:
'Please install the corresponding Knowledge Engine plugin.',
tags: {
filterByTags: 'Filter by Tags',
selected: 'selected',
@@ -757,7 +760,7 @@ const enUS = {
engineSettingsReadonly: 'read-only in edit mode',
retrievalSettings: 'Retrieval Settings',
noEnginesAvailable: 'No knowledge base engines available',
installEngineHint: 'Please install a knowledge base plugin first',
installEngineHint: 'Please install a "Knowledge Engine" plugin first',
createKnowledgeBaseFailed: 'Failed to create knowledge base: ',
loadKnowledgeBaseFailed: 'Failed to load knowledge base: ',
deleteKnowledgeBaseFailed: 'Failed to delete knowledge base: ',

View File

@@ -491,6 +491,9 @@ const jaJP = {
noTags: 'タグがありません',
},
viewDetails: '詳細を表示',
deprecated: '非推奨',
deprecatedTooltip:
'対応する「ナレッジエンジン」プラグインをインストールしてください。',
},
mcp: {
title: 'MCP',
@@ -749,6 +752,9 @@ const jaJP = {
fileName: 'ファイル名',
noResults: '検索結果がありません',
retrieveError: '検索に失敗しました:',
noEnginesAvailable: '利用可能なナレッジエンジンがありません',
installEngineHint:
'先に「ナレッジエンジン」プラグインをインストールしてください',
unknownEngine: '不明なエンジン',
loadKnowledgeBaseFailed: 'ナレッジベースの読み込みに失敗しました:',
deleteKnowledgeBaseFailed: 'ナレッジベースの削除に失敗しました:',

View File

@@ -468,6 +468,8 @@ const zhHans = {
noTags: '暂无标签',
},
viewDetails: '查看详情',
deprecated: '已弃用',
deprecatedTooltip: '请安装对应「知识引擎」插件',
},
mcp: {
title: 'MCP',
@@ -726,7 +728,7 @@ const zhHans = {
engineSettingsReadonly: '编辑模式下不可修改',
retrievalSettings: '检索设置',
noEnginesAvailable: '没有可用的知识库引擎',
installEngineHint: '请先安装知识插件',
installEngineHint: '请先安装知识引擎」插件',
createKnowledgeBaseFailed: '知识库创建失败:',
loadKnowledgeBaseFailed: '知识库加载失败:',
deleteKnowledgeBaseFailed: '知识库删除失败:',

View File

@@ -461,6 +461,8 @@ const zhHant = {
noTags: '暫無標籤',
},
viewDetails: '查看詳情',
deprecated: '已棄用',
deprecatedTooltip: '請安裝對應「知識引擎」插件',
},
mcp: {
title: 'MCP',
@@ -709,6 +711,8 @@ const zhHant = {
fileName: '文檔名稱',
noResults: '暫無結果',
retrieveError: '檢索失敗:',
noEnginesAvailable: '沒有可用的知識庫引擎',
installEngineHint: '請先安裝「知識引擎」插件',
unknownEngine: '未知引擎',
loadKnowledgeBaseFailed: '知識庫載入失敗:',
deleteKnowledgeBaseFailed: '知識庫刪除失敗:',