Linkedin-Assistant / README.md
tsrivallabh's picture
Upload 10 files
5318b09 verified
metadata
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

Hugging Face Spaces Python Streamlit LangGraph Groq

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

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
git clone https://github.com/Sri-Vallabh/Linkedin-Profile-AI-Assistant.git
cd Linkedin-Profile-AI-Assistant
  1. Install Dependencies
pip install -r requirements.txt
  1. Set Up Environment Variables
cp .env.example .env
# Edit .env with your API keys
  1. Run the Application
streamlit run app.py
  1. Access the Application
Open your browser and go to: http://localhost:8501

Requirements

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:

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:

# 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
    • Create an account and generate an API key
    • Used for llama3-8b-8192 model inference
  2. Apify API Token:

    • Go to Apify Console
    • 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 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:

πŸ”„ 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.