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
Avoid misunderstanding LLMs about the numbers value (#4724)
so95a3a70431f341
diff --git a/agent/component/exesql.py b/agent/component/exesql.pyindex 6664d9133d..86a1685d05 100644--- a/agent/component/exesql.py+++ b/agent/component/exesql.py@@ -113,14 +113,14 @@ class ExeSQL(Generate, ABC):logging.info("single_sql: ", single_sql)cursor.execute(single_sql)if cursor.rowcount == 0:- sql_res.append({"content": "\nTotal: 0\n No record in the database!"})+ sql_res.append({"content": "No record in the database!"})breakif self._param.db_type == 'mssql':single_res = pd.DataFrame.from_records(cursor.fetchmany(self._param.top_n),columns = [desc[0] for desc in cursor.description])else:single_res = pd.DataFrame([i for i in cursor.fetchmany(self._param.top_n)])single_res.columns = [i[0] for i in cursor.description]- sql_res.append({"content": "\nTotal: " + str(cursor.rowcount) + "\n" + single_res.to_markdown()})+ sql_res.append({"content": single_res.to_markdown()})breakexcept Exception as e:single_sql = self._regenerate_sql(single_sql, str(e), **kwargs)