Workflow pattern for text-to-SQL with an EXPLAIN validator

CCDV-F Agents & Workflows Medium Question 73 of 105

A team uses Claude to turn natural-language questions into SQL. An internal database engine can run EXPLAIN on a candidate query and return syntax errors and index warnings automatically.

Which workflow pattern should the team build around this validator?

Show answer and explanation

DEvaluator-optimizer, where the validator's output feeds the next generation call

In the evaluator-optimizer pattern one call generates while another evaluates and feeds back in a loop, and it fits best where the evaluation criteria are clear, which is what an EXPLAIN result gives. Prompt chaining passes the draft forward once and never sees the validator, so a bad query stays bad. Parallel voting returns the most popular candidate rather than the one the database accepts. Orchestrator-workers splits a task into pieces, but one query needs iteration, not decomposition.

Source: anthropic.com/research/building-effective-agents

Anonymous, no account needed. Your tally stays in this browser.

Next question Start 5 timed questions Browse all 105 original CCDV-F practice questions