aws-samples / aws-samples/amazon-bedrock-samples
text-2-sql-agent
- Dominant language
- Jupyter Notebook
- Stars
- 1.5k
- Forks
- 734
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 4
Description
Agent was not able to answer correctly the question : "In what year did Hank Aaron hit the most home runs?"
Trace : "The query failed, so the batting table does not exist or does not contain home run data. Looking at the schema again, there is no batting table. I will try querying the player table instead which contains basic player information."
So the agent answer : "Based on the available data, Hank Aaron was born in the year 1934. The SQL query used was: SELECT p.name_first, p.name_last, p.birth_year AS yearid, 0 AS hr FROM player p WHERE p.name_first = 'Hank' AND p.name_last = 'Aaron' ORDER BY yearid DESC LIMIT 1;"
Root cause : the provided TheHistoryofBaseball.zip contains :
- hall_of_fame.csv, player.csv,
- player_award_csv,
- salary.csv
- but it seems that batting table is missing.
Contributor guide
Research direction
Inspect the text-to-SQL agent example and TheHistoryofBaseball.zip, starting with the included CSV files and the schema the agent receives. Confirm why the batting data is unavailable and verify that the Hank Aaron question can be answered with the intended home-run data rather than player birth information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, jupyter-notebook, sql
- Domain
- ai, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100