Spaces:
Sleeping
Sleeping
File size: 16,756 Bytes
5318b09 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
---
title: Linkedin Assistant
emoji: π
colorFrom: red
colorTo: red
sdk: docker
app_port: 8501
tags:
- streamlit
pinned: false
short_description: Streamlit template space
license: mit
---
# π€ LinkedIn AI Career Assistant
[](https://sri-vallabh-linkedin-profile-ai-assistant-app-ffuh1c.streamlit.app/)
[](https://www.python.org/downloads/)
[](https://streamlit.io/)
[](https://langchain-ai.github.io/langgraph/)
[](https://groq.com/)
An intelligent AI-powered career assistant that analyzes LinkedIn profiles, provides job fit analysis, and offers personalized career guidance through an interactive chat interface powered by Groq's llama3-8b-8192 model.
## π **Live Demo**
Try the application live at: **https://sri-vallabh-linkedin-profile-ai-assistant-app-ffuh1c.streamlit.app/**
## π **Table of Contents**
- [Overview](#overview)
- [Key Features](#key-features)
- [Architecture](#architecture)
- [Installation](#installation)
- [Usage](#usage)
- [Technical Implementation](#technical-implementation)
- [API Keys Setup](#api-keys-setup)
- [Session Management](#session-management)
- [Contributing](#contributing)
- [License](#license)
## π― **Overview**
The LinkedIn AI Career Assistant is a sophisticated career optimization tool that combines Groq's powerful llama3-8b-8192 model with LangGraph's multi-agent framework to provide comprehensive LinkedIn profile analysis. Built using **Streamlit**, **LangGraph**, and **Groq API**, this application offers an interactive chat-based experience for professional career development.
### **What Makes This Special?**
- **π§ Multi-Agent AI System**: Utilizes LangGraph to orchestrate specialized AI tools for different analysis tasks
- **πΎ Thread-Based Sessions**: Maintains conversation context with intelligent thread management based on LinkedIn URLs
- **π― Job Fit Analysis**: Provides detailed match scores and improvement suggestions for target roles
- **π Profile Analysis**: Comprehensive strengths and weaknesses assessment
- **π Real-time Scraping**: Fetches live LinkedIn profile data using Apify integration
- **β‘ Groq-Powered**: Lightning-fast responses using Groq's optimized llama3-8b-8192 model
## π **Key Features**
### 1. **Interactive Chat Interface**
- **LinkedIn URL Input**: Simply paste your LinkedIn profile URL to get started
- **Conversational AI**: Natural language interaction for profile optimization
- **Real-time Analysis**: Instant feedback and suggestions as you chat
- **Custom Styling**: Modern chat bubble interface with professional design
### 2. **Comprehensive Profile Analysis**
- **Strengths Identification**: Highlights technical skills, projects, education, and soft skills
- **Weakness Detection**: Identifies gaps in technical skills, experience, and missing context
- **Actionable Suggestions**: Provides specific recommendations for profile enhancement
- **Section-by-Section Access**: Detailed extraction of individual LinkedIn profile sections
### 3. **Advanced Job Fit Analysis**
- **Match Score Calculation**: Quantifies how well your profile fits target roles (0-100%)
- **Skill Gap Analysis**: Identifies missing skills required for your target position
- **Role-Specific Feedback**: Tailored suggestions for improving job compatibility
- **Visual Score Display**: Circular progress indicators for match percentages
### 4. **Intelligent Session Management**
- **URL-Based Threading**: Automatically finds existing conversations for the same LinkedIn profile
- **Session Continuity**: Choose to continue previous chats or start fresh
- **SQLite Persistence**: Robust conversation storage with automatic checkpointing
- **Thread Isolation**: Secure separation of different user sessions
### 5. **Professional Data Handling**
- **Pydantic Validation**: Robust data validation using structured schemas
- **State Management**: Comprehensive state tracking across conversation flows
- **Error Handling**: Graceful handling of API failures and data parsing issues
- **Memory Optimization**: Efficient storage and retrieval of conversation context
## ποΈ **Architecture**
### **Multi-Agent System Design**
```
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Interface (Streamlit) β
β Custom Chat Interface β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββ
β LangGraph Orchestrator β
β (ChatbotState Schema) β
β βββββββββββββββββββ¬ββββββββββββββββββ¬ββββββββββββββββββ β
β β Chatbot Node β Profile Tool β Job Match Tool β β
β β (Router) β (Analyzer) β (Matcher) β β
β β β β β β
β β Extract Tool β β β β
β β (Section Data) β β β β
β βββββββββββββββββββ΄ββββββββββββββββββ΄ββββββββββββββββββ β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββ
β External Services β
β βββββββββββββββββββ¬ββββββββββββββββββ¬ββββββββββββββββββ β
β β Apify LinkedIn β Groq API β SQLite β β
β β Scraper β (llama3-8b-8192)β Checkpointer β β
β βββββββββββββββββββ΄ββββββββββββββββββ΄ββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
### **Core Components**
1. **ChatBot Node**: Main conversation router with tool calling capabilities
2. **Profile Analyzer**: Comprehensive profile evaluation for strengths and weaknesses
3. **Job Matcher**: Role compatibility analysis with scoring and suggestions
4. **Extract Tool**: Granular access to specific profile sections
5. **State Management**: Pydantic-based ChatbotState with comprehensive field tracking
6. **Thread System**: URL-based session identification and management
## π οΈ **Installation**
### **Prerequisites**
- Python 3.8 or higher
- pip package manager
- Groq API key
- Apify API token
### **Quick Start**
1. **Clone the Repository**
```bash
git clone https://github.com/Sri-Vallabh/Linkedin-Profile-AI-Assistant.git
cd Linkedin-Profile-AI-Assistant
```
2. **Install Dependencies**
```bash
pip install -r requirements.txt
```
3. **Set Up Environment Variables**
```bash
cp .env.example .env
# Edit .env with your API keys
```
4. **Run the Application**
```bash
streamlit run app.py
```
5. **Access the Application**
```
Open your browser and go to: http://localhost:8501
```
### **Requirements**
```txt
streamlit>=1.28.0
langchain>=0.0.350
langchain-openai>=0.0.8
langgraph>=0.0.55
openai>=1.3.0
pydantic>=2.0.0
python-dotenv>=1.0.0
apify-client>=1.0.0
dirtyjson>=1.0.8
```
## π **Usage**
### **Getting Started**
1. **Launch the Application**
- Open the application in your browser
- You'll see the main interface with a LinkedIn URL input field
2. **Enter Your LinkedIn Profile**
- Paste your LinkedIn profile URL (e.g., `https://www.linkedin.com/in/your-profile/`)
- The system will automatically scrape and analyze your profile
3. **Choose Session Mode**
- If a previous session exists, choose to continue or start fresh
- New sessions initialize with full profile preprocessing
4. **Start Chatting**
- Begin conversations with queries like:
- "Analyze my profile strengths and weaknesses"
- "I want to apply for a Data Scientist role"
- "Show me my about section"
- "What skills am I missing for a Software Engineer position?"
### **Available Commands**
- **Profile Analysis**: "Analyze my profile" - Full strengths/weaknesses analysis
- **Job Matching**: "I want to apply for [role]" - Match score and skill gaps
- **Section Access**: "Show me my [section]" - Extract specific profile sections
- **General Queries**: Ask any career-related questions for guidance
### **Sample Conversations**
```
User: "Analyze my LinkedIn profile"
AI: β
Profile analysis complete!
πͺ Strengths
- Technical: Python, Machine Learning, Data Analysis
- Projects: E-commerce recommendation system, Stock prediction model
- Education: Computer Science degree, Data Science certification
- Soft Skills: Problem-solving, Team collaboration
β οΈ Weaknesses
- Technical Gaps: Cloud computing platforms, MLOps tools
- Project/Experience Gaps: Limited production deployment experience
- Missing Context: Quantified project impacts and metrics
π Suggestions to improve
- Add AWS/Azure cloud certifications
- Include specific metrics for project outcomes
- Highlight leadership or mentoring experiences
```
```
User: "I want to apply for a Senior Data Scientist role"
AI: π Job Fit Analysis
π― Target Role: Senior Data Scientist
Match Score: 78%
Missing Skills:
β’ Deep Learning frameworks (TensorFlow, PyTorch)
β’ MLOps and model deployment
β’ Leadership and team management experience
Suggestions:
β’ Complete online courses in deep learning
β’ Build projects showcasing end-to-end ML pipelines
β’ Seek opportunities to lead junior team members
```
## π§ **Technical Implementation**
### **State Management**
The application uses a sophisticated Pydantic-based state management system:
```python
class ChatbotState(BaseModel):
profile: Dict[str, Any] # Processed LinkedIn profile data
profile_url: Optional[str] # Original LinkedIn URL
sections: Dict[str, str] # Individual profile sections
enhanced_content: Dict[str, str] # Future AI-generated improvements
profile_analysis: Optional[Dict[str, Any]] # Strengths/weaknesses
job_fit: Optional[Dict[str, Any]] # Job matching results
target_role: Optional[str] # User's target job role
messages: Annotated[List[BaseMessage], add_messages] # Chat history
next_tool_name: Optional[str] # Tool routing information
```
### **Tool Integration**
The system includes three specialized tools:
1. **Profile Analyzer Tool**:
- Comprehensive profile evaluation
- Structured output with strengths, weaknesses, suggestions
- Uses ProfileAnalysisModel for validation
2. **Job Matcher Tool**:
- Role-specific compatibility analysis
- Calculates match scores (0-100%)
- Identifies missing skills and provides suggestions
3. **Extract Tool**:
- Granular access to profile sections
- Supports nested data extraction with dot notation
- Returns structured results for specific queries
### **Session Architecture**
- **Thread Management**: URL-based thread identification for session continuity
- **Checkpointing**: SQLite-based persistent storage with automatic fallback
- **State Validation**: Comprehensive Pydantic validation for data integrity
- **Memory Optimization**: Efficient message history management
### **LLM Integration**
- **Model**: Groq's llama3-8b-8192 for fast, high-quality responses
- **API**: OpenAI-compatible interface through Groq
- **Tool Calling**: Native support for structured tool invocation
- **Error Handling**: Robust retry mechanisms and graceful degradation
## π **API Keys Setup**
Create a `.env` file in the root directory:
```env
# Groq API Key (required)
GROQ_API_KEY=your_groq_api_key_here
# Apify API Token (required for LinkedIn scraping)
APIFY_API_TOKEN=your_apify_token_here
```
### **Getting API Keys**
1. **Groq API Key**:
- Visit [Groq Console](https://console.groq.com/)
- Create an account and generate an API key
- Used for llama3-8b-8192 model inference
2. **Apify API Token**:
- Go to [Apify Console](https://console.apify.com/)
- Sign up and get your API token
- Used for LinkedIn profile scraping
## πΎ **Session Management**
The application implements intelligent session management:
### **Thread-Based System**
- Each LinkedIn profile URL gets a unique thread ID
- Automatic detection of existing conversations for the same profile
- Secure isolation between different user sessions
### **Conversation Persistence**
- SQLite-based storage for production environments
- Memory-based fallback for development/testing
- Automatic checkpointing after each interaction
- Recovery capability in case of interruptions
### **User Experience**
- Choice to continue previous conversations or start fresh
- Seamless transition between sessions
- Maintained conversation context across browser refreshes
## π€ **Contributing**
We welcome contributions to improve the LinkedIn AI Career Assistant! Here's how you can help:
### **Development Setup**
1. Fork the repository
2. Create a feature branch: `git checkout -b feature/your-feature-name`
3. Make your changes and test thoroughly
4. Submit a pull request with a clear description
### **Areas for Contribution**
- **Tool Enhancement**: Implement the commented-out content_generator tool
- **UI/UX Improvements**: Enhance the Streamlit interface design
- **Performance Optimization**: Improve response times and resource usage
- **Testing**: Add comprehensive test coverage
- **Documentation**: Expand examples and API documentation
### **Code Style**
- Follow PEP 8 guidelines for Python code
- Use meaningful variable and function names
- Add docstrings for all functions and classes
- Include type hints where appropriate
- Validate data models with Pydantic
## π **License**
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## π **Acknowledgments**
- **Groq** for providing fast and efficient LLM inference
- **LangChain/LangGraph** for the multi-agent framework
- **Streamlit** for the web application framework
- **Apify** for LinkedIn scraping capabilities
- **Hugging Face** for hosting the live demo
## π **Support**
For questions, issues, or suggestions:
- **Create an Issue**: [GitHub Issues](https://github.com/Sri-Vallabh/Linkedin-Profile-AI-Assistant/issues)
- **Discussions**: [GitHub Discussions](https://github.com/Sri-Vallabh/Linkedin-Profile-AI-Assistant/discussions)
- **Email**: tsrivallabh2014@gmail.com
## π **Recent Updates**
- **v2.0**: Migrated to Groq API for faster inference
- **Thread Management**: Implemented URL-based session tracking
- **Enhanced UI**: Custom chat interface with professional styling
- **Robust State**: Pydantic-based data validation and error handling
- **Tool Optimization**: Streamlined to three core analysis tools
---
**Built with β€οΈ by Sri Vallabh**
*Empowering professionals to optimize their LinkedIn presence and advance their careers through AI-powered insights.* |