feat: Add comprehensive documentation for WeKnora knowledge base and wiki features

- Introduced multiple new documentation files, including a complete documentation index, quick reference guides, and comprehensive analyses of the knowledge base and wiki settings.
- The new files provide detailed insights into the architecture, data models, API endpoints, and implementation strategies for the knowledge base and wiki functionalities.
- Enhanced navigation and usability for developers and team members by summarizing key components, configurations, and data flows related to the knowledge base system.

These additions significantly improve the clarity and accessibility of documentation, supporting better onboarding and reference for current and future team members.
This commit is contained in:
wizardchen
2026-04-20 19:16:46 +08:00
parent 53ecd5df5d
commit 28deb8282f
51 changed files with 13027 additions and 271 deletions
@@ -6,7 +6,8 @@
</div>
<div class="settings-group">
<!-- Question Generation feature -->
<!-- Question Generation feature (only useful for RAG indexing) -->
<template v-if="ragEnabled !== false">
<div class="setting-row">
<div class="setting-info">
<label>{{ $t('knowledgeEditor.advanced.questionGeneration.label') }}</label>
@@ -41,6 +42,7 @@
</div>
</div>
</div>
</template>
</div>
</div>
@@ -56,6 +58,7 @@ interface QuestionGenerationConfig {
interface Props {
questionGeneration?: QuestionGenerationConfig
ragEnabled?: boolean
allModels?: any[]
}
@@ -0,0 +1,109 @@
<template>
<div class="kb-multimodal-settings">
<div class="section-header">
<h2>{{ $t('knowledgeEditor.indexing.title') }}</h2>
<p class="section-description">{{ $t('knowledgeEditor.indexing.description') }}</p>
</div>
<div class="settings-group">
<!-- Hybrid Search (vector + keyword combined) -->
<div class="setting-row">
<div class="setting-info">
<label>{{ $t('knowledgeEditor.indexing.searchTitle') }}</label>
<p class="desc">{{ $t('knowledgeEditor.indexing.searchDesc') }}</p>
</div>
<div class="setting-control">
<t-switch
:model-value="searchEnabled"
@change="handleSearchToggle"
size="medium"
/>
</div>
</div>
<!-- Wiki -->
<div class="setting-row">
<div class="setting-info">
<label>{{ $t('knowledgeEditor.indexing.wikiTitle') }}</label>
<p class="desc">{{ $t('knowledgeEditor.indexing.wikiDesc') }}</p>
</div>
<div class="setting-control">
<t-switch
:model-value="modelValue.wikiEnabled"
@change="(val: boolean) => update('wikiEnabled', val)"
size="medium"
/>
</div>
</div>
<!-- Wiki sub-settings (inline when enabled) -->
<template v-if="modelValue.wikiEnabled">
<slot name="wiki-settings" />
</template>
<!-- Knowledge Graph -->
<div class="setting-row">
<div class="setting-info">
<label>{{ $t('knowledgeEditor.indexing.graphTitle') }}</label>
<p class="desc">{{ $t('knowledgeEditor.indexing.graphDesc') }}</p>
</div>
<div class="setting-control">
<t-switch
:model-value="modelValue.graphEnabled"
@change="(val: boolean) => update('graphEnabled', val)"
size="medium"
/>
</div>
</div>
<!-- Graph sub-settings (inline when enabled) -->
<template v-if="modelValue.graphEnabled">
<slot name="graph-settings" />
</template>
</div>
</div>
</template>
<script setup lang="ts">
import { computed } from 'vue'
export interface IndexingStrategy {
vectorEnabled: boolean
keywordEnabled: boolean
wikiEnabled: boolean
graphEnabled: boolean
}
const props = defineProps<{
modelValue: IndexingStrategy
}>()
const emit = defineEmits<{
(e: 'update:modelValue', value: IndexingStrategy): void
}>()
// Search = vector + keyword combined (the system always uses hybrid search internally)
const searchEnabled = computed(() => props.modelValue.vectorEnabled || props.modelValue.keywordEnabled)
const handleSearchToggle = (val: boolean) => {
emit('update:modelValue', {
...props.modelValue,
vectorEnabled: val,
keywordEnabled: val,
})
}
const update = (field: keyof IndexingStrategy, value: boolean) => {
emit('update:modelValue', {
...props.modelValue,
[field]: value,
})
}
</script>
<style lang="less">
/* NOT scoped — these classes must match the parent modal's scoped styles.
Since slot content is rendered in the parent scope, only the wrapper
elements defined HERE need their own styles. We replicate the same
design tokens used by .kb-multimodal-settings in the parent. */
</style>
@@ -25,15 +25,15 @@
</div>
</div>
<!-- Embedding 嵌入模型 -->
<div class="setting-row">
<!-- Embedding 嵌入模型 (仅 RAG 检索启用时必填) -->
<div v-if="ragEnabled !== false" class="setting-row">
<div class="setting-info">
<label>{{ $t('knowledgeEditor.models.embeddingLabel') }} <span class="required">*</span></label>
<label>{{ $t('knowledgeEditor.models.embeddingLabel') }} <span v-if="ragEnabled" class="required">*</span></label>
<p class="desc">{{ $t('knowledgeEditor.models.embeddingDesc') }}</p>
<t-alert
v-if="hasFiles"
theme="warning"
:message="$t('knowledgeEditor.models.embeddingLocked')"
<t-alert
v-if="hasFiles"
theme="warning"
:message="$t('knowledgeEditor.models.embeddingLocked')"
style="margin-top: 8px;"
/>
</div>
@@ -51,6 +51,24 @@
</div>
</div>
<!-- Wiki 合成模型 (仅当 Wiki 启用时显示) -->
<div v-if="wikiEnabled" class="setting-row">
<div class="setting-info">
<label>{{ $t('knowledgeEditor.wiki.synthesisModelLabel') }}</label>
<p class="desc">{{ $t('knowledgeEditor.wiki.synthesisModelTip') }}</p>
</div>
<div class="setting-control">
<ModelSelector
model-type="KnowledgeQA"
:selected-model-id="config.wikiSynthesisModelId"
:all-models="allModels"
@update:selected-model-id="handleWikiModelChange"
@add-model="handleAddModel('knowledgeqa')"
:placeholder="$t('knowledgeEditor.wiki.synthesisModelPlaceholder')"
/>
</div>
</div>
</div>
</div>
</template>
@@ -65,11 +83,14 @@ interface ModelConfig {
llmModelId?: string
embeddingModelId?: string
vllmModelId?: string
wikiSynthesisModelId?: string
}
interface Props {
config: ModelConfig
hasFiles: boolean
wikiEnabled?: boolean
ragEnabled?: boolean
allModels?: any[]
}
@@ -102,6 +123,14 @@ const handleEmbeddingChange = (modelId: string) => {
})
}
// 处理Wiki合成模型变化
const handleWikiModelChange = (modelId: string) => {
emit('update:config', {
...props.config,
wikiSynthesisModelId: modelId
})
}
// 处理添加模型按钮点击
const handleAddModel = (subSection: string) => {
// 打开全局设置对话框,并导航到对应的模型子页面