A comprehensive AI-powered job application tracking system that automatically retrieves, analyzes, and provides insights on your job applications using email data and web research.
- 📧 Email Integration: Automatically retrieve job-related emails from Gmail
- 🤖 AI Classification: Use OpenAI to intelligently classify and extract job application information
- 🔍 Job Research: Search for related job postings using Brave Search API
- 📊 Analytics & Insights: Generate detailed reports and AI-powered insights
- 💻 CLI Interface: Rich command-line interface with progress indicators and formatted output
- 🔄 Multi-Agent Architecture: Built on PocketFlow for scalable, modular processing
- Quick Start
- Installation
- Configuration
- Usage
- Features Overview
- API Documentation
- Testing
- Contributing
- License
-
Clone the repository:
git clone <repository-url> cd job-application-tracker
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env # Edit .env with your API keys -
Configure Gmail API:
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Gmail API
- Create OAuth 2.0 credentials
- Download credentials.json to
./credentials/
-
Run the tracker:
python cli.py track
- Python 3.8 or higher
- Gmail account with API access
- (Optional) OpenAI API key for AI insights
- (Optional) Brave Search API key for job research
-
Clone the repository:
git clone <repository-url> cd job-application-tracker
-
Create virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Install PocketFlow:
pip install pocketflow
# Build the Docker image
docker build -t job-tracker .
# Run the container
docker run -it --rm -v $(pwd)/credentials:/app/credentials job-trackerCreate a .env file in the project root:
# Required for Gmail integration
GMAIL_CREDENTIALS_PATH=./credentials/credentials.json
GMAIL_TOKEN_PATH=./credentials/token.json
# Optional: OpenAI API for AI insights
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_MODEL=gpt-4
# Optional: Brave Search API for job research
BRAVE_API_KEY=your_brave_api_key_here
# Configuration options
EMAIL_DAYS_BACK=30
CLASSIFICATION_CONFIDENCE_THRESHOLD=0.7
RESEARCH_MAX_RESULTS=10
RATE_LIMIT_DELAY=1.0
LOG_LEVEL=INFO
ENABLE_VALIDATION=true-
Create Google Cloud Project:
- Go to Google Cloud Console
- Create a new project or select existing
- Enable the Gmail API
-
Create OAuth 2.0 Credentials:
- Go to "Credentials" in the Google Cloud Console
- Click "Create Credentials" → "OAuth 2.0 Client ID"
- Choose "Desktop application"
- Download the credentials file
-
Place Credentials:
- Rename the downloaded file to
credentials.json - Place it in the
./credentials/directory
- Rename the downloaded file to
-
First Run Authentication:
- Run the application for the first time
- Follow the OAuth flow in your browser
- Grant access to Gmail
- The system will save a token for future use
- OpenAI API: Required for AI-powered insights and recommendations
- Brave Search API: Required for job posting research and market analysis
The system provides a rich CLI with multiple commands:
# Track job applications from last 30 days
python cli.py track
# Track specific number of days
python cli.py track --days 60
# Save results to file
python cli.py track --output results.json
# Verbose output
python cli.py track --verbose# Show system status
python cli.py status
# Interactive setup
python cli.py setup
# Show configuration
python cli.py config
# Show help
python cli.py help# Rich formatted output (default)
python cli.py track --format rich
# JSON output
python cli.py track --format json
# Plain text output
python cli.py track --format plainYou can also use the system programmatically:
from flow import run_job_application_tracking
# Run the workflow
result = await run_job_application_tracking(days_back=30)
if result['success']:
print(f"Found {len(result['results']['job_applications'])} job applications")
for app in result['results']['job_applications']:
print(f"- {app['company']}: {app['position']}")
else:
print(f"Error: {result['error']}")The system automatically:
- Retrieves emails from Gmail using OAuth2
- Filters job-related emails using domain analysis and keywords
- Processes HTML and plain text email content
- Extracts structured information from email threads
Using OpenAI's GPT models to:
- Identify job application emails with high accuracy
- Extract company names, positions, and application status
- Assign confidence scores to classifications
- Handle various email formats and languages
Leverages Brave Search API to:
- Find related job postings for each application
- Analyze market activity and competition
- Gather company insights and hiring patterns
- Calculate relevance scores for job matches
Generates comprehensive reports including:
- Application success rates and conversion funnels
- Time-based analysis of application patterns
- Company and position performance metrics
- Stale application alerts and follow-up recommendations
- AI-powered insights and improvement suggestions
Features include:
- Progress indicators for long-running operations
- Colored output with tables and panels
- Interactive prompts for setup and configuration
- Multiple output formats (rich, JSON, plain text)
- Error handling with helpful messages
from flow import JobApplicationTrackingFlow
# Create flow instance
flow = JobApplicationTrackingFlow()
# Run full workflow
result = await flow.run_full_workflow(days_back=30)
# Get flow statistics
stats = flow.get_statistics()from models.job_models import JobApplication, ApplicationStatus
from models.email_models import GmailEmail, EmailBatch
from models.research_models import JobPosting, ResearchResult
# Create job application
app = JobApplication(
email_id="email_123",
company="Google",
position="Software Engineer",
status=ApplicationStatus.APPLIED,
applied_date=datetime.now(),
confidence_score=0.85
)from config.settings import get_settings
# Get current settings
settings = get_settings()
# Access configuration
print(f"Email days back: {settings.email_days_back}")
print(f"OpenAI model: {settings.openai_model}")The system includes four specialized agents:
- Handles Gmail API authentication and email retrieval
- Filters and preprocesses email content
- Manages rate limiting and pagination
- Uses LLM to classify emails as job applications
- Extracts structured information from email content
- Validates classification accuracy
- Searches for job postings using Brave Search API
- Analyzes company hiring patterns
- Calculates relevance scores and market insights
- Aggregates application data and generates reports
- Provides analytics and success metrics
- Generates AI-powered insights and recommendations
# Run all tests
python run_tests.py
# Run only unit tests
python run_tests.py --unit
# Run with coverage
python run_tests.py --coverage
# Run specific test file
python run_tests.py --file test_models.py
# Run specific test function
python run_tests.py --function test_email_classificationtests/test_config.py- Configuration and settings teststests/test_utils.py- Utility function teststests/test_models.py- Data model teststests/test_flow.py- Workflow orchestration teststests/conftest.py- Test fixtures and configuration
The test suite includes:
- Unit tests for all core components
- Integration tests for workflow execution
- Mock tests for external API interactions
- Edge case and error handling tests
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ CLI Interface │ │ Flow Manager │ │ PocketFlow │
│ │───▶│ │───▶│ Nodes │
│ - Commands │ │ - Orchestration│ │ - Email │
│ - Formatting │ │ - Error Handling│ │ - Classification│
│ - Progress │ │ - Statistics │ │ - Research │
└─────────────────┘ └─────────────────┘ │ - Status │
└─────────────────┘
│
┌─────────────────┐ ┌─────────────────┐
│ Data Models │ │ Agents │
│ │ │ │
│ - Email │◀───│ - Email Agent │
│ - Job Apps │ │ - Classification│
│ - Research │ │ - Research │
└─────────────────┘ │ - Status │
└─────────────────┘
│
┌─────────────────┐ ┌─────────────────┐
│ External APIs │ │ Tools │
│ │ │ │
│ - Gmail API │◀───│ - Gmail Tool │
│ - OpenAI API │ │ - Brave Tool │
│ - Brave API │ │ - Data Processor│
└─────────────────┘ └─────────────────┘
- Email Processing: Retrieve → Filter → Preprocess
- Classification: Analyze → Extract → Validate
- Research: Search → Analyze → Aggregate
- Reporting: Generate → Insights → Export
-
Fork the repository
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Install development dependencies:
pip install -r requirements.txt pip install -r requirements-dev.txt
-
Run tests:
python run_tests.py
-
Format code:
black . ruff check .
- Follow PEP 8 guidelines
- Use type hints for all functions
- Write comprehensive docstrings
- Add unit tests for new features
- Use meaningful variable and function names
- Ensure all tests pass
- Update documentation if needed
- Add entries to CHANGELOG.md
- Submit a pull request with a clear description
# Error: credentials not found
Solution: Ensure credentials.json is in ./credentials/ directory
# Error: access denied
Solution: Re-run OAuth flow and grant Gmail access
# Error: quota exceeded
Solution: Check Google Cloud Console for API limits# Error: API key not found
Solution: Set OPENAI_API_KEY environment variable
# Error: rate limit exceeded
Solution: Add delays between requests or upgrade API plan# Error: API key invalid
Solution: Verify BRAVE_API_KEY environment variable
# Error: no results found
Solution: Check search query and API endpoint- Large Email Volumes: Use pagination and batch processing
- Rate Limiting: Adjust
RATE_LIMIT_DELAYsetting - Memory Usage: Process emails in smaller batches
- API Costs: Configure confidence thresholds to reduce API calls
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please:
- Check the troubleshooting section
- Search existing issues
- Create a new issue with detailed information
See CHANGELOG.md for a detailed history of changes.
- PocketFlow for the multi-agent framework
- OpenAI for GPT models and API
- Google for Gmail API
- Brave for Search API
- Rich for beautiful CLI formatting