Skip to content

granthanchatterjee/TalentScout-Hiring-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TalentScout Hiring Assistant

Project Overview

The TalentScout Hiring Assistant is a Streamlit-based chatbot designed to streamline the initial HR screening process for job candidates. It collects essential candidate information (e.g., name, email, tech stack), requests consent for data storage to simulate GDPR compliance, and generates 2-3 technical questions per skill in the candidate’s tech stack. The chatbot provides feedback on answers, saves responses to a JSON file (data/candidate_response.json) for technical review, and ensures a conversational, user-friendly experience. This project demonstrates skills in Python, Streamlit, API integration, and data privacy considerations.

Installation Instructions

Follow these steps to set up and run the application locally:

  1. Clone the Repository:

    git clone https://github.com/your-username/TalentScout-Hiring-Assistant.git
    cd TalentScout-Hiring-Assistant
    
  2. Set Up a Virtual Environment:

    python -m venv venv
    .\venv\Scripts\activate  # On Windows
    # OR
    source venv/bin/activate  # On Mac/Linux
    
  3. Install Dependencies:

    pip install -r requirements.txt
    

    Ensure requirements.txt includes:

    streamlit
    google-generativeai
    
  4. Set Up API Key:

    • Create a .env file in the project root and add your Gemini API key:

      GEMINI_API_KEY=your-api-key-here
      
    • The app loads this key using dotenv.

Usage Guide

  1. Run the Application:
    • Activate the virtual environment if not already active:

      .\venv\Scripts\activate  # On Windows
      # OR
      source venv/bin/activate  # On Mac/Linux
      
    • Use the VS Code task to run the app:

      • Press Ctrl+Shift+B to run the "Run Streamlit App" task (configured in .vscode/tasks.json).
    • Alternatively, run manually:

      streamlit run src/app.py
      
  2. Access the App:
    • Open the provided URL (e.g., http://localhost:8501) in your browser.
  3. Interact with the Chatbot:
    • Provide candidate details as prompted (e.g., name, email, tech stack).
    • Consent to data storage when asked (type "Yes" or "No").
    • Answer technical questions for each skill in your tech stack.
    • Receive confirmation that your information has been submitted for review.

Technical Details

  • Libraries Used:
    • streamlit: For building the interactive web interface.
    • google-generativeai: To integrate the Gemini 1.5 Flash model for generating technical questions.
    • uuid, datetime, json, os: For handling candidate data, timestamps, and file storage.
  • Model Details:
    • The chatbot uses the Gemini 1.5 Flash model (gemini-1.5-flash) to generate technical questions based on the candidate’s tech stack and desired position.
    • The model is accessed via an API key stored in a .env file.
  • Architectural Decisions:
    • The app is structured into two main files: app.py (Streamlit frontend) and chatbot.py (chatbot logic), promoting modularity and maintainability.
    • Candidate data is stored in a JSON file (data/candidate_response.json) to simulate a backend database, suitable for a demo project.
    • A state machine approach in chatbot.py manages the conversation flow: collecting info, requesting consent, asking technical questions, and saving data.
    • Input validation (e.g., email, phone number, technical answers) ensures robustness.

Prompt Design

  • Information Gathering:
    • Prompts are designed to be conversational and varied to avoid repetition. For example, to collect the candidate’s email:

      "Thanks, {name}! Could you share your email address so we can stay in touch?"
      
    • Each field (e.g., name, tech stack) has multiple prompt variations to enhance user experience.

  • Technical Question Generation:
    • The prompt for generating technical questions is crafted to ensure relevance and difficulty variation:

      "Generate 2-3 technical questions to assess proficiency in {skill} for a candidate applying for a {position} role. Format each question as a numbered item (e.g., '1. Question text'). Ensure the questions are relevant to the role, range from basic to advanced, cover practical applications, and are appropriate for the technology or framework. If {skill} is an obscure or unfamiliar technology, generate general problem-solving questions related to software development or the candidate’s role."
      
    • This prompt ensures the questions are tailored to the candidate’s role and tech stack, with a fallback for niche skills.

  • Feedback and Validation:
    • Prompts for invalid answers (e.g., "Hmm, that doesn’t seem to answer the question, {name}. Could you provide more details?") guide the candidate to improve their responses.

Challenges & Solutions

  • Challenge: Generating relevant technical questions for diverse tech stacks, including niche technologies.
    • Solution: The prompt for question generation includes a fallback to general problem-solving questions if the tech stack is obscure, ensuring the chatbot always has questions to ask.
  • Challenge: Ensuring GDPR compliance in a simulated environment.
    • Solution: Added a consent step before storing data, with a clear message: "Before we proceed, we need your consent to store your information for the hiring process. Do you consent to this? (Yes/No)". Data is only saved if consent is given.
  • Challenge: Asking multiple questions per skill without breaking the conversation flow.
    • Solution: Fixed the state machine in chatbot.py to iterate through all questions for a skill before moving to the next, using current_question_index and current_skill_index to track progress.
  • Challenge: Running the app efficiently in VS Code.
    • Solution: Created a VS Code task in .vscode/tasks.json to automate activating the virtual environment and running the app with a single shortcut (Ctrl+Shift+B).

Data Handling

  • Storage: Candidate information and responses are saved to data/candidate_response.json in a simulated format.
  • Simulated Data: The app uses simulated data for all backend processes, ensuring no real personal data is stored.
  • Data Privacy:
    • Requests candidate consent before storing data (simulated GDPR compliance).
    • In a production environment, ensure compliance with GDPR by:
      • Encrypting sensitive fields (e.g., email, phone number) using AES-256 encryption.
      • Implementing role-based access controls.
      • Anonymizing or pseudonymizing data where possible.
      • Providing candidates with the ability to request data deletion.

Post-HR Round Process

  • After the HR round, the candidate’s data is saved with a unique candidate_id, timestamp, and status ("HR Round Completed - Ready for Technical Review").
  • The candidate is informed that the technical team will review their responses and reach out within a week for the next round.

Project Structure

.
├── src/
│   ├── app.py              # Main Streamlit app
│   ├── chatbot.py          # Chatbot logic
├── data/
│   ├── candidate_response.json  # Stored candidate data
├── .vscode/
│   ├── tasks.json          # VS Code task to run the app
├── .env                    # Environment variables (e.g., API key)
├── .gitignore              # Git ignore file
├── requirements.txt        # Project dependencies
└── README.md               # Project documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages