From 3330da0e5915958dacd74d68bc9721f6253a9ced Mon Sep 17 00:00:00 2001 From: xuhd Date: Tue, 19 May 2026 16:06:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E5=BF=86=E7=9A=84config.yaml=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- offline-backend-20260512/config.yaml | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/offline-backend-20260512/config.yaml b/offline-backend-20260512/config.yaml index acc54823..980d02e9 100644 --- a/offline-backend-20260512/config.yaml +++ b/offline-backend-20260512/config.yaml @@ -85,3 +85,59 @@ database: checkpointer: type: sqlite connection_string: D:\cursor-work\offline-backend-20260512\backend\.deer-flow\data\deerflow.db +# 记忆子系统:跨会话持久化用户画像与 agent 私有记忆。 +# 三层覆盖优先级(高->低): +# 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 流前清洗 \ No newline at end of file