How madhusudandesai1/text-to-sql works
This is a notebook-based Text-to-SQL agent. A user asks a natural-language question; the notebook loads the Chinook schema, uses an LLM to generate SQL, runs it against SQLite, then uses an LLM to explain the result. README documents Gemini and Hugging Face as selectable backends. The notebook was not excerpted, so the relationships below rely on README descriptions rather than inspected implementation details.
Main entry points: agent.ipynb SQL generation · Chinook.db Chinook SQLite
Components 9
Agent workflow
- Query workflow
agent.ipynb - Schema loader
agent.ipynb - SQL generation
agent.ipynb - Query execution
agent.ipynb - Answer synthesis
agent.ipynb
Database
- Chinook SQLite
Chinook.db
LLM backends
- Google Gemini
- Hugging Face
Other components
- User
Connections 13
- User → Query workflow: asks question
README.md - Query workflow → Schema loader: loads schema
README.md - Schema loader → Chinook SQLite: reads schema
README.md - Query workflow → SQL generation: passes question
README.md - Schema loader → SQL generation: provides schema
README.md - SQL generation → Google Gemini: generates SQL
README.md - SQL generation → Hugging Face: generates SQL
README.md - SQL generation → Query execution: passes SQL
README.md - Query execution → Chinook SQLite: runs query
README.md - Query execution → Answer synthesis: passes result
README.md - Answer synthesis → Google Gemini: explains result
README.md - Answer synthesis → Hugging Face: explains result
README.md - Answer synthesis → User: returns answer
README.md