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
+21
View File
@@ -779,3 +779,24 @@ DOCREADER_TRANSPORT=grpc
# Background sweep that recovers knowledge stuck in "processing" past
# DocumentProcessTimeout + 10m. Set to "false" to opt out (not recommended).
# WEKNORA_HOUSEKEEPING_ENABLED=true
# Lifetime of parsed chat attachments and their source/extracted image files.
# Messages keep only the selected prompt excerpts needed by conversation
# history. Default: 24 hours.
# WEKNORA_CHAT_ATTACHMENT_TTL_HOURS=24
# How long a chat turn waits (seconds) for still-parsing attachments before
# proceeding with only the finished ones. Large or scanned PDFs may need more
# time to parse; raise this if attachments are frequently skipped. Default: 60.
# A per-agent "Attachment Parse Wait Timeout" (when > 0) overrides this global.
# WEKNORA_CHAT_ATTACHMENT_WAIT_TIMEOUT_SEC=60
# Chat attachment VLM OCR tuning (scanned / image-only documents). The slow part
# of parsing is per-page VLM OCR, not the document reader. OCR_CONCURRENCY sets
# how many pages are OCR'd in parallel (default 8, matching the page cap so a
# scan finishes in one wave — raising it loads the VLM harder; this stays global
# because all agents share the VLM backend). OCR_MAX_PAGES caps how many pages of
# a scanned document are sent to the VLM (default 8); a per-agent "Scanned OCR
# Max Pages" (when > 0) overrides this global.
# WEKNORA_CHAT_ATTACHMENT_OCR_CONCURRENCY=8
# WEKNORA_CHAT_ATTACHMENT_OCR_MAX_PAGES=8