From 3911d90993f5470a76447ee098dad58a2168c704 Mon Sep 17 00:00:00 2001 From: akie <103188271+zpf121@users.noreply.github.com> Date: Mon, 13 Apr 2026 11:06:14 +0800 Subject: [PATCH] Fix: agent application can not show Cite (#14047) Close #14018 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) ### Problem In Agent applications, even with the cite option enabled, only inline [ID: x] citation markers are visible (showing chunk content on hover). The Agent does not display the referenced file cards below the response, unlike Chat applications. ### Root Cause The Agent's Retrieval tool (agent/tools/retrieval.py) calls retriever.retrieval() with aggs=False, which means the retrieval results do not include doc_aggs (document aggregation) data. Without doc_aggs, the frontend ReferenceDocumentList component has no data to render the file cards. In contrast, the Chat application (api/db/services/dialog_service.py) calls the same retriever.retrieval() method with aggs=True. ### Fix Changed aggs=False to aggs=True in agent/tools/retrieval.py so that document aggregation data is returned along with the retrieved chunks. --- agent/tools/retrieval.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/tools/retrieval.py b/agent/tools/retrieval.py index 6c7ca8695..912a5c348 100644 --- a/agent/tools/retrieval.py +++ b/agent/tools/retrieval.py @@ -196,7 +196,7 @@ class Retrieval(ToolBase, ABC): self._param.similarity_threshold, 1 - self._param.keywords_similarity_weight, doc_ids=doc_ids, - aggs=False, + aggs=True, rerank_mdl=rerank_mdl, rank_feature=label_question(query, kbs), )