{"id":18398644,"url":"https://github.com/mongodb-developer/hr_agentic_chatbot","last_synced_at":"2025-04-14T10:52:40.481Z","repository":{"id":248102857,"uuid":"827767777","full_name":"mongodb-developer/hr_agentic_chatbot","owner":"mongodb-developer","description":"Agentic chatbot built using a chainlit interface","archived":false,"fork":false,"pushed_at":"2024-07-12T14:21:41.000Z","size":29,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T00:06:30.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mongodb-developer.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-12T10:30:06.000Z","updated_at":"2025-02-01T16:01:42.000Z","dependencies_parsed_at":"2024-12-24T11:23:26.755Z","dependency_job_id":"6561eb49-6212-491c-881e-8202df30a6a1","html_url":"https://github.com/mongodb-developer/hr_agentic_chatbot","commit_stats":null,"previous_names":["mongodb-developer/hr_agentic_chatbot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb-developer%2Fhr_agentic_chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb-developer%2Fhr_agentic_chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb-developer%2Fhr_agentic_chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb-developer%2Fhr_agentic_chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mongodb-developer","download_url":"https://codeload.github.com/mongodb-developer/hr_agentic_chatbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868808,"owners_count":21174755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T02:23:29.222Z","updated_at":"2025-04-14T10:52:40.449Z","avatar_url":"https://github.com/mongodb-developer.png","language":"Python","readme":"# HR Agentic Chatbot\n\nThis project implements an HR Chatbot using LangChain, MongoDB, OpenAI's language models, and Google APIs. It includes synthetic data generation, embedding creation, and a chatbot interface for querying HR-related information and interacting with Google services.\n\n## Table of Contents\n\n1. [Prerequisites](#prerequisites)\n2. [Installation](#installation)\n3. [Configuration](#configuration)\n4. [Google API Setup](#google-api-setup)\n5. [Synthetic Data Generation](#synthetic-data-generation)\n6. [Data Ingestion and Embedding Generation](#data-ingestion-and-embedding-generation)\n7. [Running the Chatbot](#running-the-chatbot)\n8. [Project Structure](#project-structure)\n9. [Contributing](#contributing)\n10. [License](#license)\n\n## Prerequisites\n\n- Python 3.8+\n- MongoDB\n- OpenAI API key\n- Google Cloud Platform account\n- Git (for version control)\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/your-username/hr-agentic-chatbot.git\n   cd hr-agentic-chatbot\n   ```\n\n2. Create and activate a virtual environment:\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # On Windows, use `venv\\Scripts\\activate`\n   ```\n\n3. Install the required packages:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n## Configuration\n\n1. Create a `.env` file in the project root and add the following variables:\n   ```\n   MONGO_URI=your_mongodb_connection_string\n   OPENAI_API_KEY=your_openai_api_key\n   ```\n\n2. Replace `your_mongodb_connection_string` with your actual MongoDB connection string and `your_openai_api_key` with your OpenAI API key.\n\n## Google API Setup\n\n1. Go to the [Google Cloud Console](https://console.cloud.google.com/).\n2. Create a new project or select an existing one.\n3. Enable the following APIs for your project:\n   - Google Drive API\n   - Google Docs API\n   - Gmail API\n4. Create credentials (OAuth 2.0 Client ID) for a Desktop application:\n   - Go to \"Credentials\" in the left sidebar.\n   - Click \"Create Credentials\" and select \"OAuth client ID\".\n   - Choose \"Desktop app\" as the application type.\n   - Download the client configuration file and rename it to `credentials.json`.\n   - Place `credentials.json` in the root directory of the project.\n5. The first time you run the application, it will prompt you to authorize access:\n   - A browser window will open asking you to log in to your Google account.\n   - Grant the requested permissions.\n   - The application will then create a `token.json` file in the project root.\n\nNote: Keep `credentials.json` and `token.json` secure and do not share them publicly.\n\n## Synthetic Data Generation\n\nTo generate synthetic data for companies, workforce, and employees:\n\n1. Navigate to the `data` directory:\n   ```bash\n   cd data\n   ```\n\n2. Run the synthetic data generation script:\n   ```bash\n   python synthetic_data_generation.py\n   ```\n\nThis will create JSON files (`companies.json`, `workforce.json`, `employees.json`) in the `data` directory.\n\n## Data Ingestion and Embedding Generation\n\nTo ingest the synthetic data into MongoDB and generate embeddings for employees:\n\n1. Ensure you're in the project root directory.\n\n2. Run the data ingestion script:\n   ```bash\n   python data/ingestion.py\n   ```\n\nThis script will:\n- Read the JSON files from the `data` directory\n- Generate embeddings for employee data using OpenAI's API\n- Insert the data (including embeddings) into MongoDB\n\n## Running the Chatbot\n\nTo start the HR Chatbot:\n\n1. Ensure you're in the project root directory.\n\n2. Run the main script:\n   ```bash\n   chainlit run app.py\n   ```\n\n3. Open your web browser and navigate to the URL provided in the terminal (usually `http://localhost:8000`).\n\n4. Interact with the chatbot through the web interface.\n\n## Project Structure\n\n```\nHR_AGENTIC_CHATBOT/\n│\n├── .chainlit/\n├── .files/\n├── data/\n│   ├── __init__.py\n│   ├── companies.json\n│   ├── employees.json\n│   ├── ingestion.py\n│   ├── synthetic_data_generation.py\n│   └── workforce.json\n│\n├── mongodb/\n│   ├── __init__.py\n│   ├── checkpointer.py\n│   └── connect.py\n│\n├── tools/\n│   ├── google_tools.py\n│   └── mongodb_tools.py\n│\n├── .env\n├── .gitignore\n├── agent.py\n├── app.py\n├── chainlit.md\n├── config.py\n├── credentials.json  # Google OAuth 2.0 credentials\n├── db_utils.py\n├── graph.py\n├── README.md\n├── requirements.txt\n├── temp.py\n├── token.json  # Generated after first Google auth\n└── utilities.py\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongodb-developer%2Fhr_agentic_chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmongodb-developer%2Fhr_agentic_chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongodb-developer%2Fhr_agentic_chatbot/lists"}