A sophisticated, enterprise-grade HR assistant system that revolutionizes recruitment and employee management
This AI-powered HR assistant combines cutting-edge artificial intelligence, biometric verification, and intelligent document processing to streamline HR operations. Built with enterprise scalability in mind, it provides a comprehensive solution for resume screening, candidate verification, and intelligent HR query handling.
- π€ Intelligent Conversational AI: Context-aware chatbot powered by OpenAI's GPT models for natural HR interactions
- π Automated Resume Processing: Extract, analyze, and categorize candidate information with high accuracy
- π Biometric Verification: Secure face verification using Face++ API for identity authentication
- π Smart Knowledge Retrieval: FAISS-powered vector search for instant access to HR policies and documentation
- π Production-Ready: Containerized architecture with Nginx for scalable, enterprise deployment
- πΎ Robust Data Management: MongoDB integration for secure storage of verification records and user profiles
- π RESTful Architecture: Clean, well-documented API endpoints for seamless integration
βββββββββββββββββββ
β Nginx Proxy β
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββββββββββββββββββββββ
β FastAPI Application β
βββββββββββββββββββββββββββββββββββββββ€
β ββββββββββββββββββββββββββββββββ β
β β Chatbot Service (GPT-5) β β
β ββββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββ β
β β Resume Processing Engine β β
β ββββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββ β
β β Face Verification (Face++) β β
β ββββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββ β
β β FAISS Knowledge Base β β
β ββββββββββββββββββββββββββββββββ β
βββββββββββββββ¬ββββββββββββββββββββββββ
β
βββββββββΌβββββββββ
β MongoDB β
ββββββββββββββββββ
- Recruitment Automation: Screen hundreds of resumes in minutes
- Identity Verification: Verify candidate identity during virtual interviews
- HR Query Management: Instant answers to policy and procedure questions
- Onboarding Support: Guide new employees through documentation and processes
- Compliance Tracking: Maintain verification records for audit purposes
Ensure you have the following installed and configured:
- Python: Version 3.12 or higher
- Docker: Latest stable version
- Docker Compose: Version 2.0+
- API Credentials:
- OpenAI API key with GPT-5 access
- Face++ API key and secret
- MongoDB connection URI
-
Clone the Repository
git clone <repository-url> cd ai-hr-assistant
-
Configure Environment Variables
Create a
.envfile in the project root:# OpenAI Configuration OPENAI_API_KEY=sk-your-openai-api-key MODEL=gpt-5 # Face++ Configuration API_KEY=your-faceplus-api-key API_SECRET=your-faceplus-secret # Database Configuration MONGODB_URI=mongodb://username:password@localhost:27017/hr_assistant # Application Configuration APP_HOST=0.0.0.0 APP_PORT=8000 LOG_LEVEL=INFO
-
Install Python Dependencies
pip install -r requirements.txt
-
Prepare Knowledge Base
Place your HR documents (policies, procedures, FAQs) in the knowledge base directory:
mkdir -p data/knowledge_base # Copy your documents to data/knowledge_base/ -
Build Knowledge Base Index
python ingest.py
This creates FAISS vector indices for efficient document retrieval.
For local development with hot-reload:
uvicorn com.mhire.app.main:app --host 0.0.0.0 --port 8000 --reloadAccess the application at http://localhost:8000
Deploy using Docker Compose for production environments:
# Build and start all services
docker-compose up -d --build
# View logs
docker-compose logs -f
# Stop services
docker-compose downProduction endpoint: http://localhost:3014
Verify the application is running:
curl http://localhost:8000/healthOnce running, access comprehensive API documentation:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
POST /chat
Content-Type: application/json
{
"message": "What is the company's leave policy?",
"session_id": "user-123"
}POST /resume
Content-Type: multipart/form-data
file: resume.pdfPOST /face-verification
Content-Type: multipart/form-data
image: photo.jpg
user_id: "candidate-456"GET /verification/{user_id}All endpoints return JSON responses with consistent structure:
{
"status": "success",
"data": { /* response data */ },
"message": "Operation completed successfully"
}ai-hr-assistant/
β
βββ com/mhire/app/
β βββ main.py # FastAPI application & routing
β βββ config/
β β βββ settings.py # Configuration management
β βββ database/
β β βββ mongodb.py # Database connection handler
β βββ models/
β β βββ chat.py # Chat data models
β β βββ resume.py # Resume data models
β β βββ verification.py # Verification data models
β βββ services/
β βββ chatbot/
β β βββ chain.py # LangChain conversation chain
β β βββ prompts.py # System prompts
β βββ resume/
β β βββ parser.py # Resume parsing logic
β β βββ analyzer.py # Resume analysis
β βββ verification/
β β βββ handler.py # User verification logic
β βββ verification_system/
β βββ face_verification/
β βββ detector.py # Face detection
β βββ comparator.py # Face comparison
β
βββ data/
β βββ knowledge_base/ # HR documents & policies
β
βββ faiss_index/ # Vector store indices (generated)
β
βββ nginx/
β βββ nginx.conf # Nginx configuration
β
βββ tests/ # Unit & integration tests
β βββ test_chatbot.py
β βββ test_resume.py
β βββ test_verification.py
β
βββ docker-compose.yml # Multi-container orchestration
βββ Dockerfile # Container image definition
βββ requirements.txt # Python dependencies
βββ ingest.py # Knowledge base indexing script
βββ .env.example # Example environment variables
βββ .gitignore # Git ignore rules
βββ README.md # This file
- OpenAI GPT-5: State-of-the-art language understanding
- LangChain: LLM application framework
- FAISS: Efficient similarity search (Facebook AI)
- Face++: Enterprise face detection and recognition
- All sensitive credentials stored in environment variables
- API keys never committed to version control
- MongoDB authentication enforced
- HTTPS recommended for production deployments
- Face verification data encrypted at rest
- Temporary face images deleted after processing
- Compliance with GDPR and CCPA regulations
- API key authentication for all endpoints
- Rate limiting configured in Nginx
- Session management for chatbot conversations
# Never commit .env files
echo ".env" >> .gitignore
# Use strong MongoDB passwords
# Rotate API keys regularly
# Enable MongoDB encryption at rest
# Configure HTTPS with valid SSL certificatesRun the test suite:
# Install test dependencies
pip install pytest pytest-asyncio pytest-cov
# Run all tests
pytest
# Run with coverage
pytest --cov=com.mhire.app --cov-report=html
# Run specific test file
pytest tests/test_chatbot.py -v| Variable | Description | Required | Default |
|---|---|---|---|
OPENAI_API_KEY |
OpenAI API authentication key | β | - |
MODEL |
OpenAI model identifier | β | gpt-5 |
API_KEY |
Face++ API key | β | - |
API_SECRET |
Face++ API secret | β | - |
MONGODB_URI |
MongoDB connection string | β | - |
APP_HOST |
Application host | β | 0.0.0.0 |
APP_PORT |
Application port | β | 8000 |
LOG_LEVEL |
Logging level | β | INFO |
Update ingest.py to customize document processing:
# Supported document types
SUPPORTED_FORMATS = ['.pdf', '.docx', '.txt', '.md']
# Chunking parameters
CHUNK_SIZE = 1000
CHUNK_OVERLAP = 200- FAISS Index: Use GPU-accelerated FAISS for large knowledge bases
- Caching: Implement Redis for chatbot session caching
- Load Balancing: Deploy multiple Nginx instances behind a load balancer
- Database: Configure MongoDB replica sets for high availability
Integrate monitoring tools:
- Prometheus: Metrics collection
- Grafana: Visualization dashboards
- Sentry: Error tracking and reporting
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow PEP 8 style guide
- Add docstrings to all functions
- Write unit tests for new features
- Update documentation as needed
See CHANGELOG.md for version history and updates.
Issue: FAISS index not found
# Solution: Rebuild the index
python ingest.pyIssue: MongoDB connection failed
# Solution: Verify MongoDB is running
docker ps | grep mongo
# Check connection string in .envIssue: Face++ API rate limit exceeded
# Solution: Implement request queuing or upgrade planFor issues and questions:
- Bug Reports: Open an issue on GitHub
- Feature Requests: Submit via GitHub issues
- Security Concerns: Contact nazmulislam45213@gmail.com