A Streamlit-based chatbot for automating the initial candidate screening process.
The TalentScout HR Assistant is a conversational AI-powered chatbot designed to streamline the hiring process. It interacts with candidates to gather essential information, such as personal details, technical skills, and experience, and asks technical questions based on the candidate's tech stack. The chatbot ensures a structured and efficient screening process while adhering to GDPR guidelines.
- Interactive Chat Interface: A user-friendly Streamlit-based interface for seamless interaction.
- Dynamic Questioning: Asks technical questions based on the candidate's tech stack.
- Structured Data Output: Collects and formats candidate information into JSON for further processing.
- GDPR Compliance: Ensures candidate data is handled securely and respects privacy guidelines.
- Python 3.8 or higher
pip(Python package manager)
-
Clone the Repository:
git clone https://github.com/Baskar-forever/HR_Assistance_Chatbot.git cd HR_Assitance_Chatbot -
Create Virtual Environment and Activate:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
-
Set Up Environment Variables:
Create a
.envfile in the project root directory and add your Mistral API key:MISTRAL_API_KEY=your_api_key_here
-
Run the Application:
streamlit run app.py
-
Access the Application:
Open your browser and navigate to http://localhost:8501
The chatbot will greet the candidate and request their consent to collect information.
The chatbot will ask for details like name, email, phone number, experience, and tech stack.
Based on the provided tech stack, the chatbot will ask 3-4 technical questions.
Once the screening is complete, the chatbot will provide a closing message and confirm that the candidate will be contacted via email.
The chatbot generates a structured JSON output containing all the gathered information and technical Q&A.
- Streamlit: For building the web-based chat interface.
- LangChain: For managing prompts and integrating with the Mistral AI model.
- dotenv: For securely managing environment variables.
- Mistral AI: A conversational AI model used for generating responses and handling the interview process.
- Prompt Design: The chatbot uses a carefully crafted system prompt to guide the conversation flow and ensure meaningful responses.
- Session State: Streamlit's session state is used to maintain chat history and ensure continuity in the conversation.
The chatbot's behavior is controlled by a detailed system prompt that:
- Outlines the information to be gathered (e.g., name, email, tech stack).
- Guides the chatbot to ask technical questions based on the candidate's skills.
- Ensures the conversation follows a logical flow by analyzing chat history.
- Provides GDPR-compliant responses and handles cases where candidates decline to share information.
Challenge 1: Maintaining Conversation Flow
- Problem: Ensuring the chatbot asks questions in the correct order and avoids repetition.
- Solution: Used conversation history analysis to maintain context and logical flow.
Challenge 2: Extracting Structured Data
- Problem: Parsing the chatbot's responses to extract candidate information in JSON format.
- Solution: Used regex to identify and extract JSON data from the chatbot's responses.
Challenge 3: Handling Errors
- Problem: Managing API errors or unexpected inputs.
- Solution: Implemented logging and error handling to provide fallback responses.
https://baskar2005-hr-assistant-chatbot.hf.space
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or feedback, please contact baskargceo@gmail.com.
- Mistral API key - https://console.mistral.ai/api-keys.
- demo link - https://baskar2005-hr-assistant-chatbot.hf.space.

