A full-stack, serverless HR assistant that answers policy questions and retrieves employee records using Retrieval-Augmented Generation (RAG) and structured data querying.
- Frontend: Plain HTML5, Tailwind CSS (CDN), deployed on Netlify.
- Backend: FastAPI running serverless on Modal.
- LLM & Embeddings: Groq (llama-3.3-70b-versatile) and Hugging Face sentence-transformers (vector embeddings).
- Vector Store: ChromaDB for policy document retrieval.
- Package Manager:
uv
.
├── data/ # HR policy documents and structured employee datasets
├── frontend/ # Web interface
│ └── index.html
├── src/ # Application logic
│ ├── app_modal.py # Modal serverless entry point
│ └── main.py # FastAPI routes and RAG/DB logic
├── pyproject.toml # Project dependencies
└── uv.lock # Lockfile for reproducible builds
- Python 3.11+
uvpackage manager installed- Modal CLI configured (
modal setup) - Groq API Key set in Modal secrets (
groq-secret)
- Install dependencies:
uv sync- Start the Modal development server:
uv run modal serve src/app_modal.py- Open
frontend/index.htmlin your browser or serve it locally.
Deploy the backend to Modal serverless hosting:
uv run modal deploy src/app_modal.py- Update
API_URLinfrontend/index.htmlwith your Modal production URL. - Push changes to GitHub. Netlify will build and host the site automatically.
Request Body
{
"employee_id": "EMP001",
"question": "How many annual leave days do I have left?"
}Response
{
"answer": "You have 18 annual leave days left.",
"source": "Employee Database (SQL)
"
}