90d4bc4acf10796281d31b9bea8cfc759de4be6f
Automatic LinkedIn Answer AI
Automatically respond to LinkedIn messages from recruiters using AI. This bot leverages your resume and professional documents to generate precise, context-aware answers. It uses browser automation, Retrieval-Augmented Generation (RAG), and memory to ensure accurate and personalized responses.
Features
- Automated LinkedIn Messaging: Replies to recruiter messages in real-time.
- Document-Based Answers: Uses your resume and professional documents to generate responses.
- Precision with RAG: Retrieves relevant information from your documents for accurate answers.
- Memory for Context: Remembers previous interactions for consistent responses.
- Easy Setup: Simple configuration and no need for LinkedIn API credentials.
Use Cases
- Job Seekers: Automatically respond to recruiters with tailored answers based on your resume.
- Busy Professionals: Save time by letting the bot handle initial recruiter interactions.
- Networking: Maintain professional communication without manual effort.
Installation
-
Clone the Repository:
git clone https://github.com/iklobato/automatic-linkedin-answer-ai.git cd automatic-linkedin-answer-ai -
Install Dependencies:
uv install -
Set Up Environment Variables:
- Create a
.envfile:OPENAI_API_KEY=your_openai_api_key - Replace
your_openai_api_keywith your OpenAI API key.
- Create a
-
Prepare Documents:
- Place your resume and other professional documents in the
docs/directory. - Supported formats:
.txt.
- Place your resume and other professional documents in the
-
Configure
config.yaml:linkedin: username: "your@email.com" password: "your_password" deepseek: api_key: "your_openai_api_key" model: "gpt-4o" documents_dir: "docs/" bot_disclaimer: "🤖 Automated Response: This is an AI assistant. I'll respond based on my resume and experiences."
Usage
-
Run the Bot:
python bot.py -
How It Works:
- The bot logs into LinkedIn using your credentials.
- It navigates to your messages and checks for new recruiter messages.
- For each new message, it retrieves relevant information from your documents and generates a response using OpenAI's GPT model.
- The bot sends the response with a disclaimer indicating it's an automated reply.
-
Monitor Logs:
- The bot logs all actions (e.g., new messages, replies, errors) for debugging.
- Logs are saved in the console with timestamps.
Customization
1. Add More Documents
- Place additional
.txtfiles in thedocs/directory. - The bot will automatically include them in its knowledge base.
2. Adjust Response Style
- Modify the
bot_disclaimerinconfig.yamlto change the bot's tone. - Update the
system_promptin thegenerate_responsefunction for custom instructions.
3. Fine-Tune for Precision
- Use OpenAI's fine-tuning API to train a custom model on your specific dataset.
- Replace the
ChatOpenAImodel with your fine-tuned model.
Example Workflow
-
Recruiter Message:
Hi, I came across your profile and noticed your experience with Python. Can you tell me more about your projects? -
Bot Response:
🤖 Automated Response: This is an AI assistant. I'll respond based on my resume and experiences. I have worked on several Python projects, including a machine learning model for predicting customer churn and a web scraper for data analysis. You can find more details in my resume.
Troubleshooting
1. Login Issues
- Ensure your LinkedIn credentials in
config.yamlare correct. - If LinkedIn blocks the login attempt, try using a browser session to verify your account.
2. No Responses
- Check the logs for errors.
- Ensure your documents in the
docs/directory contain relevant information.
3. Rate Limits
- If OpenAI API rate limits are hit, reduce the bot's polling frequency by increasing the
time.sleep()duration.
Contributing
Contributions are welcome! Follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/your-feature). - Open a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgments
- browser-use for browser automation.
- LangChain for RAG and memory integration.
- OpenAI for the GPT models.
Description
Languages
Python
62.9%
Dockerfile
37.1%