RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Fix: disable agent citation, should not show citation files (#20616)
Wang Qi108e2bb3a3c8
diff --git a/internal/service/agent.go b/internal/service/agent.goindex 514c0a6710..7a4fd9d8c2 100644--- a/internal/service/agent.go+++ b/internal/service/agent.go@@ -2280,7 +2280,7 @@ func (s *AgentService) buildRunFunc(canvasID string, versionRow *entity.UserCanvattachment = v}}- referencePayload := agentRunReferencePayload(state, legacyReference)+ referencePayload := agentRunReferencePayload(c, state, legacyReference)assistantOutput := terminalCanvasOutput(c, state, workflowOutput, answer, downloads, attachment)// Release any deferred Agent node that was not consumed because the// downstream Message was skipped by an exception/branch path.@@ -2651,20 +2651,39 @@ func buildPersistedAgentDSL(runDSL map[string]any, state *canvas.CanvasState) enreturn dsl}-func agentRunReferencePayload(state *canvas.CanvasState, legacyChunks []interface{}) map[string]interface{} {+func agentRunReferencePayload(c *canvas.Canvas, state *canvas.CanvasState, legacyChunks []interface{}) map[string]interface{} {+ var reference map[string]interface{}if state != nil {- if reference := state.GetRetrievalReference(); len(reference) > 0 {- return reference- }+ reference = state.GetRetrievalReference()}- if len(legacyChunks) == 0 {- return nil+ if len(reference) == 0 {+ if len(legacyChunks) == 0 {+ return nil+ }+ reference = map[string]interface{}{+ "chunks": legacyChunks,+ "doc_aggs": []interface{}{},+ "total": len(legacyChunks),+ }}- return map[string]interface{}{- "chunks": legacyChunks,- "doc_aggs": []interface{}{},- "total": len(legacyChunks),+ if c != nil && state != nil {+ snapshot := state.Snapshot()+ hasAgent, cite := false, false+ for cpnID, component := range c.Components {+ if !strings.EqualFold(component.Obj.ComponentName, "Agent") || len(snapshot[cpnID]) == 0 {+ continue+ }+ hasAgent = true+ if enabled, _ := component.Obj.Params["cite"].(bool); enabled {+ cite = true+ break+ }+ }+ if hasAgent && !cite {+ delete(reference, "doc_aggs")+ }}+ return reference}func stringifyAgentUserInput(userInput any) string {