How shravantv/moviebot works
MovieBot lets a user ask movie questions in a Streamlit chat, sends recent conversation history to a FastAPI endpoint, and returns an agent-generated answer. The backend orchestrates SQL generation, execution, and—if needed—query repair before responding. MovieLens CSV data initializes SQLite; the backend introspects and queries that database. The README also documents Groq-hosted inference and optional LangSmith tracing. Tool-to-storage and model calls are visible in excerpts; database initialization and tracing relationships are documented, but their deployment wiring is not independently verified here.
Main entry points: main.py Query API and agent · generate_sql.py SQL generation · app.py Streamlit chat · db_tool.py Database access
Components 12
Chat interface
- Streamlit chat
webapp/app.py
Backend orchestration
- Query API and agent
backend/app/main.py - SQL generation
backend/app/tools/generate_sql.py - SQL execution
backend/app/tools/execute_sql_query.py - Query repair
backend/app/tools/fix_sql_query.py
SQL and data
- Database access
backend/app/db_tool.py - SQLite movie database
Database initialization
- CSV import and schema
dbmanager/db_manager.py - MovieLens CSV data
ml-latest-small
Other components
- MovieBot user
- Groq model service
- LangSmith tracing
Connections 14
- MovieBot user → Streamlit chat: asks question
webapp/app.py - Streamlit chat → Query API and agent: posts history
webapp/app.py - Query API and agent → Streamlit chat: returns answer
backend/app/main.py - Query API and agent → SQL generation: dispatches tools
backend/app/main.py - Query API and agent → SQL execution: dispatches tools
backend/app/main.py - Query API and agent → Query repair: dispatches tools
backend/app/main.py - SQL generation → Database access: reads schema
backend/app/tools/generate_sql.py - SQL execution → Database access: executes query
backend/app/tools/execute_sql_query.py - SQL generation → Groq model service: requests SQL
backend/app/tools/generate_sql.py - Query repair → Groq model service: requests correction
backend/app/tools/fix_sql_query.py - Database access → SQLite movie database: reads schema and rows
backend/app/db_tool.py - CSV import and schema → MovieLens CSV data: imports CSV files
dbmanager/db_manager.py - CSV import and schema → SQLite movie database: initializes tables
README.md - Query API and agent → LangSmith tracing: traces requests
README.md