A full-stack Role-Based AI Assistant for HR and Finance teams — powered by FastAPI, React, Zustand, and LLM-based Retrieval-Augmented Generation (RAG).
It enables authorized users (HRs, Analysts, etc.) to query internal documents securely and conversationally.

- ✅ Role-Based Access Control (RBAC) for secure document visibility
- 🧠 LLM-powered Q&A on HR/Finance/Engi/Marketing data
- 🔐 Basic Auth with persistent login via Zustand
- 📁 Document chunking + embedding using
langchain,ChromaDB - 💬 Chat with memory — each session retains conversation context
- 🧑💼 Admin dashboard to manage users and roles (HR only)
- 🎨 Clean, responsive UI with TailwindCSS
| Layer | Tech Used |
|---|---|
| Frontend | React, Zustand, Tailwind CSS, Axios |
| Backend | FastAPI, LangChain, Groq (LLM), SQLiteCloud |
| State Mgmt | Zustand (with persistence & expiry) |
| Embeddings | sentence-transformers, ChromaDB |
| Auth | HTTP Basic Auth with role-based logic |
| Storage | SQLite ( Locally for now ) |
-
Create & activate a virtual environment
uv venv .venv/Scripts/activate # or `source venv/bin/activate` on Mac/Linux -
Install dependencies
uv pip install -r requirements.txt
-
Start the FastAPI server
python -m uvicorn app.main:app --reload
-
.env Example
GROQ_API_KEY=...
-
Create the React app
cd frontend npm install -
Start the dev server
npm run dev
-
API Connection API base URL is set to
http://localhost:8000inapi/api.js
- Login using Basic Auth (username/password)
- Users are stored in a SQLiteCloud DB with assigned roles
- Role-based access enforced on:
/chat: All roles/users/get-all: HR only/users/delete: HR only/users/add: HR only
backend/
├── app/
│ ├── main.py
│ ├── utils/
│ ├── services/
│ └── llm_service.py
frontend/
├── src/
│ ├── components/
│ ├── store/
│ ├── api/
│ └── pages/
| Username | Password | Role |
|---|---|---|
admin |
admin |
hr |
sai |
sai123 |
user |
- Passwords are currently stored in plain text (dev only) — hash before deploying
- Basic Auth is suitable for internal tools; switch to JWT for public access



