董宏凯
728a4b1170
Merge branch 'master' of http://192.168.0.200/knowledge-base-bj/deerflow-server into dhk-1
2026-06-12 14:10:08 +08:00
董宏凯 and Claude Fable 5
086c280e5d
圆桌第三步流程图模式 + 后台 DAG 任务编排
...
- 方案总结报告:用户要求结构化输出/流程图时跳过 md 直出 flow-json 流程图,
报告用文字展示;报告与流程图均可多轮修改、互相切换(detectFlowIntent 识别意图)
- 流程图画布放右侧沙箱位(sidePanel 插槽)不覆盖消息列表,可与 md 预览切换;
节点随容器宽度自适应缩放并 fitView 居中
- 后台挂起支持真 DAG 编排(分层并行/阶段目标/总控提示词),新增
orchestration_plan 持久化列 + 迁移;大弹窗流程图按 DAG 分层渲染
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
2026-06-12 13:52:17 +08:00
吉鑫升 and Claude Fable 5
28098b3155
feat: 知识库实体筛选、技能白名单收紧、嵌入主题与提问组件优化
...
- 知识库笔记列表支持按实体精确筛选(路由/服务/仓储层透传,关系图索引查询)
- 自定义智能体技能白名单在 skill_view 与 skill_manage 的 list/view 别名上同样生效;
config 未声明 skills 时视为无可见技能
- 嵌入圆桌主题解析默认深蓝,强制主题期间不再写 localStorage 覆盖主站选择
- 智能体提问建议拆出 agent-question-chips 组件,编辑器与详情面板联动优化
- 新增 qa-client 问答测试脚本
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
2026-06-12 11:09:32 +08:00
吉鑫升
11bc442f10
Merge branch 'ji' of http://192.168.0.200/knowledge-base-bj/deerflow-server into ji
2026-06-12 09:19:23 +08:00
Administrator
1b86373a54
feat: 知识库标签/实体关联跳转 + 会话重连容错
...
前端:
- Wiki 标签与实体改为可点击,弹出 RelatedNotesDialog 查看关联知识
- 知识库首次进入自动打开最近笔记,避免空白阅读区
- 流式重连识别 "Run not found",清理 sessionStorage 残留 key 并静默回退历史
后端:
- 线程鉴权区分 not found / not accessible,并支持 DB 切换产生的孤儿线程认领
- run 查询/join 在内存未命中时回退持久化存储,重启后返回干净的终止 SSE 而非 404
2026-06-11 23:19:09 +08:00
董宏凯 and Cursor
a4a9a4d26e
AI 写作四阶段内置智能体 Phase 1-4 落地
...
新增 ai-writing-researcher/outliner/writer/editor 种子 agent、_agent_runner 与 use_builtin_agents 灰度开关;四节点可按 flag 切换 SOUL 模式;时间线补大纲规划师配色并更新改造文档。
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-11 22:58:38 +08:00
吉鑫升 and Claude Fable 5
e7b51a30a3
fix: 智能体可见性对齐——列表可见即可打开问答,消除 404
...
get_visible 此前比列表过滤更严格(仅 内置/本人/已发布),导致私密广场
智能体(转私密强制 published=false)和「我的」里已收藏但被取消发布的
智能体能在列表看到、点开问答却 404(前端连带报 X.map is not a function)。
- AgentRepository._visible_filter / MemoryAgentStore._is_fetchable:
单条读取放宽为所有列表口径的并集(+is_private 豁免、+本人收藏豁免)
- 详情接口与 _enforce_agent_access 运行门禁:管理员回退 get_any,
对齐 ?admin=true 全量列表
- 普通未发布草稿对陌生人仍不可见,隐私不放开
- 本地新增 tests/test_agent_visibility.py 覆盖 SQL/Memory 双实现
(tests/ 目录在本仓库被 gitignore,不随提交)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
2026-06-11 21:25:36 +08:00
吉鑫升
0b98d18483
Merge remote-tracking branch 'origin/master' into ji
2026-06-11 20:28:15 +08:00
吉鑫升 and Claude Fable 5
3d6f35391e
feat: 对话列表显示总数,SOUL 编辑区高度自适应收敛
...
- 新增 POST /threads/count:与 /threads/search 同一套过滤(标题搜索、
系统会话排除),仅返回 {total};ThreadMetaStore 增加 count 方法
(SQL 走 COUNT(*),JSON 过滤分批扫描计数)
- 对话页面搜索框下常驻显示「共 N 条对话」,分页条显示 当前页/总页数
(useThreadsCount,仅随筛选条件变化,翻页不重复请求)
- 智能体右侧 SOUL 预览改为 40vh 上限自适应展开(不再全部展开);
详情面板/卡片编辑/创建页的 SOUL 输入框统一为适中高度 + 可拖拽
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
2026-06-11 20:26:44 +08:00
吉鑫升
82600a3404
Merge branch 'ji'
2026-06-11 19:59:58 +08:00
吉鑫升 and Claude Opus 4.8
f107ebc46d
feat: 完善知识图谱交互与 Agent/线程持久化
...
- 知识图谱画布、侧边栏、详情面板交互优化,新增图谱相关 API 与 hooks
- Agent 卡片与详情面板调整,对话页面重构
- 线程元数据持久化增强(base/memory/sql),knowledge 仓储与导出补充
- 网关路由 agents/knowledge/threads 同步更新
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 19:58:34 +08:00
董宏凯 and Cursor
bcc3d617a0
Merge branch 'ji' into dhk-1
...
Resolve column_additions_mysql.sql conflict: keep square_id columns from master and roundtable_drafts.task_id from dhk-1.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-11 17:40:08 +08:00
董宏凯
f3ca996116
wujie应用联调
2026-06-11 17:11:28 +08:00
吉鑫升
5daa4b3e20
Merge remote-tracking branch 'origin/master' into ji
2026-06-11 16:39:30 +08:00
吉鑫升
80e84de868
Merge remote-tracking branch 'origin/hlh' into ji
2026-06-11 16:35:18 +08:00
xuhd
1668c1da87
Merge remote-tracking branch 'origin/master' into xuhd
...
# Conflicts:
# frontend-web/.env.production
# frontend-web/.env.sit
# frontend-web/package.json
# offline-backend-20260512/backend/config.yaml
2026-06-11 14:19:01 +08:00
xuhd and Claude Opus 4.8
b0e48b6bda
refactor(studio): 文案“我的笔记/笔记本”统一改为“我的空间”
...
涉及空间详情页、AI 写作表单/上下文/类型、researcher 注释及 env 注释。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 11:45:35 +08:00
吉鑫升 and Claude Opus 4.8
f0aec4cd7f
feat(square): 新增发布广场功能,智能体/技能按广场分类展示
...
- 后端新增 PublishSquare/PublishSquaresSettings 配置与读写接口
- agents/skills 增加 square_id 字段及对应迁移脚本
- 前端新增发布广场设置页、技能转移选择器,画廊按广场分 Tab 展示
- lead_agent prompt 及若干持久化层适配调整
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 11:37:42 +08:00
xuhd
82d14351fc
修改名称 笔记本改为 空间
2026-06-11 11:19:26 +08:00
吉鑫升 and Claude Opus 4.8
3845d5090b
feat(knowledge): 支持文件导入沉淀知识,知识图谱可视化随主题切换
...
- 后端新增 /api/knowledge/ingest/file:上传 md/txt/pdf/word/ppt/excel,
转 Markdown 后走 wiki-capture LLM 蒸馏为陈述式知识笔记,失败回退逐字草稿
- service.capture_file + 文档专用蒸馏提示词,按主题拆分 1~4 页
- 知识图谱导出 HTML 支持 ?theme=light|dark,布局稳定后冻结,
按度数缩放节点,悬停/点击聚焦邻居
- 前端知识库页新增「导入文件」对话框与 ingestKnowledgeFile API
- 智能体问答页与简介侧边栏 UI 优化;批量人物蒸馏脚本提取正文逻辑修正
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 10:25:27 +08:00
Administrator and Claude Opus 4.8
e97017b297
feat(agents): 智能体常用问题——侧边栏展示并一键提问
...
新增 common_questions(常用问题)字段:后端贯通 agents_config、
config.yaml 读写与 create/update API,前端 Agent 类型补充字段并在
AgentChatPage 新增 AgentInfoSidebar 组件展示常用问题,点击即填充并提交。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 08:34:39 +08:00
Administrator
7fb3870247
@
...
feat(summarization): 非破坏性上下文压缩——保留原始对话仅在请求时瞬态压缩
重写 DeerFlowSummarizationMiddleware:将 stock before_model 的
RemoveMessage(REMOVE_ALL_MESSAGES) 改为 no-op,改在 wrap_model_call 中
瞬态压缩为 [summary, *recent],完整原始对话仍保留在 state 中,前端继续
渲染用户真实问答。summary 消息标记 hide_from_ui 且永不持久化,按 thread
缓存以避免每次模型调用都触发 LLM。前端 isHiddenFromUIMessage 额外隐藏旧
版本持久化的 name="summary" 消息。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
@
2026-06-11 08:34:09 +08:00
xuhd
06508cfb7c
Merge remote-tracking branch 'origin/master' into xuhd
2026-06-10 17:15:51 +08:00
吉鑫升 and Claude Opus 4.8
413f92e270
fix(migrations): 合并 alembic 多头(skill_name_zh 与 chain-stages 分支)
...
20260609_01(skills.name_zh)直接挂在 20260608_01 之下,与
20260608_02..06(chain-stages/parallel-agent 分支)形成两个 head,导致
`alembic upgrade head` 报 Multiple head revisions。新增空 merge 版本
20260609_02 同时指向 20260608_06 与 20260609_01,使 head 归一。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 14:39:37 +08:00
xuhd
b8d3a549df
buggggg
2026-06-10 11:27:48 +08:00
吉鑫升 and Claude Opus 4.8
d61aa853f1
feat(admin): 用户排行榜每日快照——手动刷新当天 + 凌晨自动定稿前一天
...
- 新增 POST /api/admin/users/leaderboard/refresh-today:同步强制重建当天快照
并返回合并区间;前端 useRefreshTodayLeaderboard + AdminUserLeaderboardPage
「刷新当天」按钮
- Gateway 调度循环在每日 ADMIN_LEADERBOARD_FINALIZE_HOUR(默认凌晨1点)对前一天
强制重算一次,避免临近午夜落库的 runs/tool-calls 漏统计;判定逻辑下沉为纯函数
deerflow.persistence.admin_stats.finalize.should_finalize_previous_day
- 新增 scripts/sql/column_additions_mysql.sql:既有 MySQL 库手动补列的幂等脚本
(Alembic 自动迁移已禁用,create_all 不改既有表)
- CLAUDE.md 补充排行榜快照、Schema 迁移约定,并补齐技能/知识库选模型的文档
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 11:24:21 +08:00
吉鑫升 and Claude Opus 4.8
96e0d695c0
feat(skills,knowledge): 中文名补全与知识库沉淀支持可选大模型并明确大模型报错
...
技能中文名:
- 单个「AI 生成」与「一键补充中文名」均可在请求体 model_name 选择大模型
- 一键补充改为仅管理员开放
- _generate_skill_name_zh 在模型自身失败(构建/超时/API 报错)时抛
SkillNameZhModelError,与模型返回无效名称区分;单个接口返回
502「大模型报错,无法补全技能中文名」,批量在 model_error 中带回代表性报错
知识库沉淀:
- 对话保存到知识库 / 批量导入均新增可选 model_name(透传至 capture_thread
→ extract_thread_llm_multi)
- 批量返回 llm_fallback 计数;模型异常时仍按既有逻辑回退规则抽取并落草稿,
前端明确提示「已改用规则抽取」(保存按钮保持后台异步)
前端新增 components/workspace/model-name-select.tsx 复用下拉(默认=系统配置模型)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 11:23:01 +08:00
Administrator
87e0ae683e
Merge remote-tracking branch 'origin/master' into ji
...
# Conflicts:
# offline-backend-20260512/backend/app/gateway/app.py
# offline-backend-20260512/backend/config.yaml
# offline-backend-20260512/backend/packages/harness/deerflow/persistence/models/__init__.py
# offline-backend-20260512/backend/packages/harness/deerflow/runtime/checkpointer/async_provider.py
2026-06-10 09:09:26 +08:00
Administrator and Claude Opus 4.8
44c0f6189b
wip: 合并 master 前暂存本地改动
...
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 08:36:47 +08:00
Administrator and Claude Opus 4.8
1ce15fbb15
style(knowledge): 实体改回纯展示(不可点击),chip 精致化
...
按需求去掉点击筛选,实体为静态彩色 chip:色点 + 名称 + 胶囊型类型标签。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-09 20:34:59 +08:00
Administrator and Claude Opus 4.8
f6af9379b7
feat(knowledge): 笔记页实体可点击筛选 + chip 美化
...
- 实体改为按钮:点击即在左侧列表筛出提及该实体的知识(清空来源/状态筛选)
- chip 加阴影/hover 上浮/类型 ring 标签/实体区 Sparkles 图标,更精致
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-09 19:48:20 +08:00
fengxiangdebaozi
cba165933c
提交代码
2026-06-09 17:18:40 +08:00
xuhd and Claude Opus 4.7
e54f42c0eb
fix(skill_manage): refuse agent writes to human-authored skills
...
Even after the previous owner check, the agent could still patch/edit
a UI-uploaded skill (source=upload) it happened to own. Uploaded skills
represent human-reviewed content; letting the agent rewrite them risks
silent drift from what the user approved.
Add _assert_skill_is_agent_authored which reads usage.json and refuses
unless source==agent. Wired into all five write actions
(create/edit/patch/delete/write_file/remove_file). Skills with no usage
entry default to source=upload, so legacy and adopted-orphan skills are
also refused — only skills the agent created via mark_agent_created in
the create flow stay editable.
Note: this check is independent of skill_store availability (it reads
the usage file, not the DB), so it runs even when skill_store is None.
Tests that exercise non-create paths against pre-existing skills will
need to call mark_agent_created first or mock get_entry.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-06-09 16:00:44 +08:00
xuhd and Claude Opus 4.7
c493639119
feat(skill-review): strict-mode prompt + raise min_tool_calls 3 to 5
...
The review agent was creating too many low-value skills. Three changes
tighten the funnel:
- review_worker prompt: rewritten in "保守模式". Default decision is
do-nothing. To create, all five AND conditions must hold (>=5 tool
calls with step dependencies, an explicit fail->fix->success episode,
cross-scenario reusability, no >=70% overlap with skill_list, can
produce >=300 chars of substance). Adds 7 explicit NO categories
(single-tool loops, one-off queries, LLM common knowledge, etc.)
and a 4-question self-check before any create. Hard cap of 1 new
skill per review, with patch preferred over create.
- min_tool_calls: 3 -> 5. Matches the prompt's ">=5 steps" hard
condition so trivial turns never reach the LLM reviewer.
- Updated config.yaml, the default-value assertion in
test_skill_review_worker, and the middleware docstring's "(default
3)" annotation to keep all three references in sync.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-06-09 16:00:29 +08:00
xuhd and Claude Opus 4.7
539a8bcec8
fix(skill_manage): block cross-user writes on patch/edit/write_file/remove_file
...
Only delete had a DB owner check via _assert_agent_may_delete. The other
four write actions only called ensure_custom_skill_is_editable, which
just verifies the directory exists under skills/custom/ — it does not
check owner_user_id. Any agent that knew a skill's name could overwrite
or strip support files from another user's UI-uploaded skill.
Generalise the helper to _assert_agent_may_modify (same three rules:
no DB row / built-in owner=None / owner mismatch) and call it from
edit, patch, delete, write_file, and remove_file. Hoist user_id +
skill_store to the top of the lock block so the four newly-guarded
branches stay one-liners and create/delete reuse the same handles.
Behaviour preserved when skill_store is None (no DB) — matches the
existing delete fallback.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-06-09 15:49:26 +08:00
xuhd
bd0eceda61
Merge remote-tracking branch 'origin/master' into xuhd
...
# Conflicts:
# offline-backend-20260512/backend/config.yaml
2026-06-09 15:43:40 +08:00
董宏凯 and Claude Opus 4.8
3405795371
fix(roundtable): 业务链条「本阶段目标」串行链可保存/回显 + 新增「总控提示词」
...
本阶段目标 bug:每步只有一个智能体(无并行)时,stageGroupsToStagePayload/
stageGroupsToStageGoals 一律折叠为 null(旧设计=线性链),导致目标保存即丢、
无从回显。改为「有并行 或 任一 stage 填了目标」就落显式分层,串行带目标链按
分层 DAG 跑(总控逐阶段按目标派活);BusinessChainPicker 同步:有并行/有目标/
有总控提示都走 dag。
新增「总控提示词」(per-chain,仅 dag 模式生效):写给总控的整体派活指引。
后端 roundtable_chains 加 coordinator_prompt LONGTEXT 列 + migration 20260608_06;
前端编辑器加输入框,注入 buildDagStageLeaderTask 每阶段派活提示。填了总控提示
也强制显式分层(forceExplicit),否则纯线性链里被静默忽略。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-09 13:41:20 +08:00
Administrator and Claude Opus 4.8
b70ed38d51
feat(knowledge): 图谱跟随删除 + 笔记页展示实体 + 标签美化
...
图谱不随删除变化的根因:实体/关系删除时从不清理,build_graph 又把所有实体
都当节点,导致已删笔记的实体(六福珠宝/COMEX/CM助手…)永久残留。
- build_graph 只保留被「活笔记」提及的实体,孤儿实体节点不再出现(render 层兜底,
历史脏数据无需迁移即生效)
- delete_note 删除时 clear_note_relations + prune_orphan_entities,DB 同步收敛
- get_note 返回 entities(repo.list_note_entities),笔记详情页展示实体
- 前端:实体按类型彩色 chip 展示(人物/机构/概念/产品/技术/地区…),标签改为 pill 样式
- 测试:get_note 返回实体 + 删除后图谱与实体表同步收敛
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-08 23:39:25 +08:00
Administrator and Claude Opus 4.8
70bb2783b9
chore(knowledge): 每次沉淀必打入口/结果日志,便于确认是否触发
...
success 路径原先完全静默,导致"看不到日志"无法区分"没触发"还是"日志不可见"。
现在每次 capture_thread 至少打 [knowledge] capturing… + 结果/跳过/失败 各一行。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-08 23:11:54 +08:00
Administrator and Claude Opus 4.8
d9fc7c9fdf
chore(knowledge): 沉淀决策日志统一加 [knowledge] 前缀,跳过提到 WARNING 级
...
便于 docker logs 一条 grep 抓全部捕获决策(跳过/回退/失败):
docker logs deerflow-vite-gateway 2>&1 | grep "\[knowledge\]"
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-08 22:55:44 +08:00
董宏凯
1938c80061
代码提交
2026-06-08 22:52:18 +08:00
Administrator and Claude Opus 4.8
76320ca5a3
fix(knowledge): 模型判定 should_ingest=false 时直接跳过,不再落草稿
...
日志显示寒暄/无效会话并非 LLM 调用失败,而是模型正确返回 should_ingest=false。
上一版把这种情况也当失败回退、堆成草稿,反而把无价值对话存进了库。
- llm_extractor: 模型显式 should_ingest=false 且无 notes → 抛 LLMRejectedIngest
- capture_thread: 捕获后抛 EmptyThreadError → 整条跳过、不入库(寒暄/总结此页这类不再进库)
- 仅当真正失败(API 报错 / 非 JSON)才回退规则抽取并落草稿
- 兼容包装 extract_thread_llm 吞掉该异常返回 None
- 更新测试(should_ingest=false 跳过)+ CLAUDE.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-08 22:49:00 +08:00
Administrator and Claude Opus 4.8
4aef81284a
feat(knowledge): 出处标记渲染 + 相关笔记按标签精确匹配 + LLM 回退落草稿
...
A) 前端把 ^[inferred]/^[ambiguous] 渲染成「推测」「存疑」小角标(原先原样显示文本)
B) 相关笔记只按"区分性标签"精确匹配(去掉标题/摘要关键词检索——中文分词导致
助手/知识图谱/页面 等泛词误关联,如「AI助手打招呼」被错误拉进 Related);
无区分性标签则不关联、不渲染 ## Related 段
C) LLM 提炼启用但失败时不再静默回退成"原文堆砌":
- 回退笔记落为 draft(草稿)而非 approved,便于复核
- capture_thread 记 WARNING 并返回 llm_fallback;router 透出该标志
- llm_extractor 在 JSON 解析失败/无 notes 时补充可诊断的 WARNING 日志
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-08 22:22:28 +08:00
Administrator and Claude Opus 4.8
e7ff07debd
feat(knowledge): 项目名改 zncm + 去除元链接噪音 + 创建人显示人名
...
- project_name 默认 deerflow → zncm(config.yaml + 配置默认 + 模块内字面量)
- related_links() 返回空:笔记 Related 不再注入 index/_meta/taxonomy/hub 结构链接,
只保留真实相关笔记的可点 [[标题]];无相关笔记且无来源时不再渲染 ## Related 段
- 移除随之多余的项目 hub 页脚手架(index.md/_meta/taxonomy.md 仍由 obsidian 脚手架保留,可解析)
- GET /notes/{id} 用 auth provider 把 created_by/updated_by(UUID) 解析为邮箱
(created_by_name/updated_by_name),前端 footer 显示人名、解析不到才显示短 id
- 仅对新沉淀笔记生效,现有笔记不动
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-08 21:50:56 +08:00
Administrator and Claude Opus 4.8
df3fac1032
feat(knowledge): 可跳转 wikilink + 真实相关 note + 一对话多页
...
- [[wikilink]] 解析器:note id / vault_path / 标题 / vault 元页 / missing
- 前端 MarkdownRenderer 把非数字 [[...]] 渲染成可点链接,元页弹窗查看,缺失置灰
- vault 脚手架补建项目 hub 页,三个结构性链接(index/taxonomy/hub)始终可跳
- capture 时按标题+摘要+区分性标签检索同主题 note,注入真实 [[标题]] 到 Related + 记 related 图谱边
- LLM 提取支持 notes[] 数组,一次对话拆 1~4 页并按标题互链(multi_note_enabled 开关)
- 新增接口 POST /resolve、GET /notes/{id}/wikilinks、GET /vault-page
- 新增配置 related_notes_enabled / related_notes_limit / multi_note_enabled
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-08 21:20:31 +08:00
Administrator
24db448cfd
Merge branch 'ji' of http://192.168.0.200/knowledge-base-bj/deerflow-server into ji
2026-06-08 19:12:34 +08:00
hlh
9e14c2e289
禁用了知识库技能,添加了知识库memory
2026-06-08 18:35:05 +08:00
Administrator and Claude Opus 4.8
81e4fd92ce
feat(knowledge): 阶段三 知识治理 + 阶段四 图谱增强
...
阶段三(治理):
- sensitive.py:写入前脱敏 token/密钥/手机号/身份证/邮箱(sensitive_redaction_enabled)
- 版本快照:更新前写 knowledge_note_versions;GET /notes/{id}/versions
- dedup.py:标题/摘要 Jaccard + 内容哈希查重;GET /duplicates、POST /merge(来源并入主条目、重复项归档)
- auto_ingest.py:独立后台队列/线程沉淀,不阻塞问答;中间件 after_agent 在 auto_ingest_enabled 时入队;价值判断(最小字符)+ skip_existing 去重;自动沉淀落 draft 待审
阶段四(图谱):
- LLM 抽取 entities/relations;service 存 knowledge_entities/knowledge_relations 并连边
- exporter.build_graph 支持实体节点 + note→entity/entity→entity 边;graph.html/json 增强
- GET /api/knowledge/graph 返回产品图谱数据
前端:知识库页「查重合并」对话框 + 相关 api/hooks
配置:sensitive_redaction_enabled / dedup_similarity_threshold / entity_extraction_enabled
测试:tests/test_knowledge.py 20 passed
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-08 18:31:33 +08:00
Administrator and Claude Opus 4.8
683cc6d76e
feat(knowledge): 阶段二 向量 RAG 与召回注入
...
- embeddings.py:OpenAI 兼容 embedding 客户端,未配置时关键词兜底
- chunking.py + knowledge_embeddings 表:Markdown 分块与向量索引(Python 余弦)
- search.py:keyword/vector/hybrid 三种模式,向量不可用自动降级
- 笔记创建/更新自动重建向量索引;新增 /reindex 维护接口
- KnowledgeRagMiddleware:按对话级开关 knowledge_rag_enabled 注入 <knowledge-context>,接入 lead agent 中间件链(默认随 config.knowledge.rag_enabled)
- service.build_rag_context(wiki-query 风格分层召回)
- 笔记版本快照(knowledge_note_versions)+ GET /notes/{id}/versions
- 前端:聊天页「知识库」对话级 RAG 开关 + 类型字段
- 新增 entities/relations 表(阶段四预置)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-08 18:18:04 +08:00
吉鑫升
fb692a0555
Merge branch 'ji' of http://192.168.0.200/knowledge-base-bj/deerflow-server into ji
2026-06-08 18:02:14 +08:00