How mirudhula-dhanaraj/llm-data-agent works
This is a natural-language-to-SQL agent with Streamlit and FastAPI entry points. A question invokes a LangGraph workflow that generates SQL with Groq, validates it, executes it against SQLite, and retries failures. The Streamlit interface displays SQL, retry information, and results; the API returns the workflow state. The README also describes a health endpoint. The tree and excerpts show app.py as the Streamlit implementation, rather than the README’s mentioned streamlit_app.py. The graph reflects only relationships visible in the excerpts or README.
Main entry points: graph.py LangGraph Workflow · app.py Streamlit UI · main.py FastAPI API · database.py Schema and Seeding
Components 14
User Interfaces
- Streamlit UI
app.py - FastAPI API
app/main.py - Query Results
- Health Check
app/main.py
SQL Agent
- LangGraph Workflow
app/graph.py - SQL Generation
app/graph.py - Groq LLM
- SQL Execution
app/graph.py - Agent State
app/state.py
Safety and Data
- SQL Validation
app/guardrails.py - Schema and Seeding
app/database.py - SQLite Database
data/enterprise.db
Other components
- Questioner
- API Client
Connections 20
- Questioner → Streamlit UI: asks
app.py - Streamlit UI → Schema and Seeding: initializes
app.py - Streamlit UI → LangGraph Workflow: invokes
app.py - API Client → FastAPI API: submits query
app/main.py - FastAPI API → Schema and Seeding: initializes
app/main.py - FastAPI API → LangGraph Workflow: invokes
app/main.py - LangGraph Workflow → SQL Generation: starts at
app/graph.py - SQL Generation → Schema and Seeding: reads schema
app/graph.py - SQL Generation → Groq LLM: requests SQL
app/graph.py - SQL Generation → SQL Validation: routes to
app/graph.py - SQL Validation → SQL Execution: valid SQL routes
app/graph.py - SQL Validation → SQL Generation: invalid SQL retries
app/graph.py - SQL Execution → SQLite Database: runs query
app/graph.py - SQL Execution → SQL Generation: errors retry
app/graph.py - Schema and Seeding → SQLite Database: seeds and reads schema
app/database.py - LangGraph Workflow → Agent State: uses shared schema
app/graph.py - LangGraph Workflow → Query Results: returns state
- LangGraph Workflow → FastAPI API: returns state
app/main.py - Streamlit UI → Query Results: renders results
app.py - API Client → Health Check: checks health
README.md