How phani-stack/baseinterface works
BaseInterface is a natural-language-to-MySQL chat application. A user asks a question in the browser; FastAPI sends it through a LangGraph workflow that refines the question, gathers database context, generates and executes SQL, then formats the result for the API response. A separate schema endpoint exposes table and column details. The sampled source confirms the workflow, API routes, and database/LLM calls; the README documents the browser interaction. The graph does not assume unshown provider or frontend wiring beyond that documentation.
Main entry points: app.py FastAPI Routes · main.py Workflow Graph · nodes.py Question Refinement · index.html Chat Page
Components 13
Chat Interface
- Chat Page
templates/index.html
HTTP API
- FastAPI Routes
app.py - Schema Endpoint Data
nodes/nodes.py
Query Workflow
- Workflow Graph
main.py - Workflow State
model/state.py - Question Refinement
nodes/nodes.py - Database Context
nodes/nodes.py - SQL Generation
nodes/nodes.py - SQL Execution
nodes/nodes.py - Result Presentation
nodes/nodes.py
External Systems
- Groq LLM
- MySQL Database
Other components
- User
Connections 17
- User → Chat Page: asks question
README.md - Chat Page → FastAPI Routes: submits query
README.md - FastAPI Routes → Chat Page: renders page
app.py - FastAPI Routes → Workflow Graph: runs workflow
app.py - FastAPI Routes → Schema Endpoint Data: serves schema
app.py - Workflow Graph → Workflow State: initializes state
main.py - Workflow Graph → Question Refinement: routes first
main.py - Question Refinement → Database Context: routes next
main.py - Database Context → SQL Generation: routes next
main.py - SQL Generation → SQL Execution: routes next
main.py - SQL Execution → Result Presentation: routes next
main.py - Question Refinement → Groq LLM: invokes model
nodes/nodes.py - SQL Generation → Groq LLM: invokes model
nodes/nodes.py - Result Presentation → Groq LLM: invokes model
nodes/nodes.py - Database Context → MySQL Database: reads context
nodes/nodes.py - SQL Execution → MySQL Database: runs SQL
nodes/nodes.py - Schema Endpoint Data → MySQL Database: reads metadata
nodes/nodes.py