Skip to content

Job Application Assistant is an AI-powered application designed to generate professional CVs and cover letters specifically tailored to job postings.

Notifications You must be signed in to change notification settings

badhon495/Job-Application-Assistant

Repository files navigation

Job Application Assistant

Job Application Assistant is an AI-powered application designed to generate professional CVs and cover letters specifically tailored to job postings. It is a modern agent-based architecture with improved modularity, maintainability, and extensibility. This project was built as part of the capstone project for the 5-Day AI Agents Intensive Course with Google.

🔗 Kaggle Competition: AI Agents Intensive Capstone Project

Key Capabilities

  • Intelligent parsing of user profiles and job postings
  • Context-aware content generation using Google Gemini AI
  • Professional formatting and structure
  • Sector-appropriate tone adaptation (Government, Private, IT, Banking)
  • Comprehensive validation and quality assurance
  • ATS-optimized output

Project Structure

job-application-assistant/
├── agent.py                          # Main orchestrator agent
├── agent_utils.py                    # Helper utilities for formatting
├── config.py                         # Configuration and API setup
├── tools.py                          # LLM interface and file utilities
├── validation_checkers.py            # Quality validation framework
├── latex_generator.py                # LaTeX template handler and PDF compiler
├── generate_application.py           # CLI entry point
├── setup.sh                          # Environment setup script
├── pyproject.toml                    # Python project configuration
├── requirements.txt                  # Python dependencies
├── README.md                         # This file
│
├── sub_agents/                       # Specialized sub-agents
│   ├── __init__.py
│   ├── profile_parser.py             # User profile parsing agent
│   ├── job_parser.py                 # Job posting analysis agent
│   ├── cv_generator.py               # Text CV generation agent
│   ├── cover_letter_generator.py     # Text cover letter generation agent
│   ├── latex_cv_generator.py         # LaTeX CV generation agent
│   └── latex_cover_letter_generator.py  # LaTeX cover letter generation agent
│
├── templates/                        # LaTeX templates
│   ├── cv_template.tex               # CV without photo
│   ├── cv_with_photo_template.tex    # CV with photo
│   └── cover_letter_template.tex     # Cover letter template
│
├── data/                             # Template files
│   ├── job_posting_template.txt      # Job posting format guide
│   └── user_profile_template.txt     # User profile format guide
│
├── examples/                         # Sample input files
│   ├── sample_job_posting.txt        # Example job posting
│   └── sample_profile.txt            # Example user profile
│
└── tests/                            # Test suite
    ├── test_agent.py                 # Unit tests
    └── README.md                     # Testing documentation

Architecture Diagram

┌─────────────────────────────────────────────────────────────────┐
│                    USER INPUT LAYER                             │
├─────────────────────────────────────────────────────────────────┤
│  Profile Text File          Job Posting Text File               │
│  (Free-form)                (Free-form)                         │
└────────┬─────────────────────────────┬──────────────────────────┘
         │                             │
         │                             │
         ▼                             ▼
┌─────────────────────────────────────────────────────────────────┐
│               MAIN ORCHESTRATOR AGENT                           │
│                   (agent.py)                                    │
│  • Manages workflow                                             │
│  • Coordinates sub-agents                                       │
│  • Handles errors and state                                     │
└────────┬────────────────────────────────────────────────────────┘
         │
         ├──────────────┬──────────────┬──────────────┬───────────┐
         ▼              ▼              ▼              ▼           ▼
    ┌────────┐    ┌─────────┐    ┌─────────┐    ┌─────────┐ ┌─────────┐
    │Profile │    │   Job   │    │   CV    │    │  Cover  │ │ LaTeX   │
    │Parser  │    │ Parser  │    │Generator│    │ Letter  │ │Generators│
    │ Agent  │    │ Agent   │    │ Agent   │    │ Agent   │ │ Agents  │
    └────┬───┘    └────┬────┘    └────┬────┘    └────┬────┘ └────┬────┘
         │             │              │              │           │
         │             │              │              │           │
         ▼             ▼              ▼              ▼           ▼
    ┌─────────────────────────────────────────────────────────────┐
    │              VALIDATION FRAMEWORK                           │
    │  • Profile Validator                                        │
    │  • Job Validator                                            │
    │  • CV Validator                                             │
    │  • Cover Letter Validator                                   │
    └────────┬────────────────────────────────────────────────────┘
             │
             ▼
    ┌─────────────────────────────────────────────────────────────┐
    │                OUTPUT LAYER                                 │
    ├─────────────────────────────────────────────────────────────┤
    │  • Structured JSON (parsed data)                            │
    │  • Text format (CV & Cover Letter)                          │
    │  • LaTeX source files                                       │
    │  • Professional PDFs                                        │
    │  • Validation reports                                       │
    └─────────────────────────────────────────────────────────────┘

File Descriptions

Core Files

agent.py

  • Main orchestrator that coordinates the entire workflow
  • Manages the 5-step process: setup, parsing, CV generation, cover letter generation, summary
  • Handles error management and progress tracking
  • Usage: Called by generate_application.py via run_job_assistant() function

config.py

  • Defines configuration dataclass for API settings
  • Initializes Google Gemini API connection
  • Manages model selection (gemini-1.5-flash for parsing, gemini-1.5-pro for generation)
  • Usage: Imported by all modules requiring configuration

tools.py

  • Provides core utility functions for LLM interaction and file operations
  • Key functions:
    • llm(): Interface to Google Gemini API
    • read_text_file(): Load input files
    • save_json_file(): Save parsed JSON data
    • parse_json_response(): Extract JSON from AI responses
    • create_output_directory(): Setup output folders
  • Usage: Imported by all agents requiring AI or file operations

agent_utils.py

  • Helper functions for formatting and display
  • Key functions:
    • format_profile_summary(): Format user profile for display
    • format_job_summary(): Format job details for display
    • get_sector_tone(): Determine appropriate tone based on job sector
    • build_profile_context(): Create comprehensive context for AI
    • print_step_header(): Display progress messages
    • print_success_message(): Display success indicators
    • print_error_message(): Display error messages
  • Usage: Imported by agents requiring formatted output

validation_checkers.py

  • Quality assurance framework with 5 validation classes
  • Classes:
    • ProfileValidationChecker: Validates parsed user profiles
    • JobValidationChecker: Validates parsed job postings
    • CVValidationChecker: Validates generated CVs
    • CoverLetterValidationChecker: Validates cover letters
    • validate_all(): Runs all validations
  • Usage: Called by each agent after content generation

latex_generator.py

  • LaTeX template population and PDF compilation utilities
  • Key functions:
    • escape_latex(): Escape special LaTeX characters
    • compile_latex_to_pdf(): Compile .tex files to PDF using pdflatex
    • format_latex_list(): Format lists for LaTeX resume items
    • format_latex_section(): Format LaTeX sections
  • Usage: Imported by LaTeX sub-agents for PDF generation

generate_application.py

  • Command-line interface (CLI) entry point
  • Handles argument parsing and file validation
  • Calls main orchestrator to run the workflow
  • Usage: python generate_application.py --profile <profile_file> --job <job_file> [--latex] [--photo <photo_file>]

Sub-Agents

sub_agents/profile_parser.py

  • Parses unstructured user profiles into structured JSON
  • Extracts: name, contact, education (SSC/HSC/University), experience, skills, certifications
  • Validates required fields and formats
  • Usage: Called by main agent during parsing step

sub_agents/job_parser.py

  • Analyzes job postings to extract key information
  • Extracts: company, title, requirements, responsibilities, qualifications, sector
  • Identifies critical keywords and required skills
  • Usage: Called by main agent during parsing step

sub_agents/cv_generator.py

  • Generates tailored CVs matching job requirements
  • Professional formatting standards
  • Emphasizes relevant experience and skills
  • ATS-optimized structure
  • Usage: Called by main agent during CV generation step

sub_agents/cover_letter_generator.py

  • Generates personalized text cover letters
  • Adapts tone based on job sector (Government/Private/IT/Banking)
  • Highlights relevant achievements and motivation
  • Professional format with proper salutations
  • Usage: Called by main agent during cover letter generation step

sub_agents/latex_cv_generator.py

  • Generates professional LaTeX CVs from parsed data
  • AI-powered content generation using Gemini
  • Populates LaTeX templates with tailored content
  • Compiles to PDF automatically
  • Supports photo inclusion
  • Usage: Called by main agent when --latex flag is used

sub_agents/latex_cover_letter_generator.py

  • Generates professional LaTeX cover letters
  • Uses moderncv template format
  • AI-powered content generation
  • Compiles to PDF automatically
  • Usage: Called by main agent when --latex flag is used

Supporting Files

setup.sh

  • Automated environment setup script
  • Checks for API key configuration
  • Creates necessary directories
  • Verifies template files
  • Usage: bash setup.sh (run once during initial setup)

pyproject.toml

  • Modern Python project configuration
  • Defines project metadata and dependencies
  • Configures build system and tools
  • Usage: Used by pip and build tools automatically

requirements.txt

  • Lists all Python dependencies
  • Primary dependency: google-generativeai >= 0.3.0
  • Usage: pip install -r requirements.txt

Installation

Prerequisites

  • Python 3.8 or higher
  • Google Gemini API key (get from https://makersuite.google.com/app/apikey)
  • (Optional) LaTeX distribution for PDF generation:
    • Ubuntu/Debian: sudo apt-get install texlive-latex-extra texlive-fonts-recommended
    • Fedora: sudo dnf install texlive-scheme-medium
    • macOS: brew install --cask mactex

Steps

  1. Clone the repository:
git clone https://github.com/badhon495/job-application-assistant.git
cd job-application-assistant
  1. Create a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment:
bash setup.sh
  1. Configure API key (choose one method):

Method 1: Using .env file (Recommended)

# Copy the example file
cp .env.example .env

# Edit .env and add your API key
nano .env
# or
code .env

# Replace 'your-api-key-here' with your actual API key

Method 2: Environment variable

export GEMINI_API_KEY='your-api-key-here'

Get your API key from: https://makersuite.google.com/app/apikey


Usage

Basic Usage

Generate application materials using your profile and a job posting:

# Generate text-based CV and cover letter
python generate_application.py --profile examples/sample_profile.txt --job examples/sample_job_posting.txt

# Generate professional PDF versions using LaTeX
python generate_application.py --profile examples/sample_profile.txt --job examples/sample_job_posting.txt --latex

# Generate PDF CV with photo
python generate_application.py --profile examples/sample_profile.txt --job examples/sample_job_posting.txt --latex --photo Photos/my_photo.jpg

Command-Line Options

python generate_application.py [OPTIONS]

Required Arguments:
  --profile PROFILE_FILE    Path to user profile text file
  --job JOB_FILE           Path to job posting text file

Optional Arguments:
  -h, --help               Show help message and exit
  --output OUTPUT_DIR      Custom output directory (default: outputs/)
  --format {text,markdown} CV output format (default: text)
  --cv-only                Generate only CV (skip cover letter)
  --cover-letter-only      Generate only cover letter (skip CV)
  --latex                  Generate LaTeX/PDF output (requires pdflatex)
  --photo PHOTO_FILE       Path to photo for CV with photo (use with --latex)
  --no-banner              Suppress banner display

Input File Format

User Profile (see data/user_profile_template.txt):

  • Personal information (name, contact)
  • Education history (SSC, HSC, Bachelor's, Master's)
  • Work experience with dates and responsibilities
  • Skills and certifications
  • Any additional relevant information

Job Posting (see data/job_posting_template.txt):

  • Company name and title
  • Job description and responsibilities
  • Required qualifications and skills
  • Salary and benefits (if available)
  • Application deadline and instructions

Output

Generated files are saved in timestamped output directory:

Text Output:

output/application_YYYYMMDD_HHMMSS/
├── parsed_profile.json      # Parsed profile data
├── parsed_job.json          # Parsed job data
├── CV_Name.txt              # Generated CV (text)
├── CoverLetter_Name.txt     # Generated cover letter (text)
└── validation_results.json  # Quality validation report

LaTeX/PDF Output (with --latex flag):

output/application_YYYYMMDD_HHMMSS/
├── parsed_profile.json      # Parsed profile data
├── parsed_job.json          # Parsed job data
├── CV_Name.txt              # Generated CV (text)
├── CV_Name.tex              # Generated CV (LaTeX source)
├── CV_Name.pdf              # Generated CV (PDF)
├── CoverLetter_Name.txt     # Generated cover letter (text)
├── CoverLetter_Name.tex     # Generated cover letter (LaTeX source)
├── CoverLetter_Name.pdf     # Generated cover letter (PDF)
└── validation_results.json  # Quality validation report

Basic Functionalities

1. Profile Parsing

  • Converts unstructured text profiles into structured JSON
  • Validates required fields (name, contact, education)
  • Formats professional data (phone numbers, education levels)
  • Extracts and organizes experience, skills, and certifications

2. Job Analysis

  • Analyzes job postings to identify key requirements
  • Extracts company details and job specifications
  • Identifies sector (Government/Private/IT/Banking/NGO)
  • Highlights critical keywords and must-have qualifications

3. CV Generation

  • Creates ATS-optimized CV tailored to job requirements
  • Emphasizes relevant experience and skills
  • Uses professional formatting conventions
  • Maintains professional structure and layout
  • Highlights achievements matching job needs

4. Cover Letter Generation

  • Generates personalized cover letters for each application
  • Adapts tone based on job sector:
    • Government: Formal and respectful
    • Private/IT: Professional and dynamic
    • Banking: Formal and detail-oriented
    • NGO: Collaborative and impact-focused
  • Addresses specific job requirements
  • Includes relevant achievements and motivation

5. Quality Validation

  • Validates all generated content for completeness
  • Checks required fields and formatting
  • Ensures professional tone and structure
  • Verifies formatting conventions
  • Reports validation errors with actionable feedback

6. Output Management

  • Creates timestamped output directories
  • Saves all files (JSON data, text documents, LaTeX source, PDFs)
  • Provides detailed summary of generated materials
  • Reports file locations and validation status

7. LaTeX/PDF Generation (Optional)

  • Converts AI-generated content to professional LaTeX format
  • Supports two CV templates:
    • Standard CV (no photo)
    • CV with professional photo
  • Uses moderncv template for cover letters
  • Automatically compiles LaTeX to PDF using pdflatex
  • Maintains professional formatting in PDF output

Testing

Run the test suite to verify functionality:

pytest tests/ -v

For detailed testing instructions, see tests/README.md.


Architecture

Job Application Assistant follows an agent-based architecture:

  1. Main Orchestrator (agent.py): Coordinates the entire workflow
  2. Sub-Agents (sub_agents/): Specialized agents for specific tasks
  3. Tools (tools.py): Shared utilities for AI and file operations
  4. Validation (validation_checkers.py): Quality assurance framework
  5. Configuration (config.py): Centralized settings management

This architecture provides:

  • Clear separation of concerns
  • Easy testing and debugging
  • Simple addition of new features
  • Maintainable and scalable codebase

About

Job Application Assistant is an AI-powered application designed to generate professional CVs and cover letters specifically tailored to job postings.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published