An intelligent HR assistant chatbot that helps you query employee data in natural language.
It combines semantic retrieval with LLM-powered generation using a hybrid RAG (Retrieval-Augmented Generation) approach.
With this tool, you can ask:
- "Show me backend developers in Bengaluru with 5+ years of experience"
- "Who are the UI/UX designers skilled in Figma?"
- "List employees with leadership roles in sales"
and get chat-style responses with matching employee details.
- Semantic Search → Search employees by role, skills, experience, and location.
- Conversational Chat → Ask questions in plain English.
- FastAPI Backend → Exposes REST endpoints for integration.
- Streamlit Frontend → Interactive chat-like interface.
- Hybrid RAG Engine → Combines embeddings (
sentence-transformers) with Gemini LLM for contextual answers. - Extendable Dataset → Add/update employees in
data.pyor link to your HR database. - Fallback Mode → Even without Gemini API, retrieval still works.
HR_ChatBot/
│── 📜 app.py # Streamlit frontend (chat interface)
│── 📜 main.py # FastAPI backend (API endpoints)
│── 📜 rag.py # RAG engine (semantic search + LLM)
│── 📜 data.py # Employee seed dataset
│── 📜 requirements.txt # Python dependencies
│── 📜 README.md # Project documentation
│
└── 📂 assets/ # (Optional) Screenshots & demo images
├── ui_demo.png
└── architecture.pnggit clone https://github.com/your-username/HR_ChatBot.git
cd HR_ChatBotpython -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activatepip install -r requirements.txt
Obtain an API key from Google AI Studio. Set it as an environment variable:
# Windows PowerShell
$env:GEMINI_API_KEY="YOUR_KEY"
# macOS/Linux
export GEMINI_API_KEY="YOUR_KEY"
If no key is set, the chatbot falls back to retrieval-only answers.
uvicorn main:app --reload- Open API docs → http://localhost:8000/docs
streamlit run app.py
- UI runs at → http://localhost:8501 -Update Backend URL in the UI if backend is running elsewhere.
- Seed data is in data.py.
- Each employee contains:
{
"id": 1,
"name": "Alice Johnson",
"role": "Backend Developer",
"skills": ["Python", "Django", "PostgreSQL"],
"experience": 5,
"location": "Bengaluru"
}- Extendable: Replace with CSV, DB, or API integration.
- Works with Python 3.10 – 3.13.
- For Python 3.13, use PyTorch ≥ 2.6.0.
- For GPU users, install CUDA-enabled PyTorch manually:
# Example for CUDA 12.1 on Windows
pip install torch --index-url https://download.pytorch.org/whl/cu121- If Gemini API is down, app gracefully falls back to retrieval answers.
Want to improve this project? Contributions are welcome!
- Fork the repo
- Create your feature branch → git checkout -b feature/my-feature
- Commit changes → git commit -m "Add my feature"
- Push branch → git push origin feature/my-feature
- Open a Pull Request
Sourav Sharma Developer. Maker. Privacy-first AI enthusiast. Find me on GitHub → @Sourav-x-3202
If you found this useful, helpful, or inspiring — please consider starring the repository. It helps others discover the project and keeps development going
This project is licensed under the MIT License. © 2025 Sourav Sharma

