"description":"An advanced agent that converts user queries into SQL statements, executes the queries, and assesses and returns the results. You must prepare three knowledge bases: 1: DDL for your database; 2: Examples of user queries converted to SQL statements; 3: A comprehensive description of your database, including but not limited to tables and records. You are also required to configure the corresponding database.",
"prompt":"## You are the Repair SQL Statement Helper, please modify the original SQL statement based on the SQL query error report.\n\n## The contents of the SQL query error report and the original SQL statement are as follows:\n{exesql_input}\n\n## Answer only the modified SQL statement. Please do not give any explanation, just answer the code.",
"prompt":"\n##The user provides a question and you provide SQL. You will only respond with SQL code and not with any explanations.\n\n##You may use the following DDL statements as a reference for what tables might be available. Use responses to past questions also to guide you: {ddl_input}.\n\n##You may use the following documentation as a reference for what tables might be available. Use responses to past questions also to guide you: {db_input}.\n\n##You may use the following SQL statements as a reference for what tables might be available. Use responses to past questions also to guide you: {sql_input}.\n\n##Respond with only SQL code. Do not answer with any explanations -- just the code.",
"temperature":0.1,
"top_p":0.3
}
},
"downstream":[
"ExeSQL:CoolFactsChew"
],
"upstream":[
"Retrieval:SillyPartsCheer",
"Retrieval:BrownStreetsRhyme",
"Retrieval:OddSingersRefuse"
]
},
"Retrieval:SillyPartsCheer":{
"obj":{
"component_name":"Retrieval",
"params":{
"empty_response":"Nothing found in DDL!",
"kb_ids":[],
"keywords_similarity_weight":0.1,
"similarity_threshold":0.02,
"top_n":18
}
},
"downstream":[
"Generate:CuteSidesBuy"
],
"upstream":[
"Answer:SocialAdsWonder"
]
},
"Retrieval:BrownStreetsRhyme":{
"obj":{
"component_name":"Retrieval",
"params":{
"empty_response":"Nothing found in Q->SQL!",
"kb_ids":[],
"keywords_similarity_weight":0.3,
"similarity_threshold":0.2,
"top_n":8
}
},
"downstream":[
"Generate:CuteSidesBuy"
],
"upstream":[
"Answer:SocialAdsWonder"
]
},
"Retrieval:OddSingersRefuse":{
"obj":{
"component_name":"Retrieval",
"params":{
"empty_response":"Nothing found in DB-Description!",
"text":"The large model modifies the original SQL statement based on the error message and returns the modified SQL statement."
},
"label":"Note",
"name":"N: Fix SQL Statement"
},
"dragging":false,
"height":172,
"id":"Note:SevenDancersMarry",
"position":{
"x":-52.470761864810754,
"y":81.77236559091028
},
"positionAbsolute":{
"x":-52.470761864810754,
"y":81.77236559091028
},
"resizing":false,
"selected":false,
"sourcePosition":"right",
"style":{
"height":172,
"width":228
},
"targetPosition":"left",
"type":"noteNode",
"width":228
},
{
"data":{
"form":{
"cite":true,
"frequencyPenaltyEnabled":true,
"frequency_penalty":0.7,
"llm_id":"deepseek-chat@DeepSeek",
"maxTokensEnabled":true,
"max_tokens":256,
"message_history_window_size":12,
"parameter":"Precise",
"parameters":[
{
"component_id":"ExeSQL:CoolFactsChew",
"id":"9c452513-6ab9-4ffb-8676-d7475363bb70",
"key":"exesql_input"
}
],
"presencePenaltyEnabled":true,
"presence_penalty":0.4,
"prompt":"## You are the Repair SQL Statement Helper, please modify the original SQL statement based on the SQL query error report.\n\n## The contents of the SQL query error report and the original SQL statement are as follows:\n{exesql_input}\n\n## Answer only the modified SQL statement. Please do not give any explanation, just answer the code.",
"temperature":0.1,
"temperatureEnabled":true,
"topPEnabled":true,
"top_p":0.3
},
"label":"Generate",
"name":"Fix SQL Statement LLM"
},
"dragging":false,
"height":128,
"id":"Generate:SmoothWombatsRemain",
"position":{
"x":-63.964315620743946,
"y":-56.53893429100532
},
"positionAbsolute":{
"x":-63.964315620743946,
"y":-56.53893429100532
},
"selected":false,
"sourcePosition":"right",
"targetPosition":"left",
"type":"generateNode",
"width":200
},
{
"data":{
"form":{
"cite":true,
"frequencyPenaltyEnabled":true,
"frequency_penalty":0.7,
"llm_id":"deepseek-chat@DeepSeek",
"maxTokensEnabled":true,
"max_tokens":256,
"message_history_window_size":12,
"parameter":"Precise",
"parameters":[
{
"component_id":"Retrieval:SillyPartsCheer",
"id":"2a77e574-a0a6-4a1a-af39-cb192f1d21f5",
"key":"ddl_input"
},
{
"component_id":"Retrieval:OddSingersRefuse",
"id":"83941a85-0b59-408e-97e5-504964b0e090",
"key":"db_input"
},
{
"component_id":"Retrieval:BrownStreetsRhyme",
"id":"c63d0ae6-7ee2-44a2-8a95-69d03c90cb44",
"key":"sql_input"
}
],
"presencePenaltyEnabled":true,
"presence_penalty":0.4,
"prompt":"\n##The user provides a question and you provide SQL. You will only respond with SQL code and not with any explanations.\n\n##You may use the following DDL statements as a reference for what tables might be available. Use responses to past questions also to guide you: {ddl_input}.\n\n##You may use the following documentation as a reference for what tables might be available. Use responses to past questions also to guide you: {db_input}.\n\n##You may use the following SQL statements as a reference for what tables might be available. Use responses to past questions also to guide you: {sql_input}.\n\n##Respond with only SQL code. Do not answer with any explanations -- just the code.",
"temperature":0.1,
"temperatureEnabled":true,
"topPEnabled":true,
"top_p":0.3
},
"label":"Generate",
"name":"Generate SQL Statement LLM"
},
"dragging":false,
"height":212,
"id":"Generate:CuteSidesBuy",
"position":{
"x":191.98081287844155,
"y":-255.36496490928363
},
"positionAbsolute":{
"x":191.98081287844155,
"y":-255.36496490928363
},
"selected":false,
"sourcePosition":"right",
"targetPosition":"left",
"type":"generateNode",
"width":200
},
{
"data":{
"form":{
"empty_response":"Nothing found in DDL!",
"kb_ids":[],
"keywords_similarity_weight":0.1,
"similarity_threshold":0.02,
"top_n":18
},
"label":"Retrieval",
"name":"DDL"
},
"dragging":false,
"height":44,
"id":"Retrieval:SillyPartsCheer",
"position":{
"x":199.0075429691716,
"y":-0.9595420072386389
},
"positionAbsolute":{
"x":199.0075429691716,
"y":-0.9595420072386389
},
"selected":false,
"sourcePosition":"right",
"targetPosition":"left",
"type":"retrievalNode",
"width":200
},
{
"data":{
"form":{
"empty_response":"Nothing found in Q->SQL!",
"kb_ids":[],
"keywords_similarity_weight":0.3,
"similarity_threshold":0.2,
"top_n":8
},
"label":"Retrieval",
"name":"Q->SQL"
},
"dragging":false,
"height":44,
"id":"Retrieval:BrownStreetsRhyme",
"position":{
"x":219.1804193484379,
"y":113.85464274901977
},
"positionAbsolute":{
"x":219.1804193484379,
"y":113.85464274901977
},
"selected":false,
"sourcePosition":"right",
"targetPosition":"left",
"type":"retrievalNode",
"width":200
},
{
"data":{
"form":{
"empty_response":"Nothing found in DB-Description!",
"kb_ids":[],
"keywords_similarity_weight":0.3,
"similarity_threshold":0.2,
"top_n":8
},
"label":"Retrieval",
"name":"DB Description"
},
"dragging":false,
"height":44,
"id":"Retrieval:OddSingersRefuse",
"position":{
"x":267.7575479510707,
"y":249.15603226400776
},
"positionAbsolute":{
"x":267.7575479510707,
"y":249.15603226400776
},
"selected":false,
"sourcePosition":"right",
"targetPosition":"left",
"type":"retrievalNode",
"width":200
},
{
"data":{
"form":{
"text":"Based on the result of the SQL execution, returns the error message to the large model if any errors occur; otherwise, returns the result to the user."
},
"label":"Note",
"name":"N: Analyze SQL"
},
"dragging":false,
"height":176,
"id":"Note:HeavyIconsFollow",
"position":{
"x":-626.6563777191027,
"y":-48.82220889683933
},
"positionAbsolute":{
"x":-626.6563777191027,
"y":-48.82220889683933
},
"resizing":false,
"selected":false,
"sourcePosition":"right",
"style":{
"height":176,
"width":266
},
"targetPosition":"left",
"type":"noteNode",
"width":266,
"dragHandle":".note-drag-handle"
},
{
"data":{
"form":{
"text":"Receives the user's database-related questions and displays the large model's response."
},
"label":"Note",
"name":"N: Interface"
},
"dragging":false,
"height":162,
"id":"Note:PinkTaxesClean",
"position":{
"x":-52.004609812312424,
"y":336.95180237635077
},
"positionAbsolute":{
"x":-52.004609812312424,
"y":336.95180237635077
},
"resizing":false,
"selected":false,
"sourcePosition":"right",
"style":{
"height":162,
"width":210
},
"targetPosition":"left",
"type":"noteNode",
"width":210,
"dragHandle":".note-drag-handle"
},
{
"data":{
"form":{
"text":"Searches for description about meanings of tables and fields."
},
"label":"Note",
"name":"N:DB Desctription"
},
"dragging":false,
"height":128,
"id":"Note:IcyTreesPeel",
"position":{
"x":283.6653421557703,
"y":336.29235267887395
},
"positionAbsolute":{
"x":283.6653421557703,
"y":336.29235267887395
},
"resizing":false,
"selected":false,
"sourcePosition":"right",
"style":{
"height":128,
"width":251
},
"targetPosition":"left",
"type":"noteNode",
"width":251,
"dragHandle":".note-drag-handle"
},
{
"data":{
"form":{
"text":"Searches for samples about question to SQL.\nPlease check this dataset: https://huggingface.co/datasets/InfiniFlow/text2sql"
},
"label":"Note",
"name":"N: Q->SQL"
},
"dragging":false,
"height":131,
"id":"Note:HugeGroupsScream",
"position":{
"x":606.1206536213404,
"y":113.09441734894426
},
"positionAbsolute":{
"x":606.1206536213404,
"y":113.09441734894426
},
"resizing":false,
"selected":false,
"sourcePosition":"right",
"style":{
"height":131,
"width":387
},
"targetPosition":"left",
"type":"noteNode",
"width":387,
"dragHandle":".note-drag-handle"
},
{
"data":{
"form":{
"text":"DDL(Data Definition Language).\n\nSearches for relevent database creation statements.\n\nIt should bind with a KB to which DDL is dumped in.\nYou could use 'General' as parsing method and ';' as delimiter."
},
"label":"Note",
"name":"N: DDL"
},
"dragging":false,
"height":266,
"id":"Note:GreenCrewsArrive",
"position":{
"x":545.3423934788841,
"y":-166.58872868890683
},
"positionAbsolute":{
"x":545.3423934788841,
"y":-166.58872868890683
},
"resizing":false,
"selected":false,
"sourcePosition":"right",
"style":{
"height":266,
"width":266
},
"targetPosition":"left",
"type":"noteNode",
"width":266,
"dragHandle":".note-drag-handle"
},
{
"data":{
"form":{
"text":"The large model learns which tables may be available based on the responses from three knowledge bases and converts the user's input into SQL statements."
},
"label":"Note",
"name":"N: Generate SQL"
},
"dragging":false,
"height":175,
"id":"Note:EightTurtlesLike",
"position":{
"x":222.2150747084395,
"y":-445.32694170868734
},
"positionAbsolute":{
"x":222.2150747084395,
"y":-445.32694170868734
},
"resizing":false,
"selected":false,
"sourcePosition":"right",
"style":{
"height":175,
"width":265
},
"targetPosition":"left",
"type":"noteNode",
"width":265,
"dragHandle":".note-drag-handle"
},
{
"data":{
"form":{
"text":"Executes the SQL statement in the database and returns the result.\n\nAfter configuring an accessible database, press 'Test' to ensure the accessibility."