feat(chat): add session-scoped temporary attachments with async parsing

Let users upload documents in chat without ingesting them into a knowledge base: files are parsed in the background, referenced by ID on send, and expire after a configurable TTL.
This commit is contained in:
wizardchen
2026-07-16 14:48:20 +08:00
committed by lyingbug
parent 7b2c9e73bf
commit ceb4d1a310
63 changed files with 3513 additions and 248 deletions
+14
View File
@@ -56,6 +56,20 @@ DISABLE_REGISTRATION=false
# === 性能 ===
CONCURRENCY_POOL_SIZE=3
# 聊天附件解析产物保留时长(小时),默认 24 小时
# WEKNORA_CHAT_ATTACHMENT_TTL_HOURS=24
# 单轮问答等待附件解析完成的最长时间(秒),超时后未完成的附件会被跳过。
# 大文件 / 扫描件解析较慢时可调大,默认 60 秒。智能体里的「附件解析等待超时」> 0 时优先于此全局值。
# WEKNORA_CHAT_ATTACHMENT_WAIT_TIMEOUT_SEC=60
# 附件 VLM OCR 调优(扫描件 / 图片型文档)。解析慢的瓶颈是逐页 VLM OCR,而非文档解析器。
# OCR_CONCURRENCY 为并行 OCR 的页数(默认 8,与页数上限一致,让扫描件一波跑完;调大会加重 VLM 负载,
# 所有智能体共享 VLM 后端,故保持全局);OCR_MAX_PAGES 为扫描件送入 VLM 的最大页数(默认 8),
# 智能体里的「扫描件 OCR 最大页数」> 0 时优先于此全局值。
# WEKNORA_CHAT_ATTACHMENT_OCR_CONCURRENCY=8
# WEKNORA_CHAT_ATTACHMENT_OCR_MAX_PAGES=8
# Docreader 地址
DOCREADER_ADDR=127.0.0.1:50051