← All agent examples
Write a SQL query from your schema, checked against it
Paste your table definitions and ask a question in plain words. The agent writes a SQL query, checks that every table and column it uses exists in your schema, fixes what does not, and scores the result; if the score is below the bar it starts again, up to three attempts in total. Nothing is run against a database: you get the query to review and run yourself. If no attempt passes, the run ends without a result.
Data processing
Engineering and IT
SQL
text to SQL
query
database schema
self-correct
evaluation
retry
analytics
check
How it starts
When you run it.
What it needs
No knowledge base, memory bank or connection to create first.
Steps
Write the query
Prompt Call
Check tables and columns
Prompt Call
Fix the query
Prompt Call
Score the query
Evaluate Step
In parallel:
Passed
Gate
Show the query
Display Result
In parallel:
Below the bar
Gate
Start again with a fresh query
Retry