The Autonomous HR Assistant (HRA) Chatbot is your personal HR chatbot designed to assist with HR-related queries. It utilizes open-source models, advanced embeddings, and the Langchain framework with tools and a React agent.
This chatbot is designed to help answer a wide range of HR-related questions, making it a valuable tool for both employees and HR professionals. If the chatbot is unable to provide an answer, it will respond with a "don't know."
The HRA Chatbot is powered by two main data sources:
HR Policy Data: The HR policy data is generated using open-source models and serves as the knowledge base for answering policy-related questions.
Employee Data: Dummy employee data is used for demonstration purposes. You have the flexibility to replace this data with your organization's employee data.
Using LanceDB as Vectordb To facilitate efficient document retrieval and similarity-based queries, we utilize LanceDB as the vectordb. LanceDB helps optimize the chatbot's performance by enabling fast and accurate information retrieval.
Follow these steps to run the Autonomous HR Assistant Chatbot:
# OpenAI API Key Setup
1. Rename the `.env-example` file to `.env`.
2. Inside the `.env` file, set your OpenAI API key as follows:
OPENAI_API_KEY=your_api_key_here
3. Save the changes to the `.env` file.
Your OpenAI API key is now securely stored in the `.env` file, and your project will automatically read it when needed.
Remember to keep your `.env` file private and not share it publicly, as it contains sensitive information.```
Edit file path in - main.py
## Change these files for custom data.I'm using aks desai as a default user
chatbot = HRChatbot("data/employee_info.csv", "data/hr_policy_sample.txt", "aks desai")
Use pip to install the necessary dependencies by running:
pip install -r requirements.txt
following command to start the chatbot:
streamlit run main.py
The chatbot will be accessible through a web interface where you can input your HR-related queries.
This codebase serves as a simple prototype. You have the freedom to extend and customize it according to your organization's specific requirements. You can integrate additional logic and data sources as needed to enhance the capabilities of your HR chatbot.
For more advanced use cases or for deploying the chatbot in a production environment, consider consulting with a software development team to ensure scalability, security, and performance.