# SearchPal

This project uses CrewAI to research a job posting, build a candidate profile, tailor a resume, and generate interview preparation materials. It orchestrates multiple AI agents that specialize in job research, candidate profiling, resume strategy, and interview preparation.

## What it does

The application runs a CrewAI workflow that:

1. Scrapes and analyzes a target job posting.
2. Reviews candidate information from a GitHub profile, a personal summary, and a local resume file.
3. Produces a tailored resume aligned to the job requirements.
4. Generates interview questions and talking points based on the tailored resume and role.

By default, the project uses a sample resume and writes the generated outputs to Markdown files.

## Project structure

.
├── main.py                  # Main CrewAI workflow and CLI entry point
├── check_env.py             # Helper script for validating environment variables
├── requirements.txt         # Python dependencies
├── fake_resume.md           # Source resume used by the agents
├── tailored_resume.md       # Generated tailored resume output
├── interview_materials.md   # Generated interview prep output
└── .env                     # Local environment variables, not committed

## Requirements

Python 3.10 or newer is recommended.

The project depends on:

crewai==1.4.1
crewai_tools==0.1.6
langchain_community==0.0.29
python-dotenv>=1.0.1

## Setup

Clone the project and enter the project directory.

git clone <your-repo-url>
cd <your-project-directory>

Create and activate a virtual environment.

python -m venv .venv
source .venv/bin/activate

On Windows PowerShell:

python -m venv .venv
.venv\Scripts\Activate.ps1

Install dependencies.

pip install -r requirements.txt

Create a .env file in the project root.

touch .env

Add your API configuration.

OPENAI_API_KEY=your_openrouter_or_openai_compatible_key
OPENAI_BASE_URL=https://openrouter.ai/api/v1
OPENAI_MODEL_NAME=meta-llama/llama-3.1-70b-instruct
SERPER_API_KEY=your_serper_api_key

SERPER_API_KEY is used by the search tool. The scraping tool can work without it, but the full research workflow expects search access.

## Validate your environment

Run the environment checker before launching the crew.

python check_env.py

The script prints the current working directory, whether .env is present, and the configured OpenAI/OpenRouter-related values. It intentionally prints only the length of OPENAI_API_KEY, not the key itself.

## Usage

Run the workflow with default inputs.

python main.py

The default configuration uses:

Job posting URL: AI Fund sample job posting
GitHub profile: https://github.com/joaomdmoura
Resume file: fake_resume.md
Output files: tailored_resume.md and interview_materials.md

You can also pass your own inputs.

python main.py \
  --job_url "https://example.com/job-posting" \
  --github "https://github.com/your-profile" \
  --summary "Brief candidate summary, background, strengths, and target role."

## Outputs

After the crew finishes, it writes:

tailored_resume.md
interview_materials.md

tailored_resume.md contains a resume tailored to the target role.

interview_materials.md contains likely interview questions and talking points based on the resume and job posting.

## How the workflow is organized

The workflow creates four agents:

### Tech Job Researcher

Analyzes the job posting and extracts the skills, experience, qualifications, and requirements needed for the role.

### Personal Profiler for Engineers

Builds a candidate profile using the GitHub URL, the personal write-up, and the local resume file.

### Resume Strategist for Engineers

Uses the job research and candidate profile to tailor the resume. The goal is to highlight the most relevant experience without making up information.

### Engineering Interview Preparer

Creates interview questions and talking points that help the candidate prepare for the role.

## Customizing the project

To use your own resume, replace the contents of:

fake_resume.md

Keep the filename the same, or update this line in main.py:

read_resume = FileReadTool(file_path='./fake_resume.md')

To change the model, edit your .env file:

OPENAI_MODEL_NAME=your-preferred-model

To change the default job URL, GitHub profile, or personal summary, update the defaults in the argparse section of main.py.

## Troubleshooting

### OPENAI_API_KEY is empty

Add your API key to .env.

OPENAI_API_KEY=your_key_here

### OPENAI_BASE_URL is missing

Add an OpenAI-compatible base URL to .env.

OPENAI_BASE_URL=https://openrouter.ai/api/v1

The app also checks OPENAI_API_BASE, so either variable can be used for the base URL.

### Search tool errors

Make sure SERPER_API_KEY is set in .env.

SERPER_API_KEY=your_serper_key_here

### Resume file not found

The workflow expects fake_resume.md to exist in the project root.

If your resume has a different filename, rename it to fake_resume.md or update the FileReadTool path in main.py.

## Notes

Generated resumes and interview materials should be reviewed before use. The workflow is designed to tailor and reframe existing experience, not fabricate credentials, employment history, or skills.

## License

Add your preferred license here.