diff --git a/frontend-web/src/components/workspace/settings/memory-settings-page.tsx b/frontend-web/src/components/workspace/settings/memory-settings-page.tsx index 969edfe4..3f120123 100644 --- a/frontend-web/src/components/workspace/settings/memory-settings-page.tsx +++ b/frontend-web/src/components/workspace/settings/memory-settings-page.tsx @@ -530,6 +530,15 @@ function MemorySearchPanel() { const { t } = useI18n(); const m = t.settings.memory; + // 检索范围:default 是内置助手,其余是用户的自定义专家 —— 对应 + // Hindsight 的 work bank deerflow-work-{user}-{agent}。 + const { agents: allAgents } = useAgents(); + const experts = useMemo( + () => allAgents.filter((a) => !a.builtin), + [allAgents], + ); + const [searchAgent, setSearchAgent] = useState("default"); + const [query, setQuery] = useState(""); const [mode, setMode] = useState("recall"); const [isSearching, setIsSearching] = useState(false); @@ -542,7 +551,7 @@ function MemorySearchPanel() { if (!q) return; setIsSearching(true); try { - const result = await searchMemory(q, mode); + const result = await searchMemory(q, mode, searchAgent); setUnavailable(!result.available); setResults(result.results); setReflectText(result.text); @@ -566,6 +575,26 @@ function MemorySearchPanel() { placeholder={m.searchPlaceholder} className="min-w-0 flex-1" /> +
+ + {m.workNotesAgentLabel} + + +
低): +# users/{user_id}/memory_config.json > .deer-flow/memory_user_overrides.json > 此处 +memory: + enabled: true + provider: hindsight # 'builtin' | 'hindsight'(外部 provider 名) + # builtin 始终启用,这里只决定 external 选哪个 + builtin: + enabled: true + memory_char_limit: 2200 + user_char_limit: 1375 + deduplicate_on_load: true + + hindsight: # provider=hindsight 时生效,需另行部署 Hindsight 服务 + mode: local_external # 'cloud' | 'local_embedded' | 'local_external' + api_url: http://localhost:8765 + api_key: "" # 部署 Hindsight 后填,或改成 $HINDSIGHT_API_KEY 并设同名环境变量 + # 注意:写成 $VAR 但环境变量未设置会导致配置加载失败 + bank_id_template: "deerflow-user-{user_id}" + work_bank_id_template: "deerflow-work-{user_id}-{agent_id}" + memory_mode: context # 'context' | 'tools' | 'hybrid' + bank_mission: "" + bank_retain_mission: "" + recall_budget: mid # 'low' | 'mid' | 'high' + recall_max_tokens: 4096 + recall_max_input_chars: 800 + auto_recall: true + auto_retain: true + retain_async: true + retain_every_n_turns: 1 + retain_user_prefix: "User" + retain_assistant_prefix: "Assistant" + + # background_extraction:预留功能,代码尚未实现 —— 仅设计文档存在。 + # 待对应版本支持后,取消下面整段注释即可启用(漏记兜底)。 + # background_extraction: + # enabled: false # 默认关闭,作为漏记兜底 + # debounce_seconds: 30 + # model_name: ~ # null = 用默认模型 + # fact_confidence_threshold: 0.7 + # max_facts_per_extraction: 10 + # correction_detection: true + # reinforcement_detection: true + + injection: + enabled: true + max_tokens: 2000 + include_builtin: true + include_hindsight: true + context_tag: "memory-context" # 包裹 Hindsight recall 的标签名 + + security: + scan_content: true # 注入/外渗模式扫描 + block_invisible_unicode: true + # streaming_scrubber:预留字段,代码尚未实现 —— 待版本支持后取消注释。 + # streaming_scrubber: true # SSE 流前清洗