A next‑gen AI‑powered HR Management System backend, built using FastAPI, LangChain, FAISS, and Google Gemini. This system provides intelligent HR assistance, policy search, natural‑language SQL automation, and automated payslip generation.
It is modular, scalable, and fully compatible with modern frontends like React, Vite, and mobile apps.
Features • Installation • Run • Structure • Dependencies
- Understands natural‑language questions
- Answers HR policy queries
- Generates summaries and explanations
- Provides instant HR support
- FAISS‑based vector search
- PDF parsing + embedding generation
- Fully searchable policy knowledgebase
- Converts natural language → SQL queries
- Secure SELECT‑only mode (default)
- Optional write mode using
allow_write=True
- Auto‑creates clean PDF payslips
- Sends payslips via email
- Generates employee salary summaries
- High performance backend
- Interactive API docs: 👉 http://localhost:8000/docs
Follow the steps below to set up the backend.
Make sure Python 3.11+ is installed.
# Create venv
py -3.11 -m venv backend/.venv
# Allow script execution (Windows only)
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
# Activate venv
./backend/.venv/Scripts/Activate.ps1Upgrade pip:
pip install --upgrade pipInstall all packages:
pip install -r requirements.txtCreate a .env file in your project root:
GEMINI_API_KEY=your_key
EMAIL_USER=your_email
EMAIL_PASSWORD=your_password
EMAIL_DISABLE_SEND=true
DATABASE_URL=sqlite:///./hr_employees.dbLaunch the FastAPI server:
python -m uvicorn backend.main:app --reload --host 0.0.0.0 --port 8000Open API documentation: 👉 http://localhost:8000/docs
backend/
│── main.py
│── config.py
│── agents/
│ ├── main_agent.py
│ ├── employee/
│ ├── policy/
│ └── sql/
│── database/
│── utils/
└── uploads/
fastapi
uvicorn
python-multipart
google-generativeai
langchain
sentence-transformers
faiss-cpu
pandas
numpy
reportlab
tqdm
python-dotenv
transformers
torch
(Your actual file contains pinned versions.)
This backend works seamlessly with:
- React / Vite apps
- Any REST API client
- Azure, AWS, Render, Railway deployments
This backend is branded and customized as HR Platform — a modern, AI‑first HR automation ecosystem.
Built with ❤️ using FastAPI, Gemini, LangChain, and modern AI tools.