How komalsai234/llm-powered-employee-insights works
Project type and purpose
• This is a full-stack, LLM-powered employee information retrieval system.
• Frontend: Streamlit UI (app.py)
• Backend: FastAPI service (backend/api.py + helper modules)
• Data store: relational database populated via SQL script (data/employee_db.sql)
• External AI service: Groq API for natural-language→SQL translation and summarization
File structure
• Top-level:
• app.py → Streamlit application entry point
• config.py → all runtime settings (DB URL, Groq API keys, etc.)
• requirements.txt → Python dependencies (Streamlit, FastAPI, HTTPX, SQL drivers)
• data/employee_db.sql → DDL/DML to set up and seed the employee database
• backend/ directory:
• api.py → FastAPI app exposing endpoints for queries
• db.py → database connection and session management
• groq_handler.py → orchestrates calls to Groq API to generate SQL and summaries
• query_executor.py → executes SQL against the DB and returns raw results
README for additional insights
1. User enters natural-language query in the Streamlit UI
2. UI forwards query to FastAPI backend
3. Backend uses groq_handler → Groq endpoint → generates SQL
4. query_executor runs SQL via db.py → fetches rows
5. Optionally, groq_handler summarizes the result
6. API returns structured data to UI for display