Commit Graph

120 Commits

Author SHA1 Message Date
Jyong
afa771dcac feat(knowledge-fs): keep query images with retrieval test history
Query images attached to a retrieval test vanished as soon as the run's
history record was selected, and were never shown again after a reload,
because nothing persisted them: the gateway dropped `queryImages` when writing
`answer_traces`, the console trace/research responses had no image field, and
the composer cleared its images on every record selection.

- knowledge-fs: add a nullable JSON `query_images` column to `answer_traces`
  (migration 0049 for postgres and tidb), persist and read it in the answer
  trace repository, and expose `queryImages` on quality trace list items.
- api: enrich trace and research task responses with
  `KnowledgeFSQueryImageResponse`, resolving file names and short-lived signed
  preview URLs only for files the acting account still owns; regenerate the
  console and service contracts.
- web: keep composer images scoped to the selected record like the query
  text, remember images per run in this session, fall back to persisted
  previews (with a labelled placeholder when the file is gone), show them in
  the result panel and as a count on history records, and carry them into
  retests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015zw5G5SX3HmVfnZof6YWAc
2026-09-02 09:17:36 -04:00
FFXN
567f4f5ab4 fix(knowledge-fs): enhance source import handling and error recovery for remote updates 2026-09-02 18:38:38 +08:00
Jyong
0340784d57 feat(knowledge-fs): add automatic metadata filtering to retrieval node
Bring the LLM-driven "automatic" metadata filtering mode from the legacy
Knowledge Retrieval node to the KnowledgeFS retrieval node
(knowledge-retrieval-v2).

Backend:
- Accept `automatic` in `metadata_filtering_mode` and add
  `metadata_model_config` to the node entity.
- Add `automatic_metadata_filter.py`, which reuses the legacy metadata
  filter prompt templates, invokes the configured model, parses the JSON
  answer and normalises operators/values against the KnowledgeFS
  metadata catalog before building custom metadata conditions.
- Resolve the shared metadata catalog across the selected spaces through
  the new `list_metadata_fields` app execution capability (paginated),
  fail closed on missing/unavailable models and catalog admission errors,
  fail open on extraction errors, and expose the outcome via
  `metrics.metadata_filtering` and `llm_usage`.
- Inject the default extractor from the node factory.
- Fix an unescaped brace in the legacy completion prompt template that
  broke `.format()`.

Frontend:
- Offer disabled/automatic/manual modes, normalise unknown persisted
  modes to disabled, store the automatic model and completion params,
  render the model selector through the shared MetadataFilter, and
  require a model when saving in automatic mode.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WnUM1CdV5LpcxZEQ2vu9Xc
2026-09-02 02:55:12 -04:00
Stephen Zhou
df17fc4f2a
fix(knowledge-fs): align query image types 2026-09-02 14:06:14 +08:00
Jyong
049a4c514e fix(knowledge-fs): show task object titles 2026-09-02 01:43:16 -04:00
Jyong
222d09f474 feat(knowledge-fs): add profile-driven multimodal retrieval 2026-09-02 01:01:57 -04:00
FFXN
b55ec59d37 fix(knowledge-fs): handle source selection mismatch and improve error handling, make source selection replacement durable. 2026-09-02 12:56:37 +08:00
Jyong
a15ca672a1 fix(knowledge-fs): align retrieval test timeout 2026-09-01 13:51:15 -04:00
Jyong
7876f6e670 fix(knowledge-fs): scope child deletion conflicts 2026-09-01 05:18:38 -04:00
Jyong
4f3a2952d6 perf(knowledge-fs): harden cross-format document ingestion 2026-08-31 07:48:35 -04:00
FFXN
8c472c217b fix(knowledge-fs): add SOURCE_DOCUMENT_COMPILATION_FAILED error code and update DTOs 2026-08-31 18:12:42 +08:00
FFXN
949549b9b1 feat(knowledge-fs): enhance source update payload with selection and sync policy validation 2026-08-30 23:58:27 +08:00
FFXN
52df787444 feat(knowledge-fs): support source config updates and deferred sync
- allow updating mutable source configuration fields
- enqueue sync after active business configuration changes
- pause scheduled sync while a source is disabled
- preserve and rebind sync policies across source version updates
- support website, online document, and online drive sources
2026-08-30 22:10:12 +08:00
FFXN
ae495d3f97 fix(knowledge-fs): remove provider mode from sync policies and update related constraints 2026-08-28 14:06:49 +08:00
Stephen Zhou
b155a0e1b9
fix(knowledge-fs): format source update payload 2026-08-28 00:08:18 +08:00
Stephen Zhou
e5dc72812a
fix(knowledge-fs): support source configuration editing 2026-08-27 23:52:18 +08:00
Stephen Zhou
7c3b4aa3c6
fix(knowledge-fs): preserve DOCX image placement 2026-08-27 17:55:02 +08:00
Jyong
42b1be58f3 fix(knowledge-fs): repair document deletion task progress 2026-08-27 04:35:05 -04:00
Jyong
12adc39383 fix(knowledge-fs): preserve spreadsheet image placement 2026-08-27 03:01:57 -04:00
Jyong
77a5de2fc9 fix(knowledge-fs): persist document images across formats 2026-08-26 03:58:04 -04:00
FFXN
18155535cf refactor(knowledge_fs): replace credential service with dataset API key authorization. Remove the API token feature at the space level for knowledgeFs. 2026-08-26 15:40:18 +08:00
Stephen Zhou
d5fd45bb41
feat(knowledge_fs): expand supported document upload formats 2026-08-25 19:58:15 +08:00
FFXN
013ddcf034 fix(knowledge_fs): accept direct unpublished profile activation responses and validate settings 2026-08-25 16:30:46 +08:00
Stephen Zhou
7c90d80bab
fix(knowledge-fs): allow downloading failed documents
Keep frontend download eligibility aligned with the backend and fetch only the latest failed revision asset.\n\nLinear: https://linear.app/dify/issue/WTA-2162/allow-downloading-documents-when-indexing-fails
2026-08-24 15:35:25 +08:00
Jyong
79b034d115 fix(knowledge-fs): reconcile completed source retries 2026-08-21 04:02:43 -04:00
Jyong
2ef7719b02 fix(knowledge-fs): allow replay evidence detail query 2026-08-21 03:10:14 -04:00
Stephen Zhou
d061d5ed3e
fix(knowledge-fs): finalize async source imports 2026-08-20 12:01:24 +08:00
FFXN
845ab7b000 Merge remote-tracking branch 'origin/deploy/konwledge' into deploy/konwledge 2026-08-20 10:35:35 +08:00
FFXN
96346219b3 feat(knowledge-fs): implement asynchronous source import and related payloads 2026-08-20 10:34:53 +08:00
Jyong
0391141936 feat(quality): show replay evidence details 2026-08-19 09:45:41 -04:00
Stephen Zhou
beddf6ef3e
fix(knowledge-fs): type replay query parameters 2026-08-19 18:23:57 +08:00
Jyong
66e3ae951f feat(knowledge): add golden question evaluations 2026-08-19 05:54:05 -04:00
Jyong
9553e7710c fix(knowledge-fs): allow optional notes and ignore bad cases 2026-08-19 04:16:42 -04:00
FFXN
80df2009ac Merge remote-tracking branch 'origin/deploy/konwledge' into deploy/konwledge 2026-08-19 15:17:45 +08:00
FFXN
0175a17908 feat(knowledge-fs): add upgrade job listing API 2026-08-19 15:12:21 +08:00
Jyong
39c31ef46c fix(knowledge-fs): clarify golden question evidence editing 2026-08-19 02:40:20 -04:00
Jyong
d2741725f7 default KnowledgeFS external access on creation 2026-08-19 00:33:43 -04:00
Stephen Zhou
791664f4d1
fix(knowledge-fs): format custom metadata DTO 2026-08-18 16:43:55 +08:00
Jyong
5d196aa6fa fix(workflow): use KnowledgeFS custom metadata filters 2026-08-18 03:53:54 -04:00
FFXN
1ef3379d5a feat(knowledge-fs): implement KnowledgeFS upgrade discovery and idempotency handling 2026-08-18 14:41:04 +08:00
FFXN
5236b71cb6 refactor(knowledge_fs): rename services and update imports for dataset knowledge file lease 2026-08-18 10:42:07 +08:00
FFXN
b022413a1f Merge remote-tracking branch 'origin/deploy/konwledge' into deploy/konwledge
# Conflicts:
#	api/controllers/console/datasets/datasets.py
#	api/extensions/ext_celery.py
2026-08-17 17:46:18 +08:00
FFXN
c7cf9db996 feat(knowledge_fs): Upgrade the old version of the knowledge base to the new version of the knowledge base 2026-08-17 17:36:43 +08:00
Stephen Zhou
1918c45b96
fix(knowledge-fs): persist icon style selection (WTA-2068) 2026-08-17 17:31:25 +08:00
Jyong
5323b6e4fc Improve application workflows and user experience 2026-08-14 02:27:03 -04:00
FFXN
b9b6498125 fix(knowledge_fs): enhance active profile handling and add migration test 2026-08-13 16:27:47 +08:00
Stephen Zhou
9c5a38abbc
fix(knowledge-fs): unify incomplete model guidance (WTA-1987) 2026-08-13 12:59:27 +08:00
FFXN
13ba200d9f feat(knowledge-fs): update space tag management and improve type annotations 2026-08-13 11:14:52 +08:00
FFXN
f746f180aa feat(knowledge-fs): implement KnowledgeFS space tag management API 2026-08-13 10:55:33 +08:00
Jyong
d064bf036c feat: capture workflow retrieval misses 2026-08-12 13:31:02 -04:00