Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: agent second round issue. (#9863)

Kevin Hu79968c37a8e6
diff --git a/agent/component/llm.py b/agent/component/llm.py
index b68f6abe1c..f02d957a42 100644
--- a/agent/component/llm.py
+++ b/agent/component/llm.py
@@ -17,6 +17,7 @@ import json
import logging
import os
import re
+from copy import deepcopy
from typing import Any, Generator
import json_repair
from functools import partial
@@ -141,7 +142,7 @@ class LLM(ComponentBase):
for p in self._param.prompts:
if msg and msg[-1]["role"] == p["role"]:
continue
- msg.append(p)
+ msg.append(deepcopy(p))
sys_prompt = self.string_format(sys_prompt, args)
for m in msg: