diff --git a/dashboard/src/layouts/full/vertical-sidebar/sidebarItem.ts b/dashboard/src/layouts/full/vertical-sidebar/sidebarItem.ts
index f541d1d91..e8f49c741 100644
--- a/dashboard/src/layouts/full/vertical-sidebar/sidebarItem.ts
+++ b/dashboard/src/layouts/full/vertical-sidebar/sidebarItem.ts
@@ -65,11 +65,11 @@ const sidebarItem: menu[] = [
icon: 'mdi-console',
to: '/console'
},
- // {
- // title: 'Alkaid',
- // icon: 'mdi-test-tube',
- // to: '/alkaid'
- // },
+ {
+ title: 'Alkaid',
+ icon: 'mdi-test-tube',
+ to: '/alkaid'
+ },
{
title: '关于',
icon: 'mdi-information',
diff --git a/dashboard/src/views/alkaid/KnowledgeBase.vue b/dashboard/src/views/alkaid/KnowledgeBase.vue
index e31644e47..29889f41f 100644
--- a/dashboard/src/views/alkaid/KnowledgeBase.vue
+++ b/dashboard/src/views/alkaid/KnowledgeBase.vue
@@ -18,7 +18,9 @@
-
知识库列表
+
知识库列表
+ mdi-information-outline
+
创建知识库
@@ -698,6 +700,10 @@ export default {
this.showSnackbar('获取嵌入模型列表失败', 'error');
return [];
});
+ },
+
+ openUrl(url) {
+ window.open(url, '_blank');
}
}
}
diff --git a/dashboard/src/views/alkaid/LongTermMemory.vue b/dashboard/src/views/alkaid/LongTermMemory.vue
index 45d687fec..e534c70d8 100644
--- a/dashboard/src/views/alkaid/LongTermMemory.vue
+++ b/dashboard/src/views/alkaid/LongTermMemory.vue
@@ -1,6 +1,11 @@
-
+
+
+ 加速开发中...
@@ -31,42 +36,27 @@
搜索记忆
-
-
-
+
+
+
mdi-text-search
搜索
-
+
搜索结果 ({{ searchResults.length }})
-
+
- {{ result.text.substring(0, 30) }}...
+ {{ result.text.substring(0, 30)
+ }}...
(相关度: {{ (result.score * 100).toFixed(1) }}%)
@@ -86,42 +76,21 @@
-
+
添加记忆数据
-
-
-
-
-
-
-
+
+
+
+
+
+
+
mdi-plus
添加数据
@@ -249,26 +218,26 @@ export default {
this.$toast.warning('请输入搜索关键词');
return;
}
-
+
this.isSearching = true;
this.hasSearched = true;
this.searchResults = [];
-
+
// 构建查询参数
const params = {
query: this.searchQuery
};
-
+
// 如果有选择用户ID,也加入查询参数
if (this.searchMemoryUserId) {
params.user_id = this.searchMemoryUserId;
}
-
+
axios.get('/api/plug/alkaid/ltm/graph/search', { params })
.then(response => {
if (response.data.status === 'ok') {
const data = response.data.data;
-
+
// 处理返回的文档数组
this.searchResults = Object.keys(data).map(doc_id => {
return {
@@ -277,7 +246,7 @@ export default {
score: data[doc_id].score || 0
};
});
-
+
if (this.searchResults.length === 0) {
this.$toast.info('未找到相关记忆内容');
} else {
@@ -295,7 +264,7 @@ export default {
this.isSearching = false;
});
},
-
+
// 添加新方法,用于提交记忆数据
addMemoryData() {
if (!this.newMemoryText || !this.newMemoryUserId) {
@@ -303,23 +272,23 @@ export default {
}
this.isSubmitting = true;
-
+
// 准备提交数据
const payload = {
text: this.newMemoryText,
user_id: this.newMemoryUserId,
need_summarize: this.needSummarize
};
-
+
axios.post('/api/plug/alkaid/ltm/graph/add', payload)
.then(response => {
// 成功添加后刷新图表
this.refreshGraph();
-
+
// 重置表单
// this.newMemoryText = '';
// this.needSummarize = false;
-
+
// 显示成功消息
this.$toast.success('记忆数据添加成功!');
})
@@ -331,7 +300,7 @@ export default {
this.isSubmitting = false;
});
},
-
+
ltmGetGraph(userId = null) {
this.isLoading = true;
const params = userId ? { user_id: userId } : {};
@@ -571,6 +540,7 @@ export default {