Skip to content

The agent engineering platform.

SQL agent : Improved prompt engineering prevents agent guessing database column names. (#5671)

Will Smith6e25e650859f
diff --git a/langchain/agents/agent_toolkits/sql/prompt.py b/langchain/agents/agent_toolkits/sql/prompt.py
index 2891fbbc80..2a8ced66fc 100644
--- a/langchain/agents/agent_toolkits/sql/prompt.py
+++ b/langchain/agents/agent_toolkits/sql/prompt.py
@@ -17,5 +17,5 @@ If the question does not seem related to the database, just return "I don't know
SQL_SUFFIX = """Begin!
Question: {input}
-Thought: I should look at the tables in the database to see what I can query.
+Thought: I should look at the tables in the database to see what I can query. Then I should query the schema of the most relevant tables.
{agent_scratchpad}"""