An intelligent, fully-automated candidate screening system that processes job applicant emails from Wellfound, extracts candidate information using AI, scores candidates based on custom criteria, and stores everything in Airtable.
Built for hiring managers and recruiters, this system eliminates the manual work of screening candidate emails. It automatically:
- Fetches unprocessed candidate emails from Gmail
- Uses GPT-4 to extract candidate details from HTML emails
- Scores candidates based on customizable criteria (0-100 scale)
- Labels processed emails in Gmail
- Stores structured candidate data in Airtable
Perfect for: Recruiters processing high volumes of candidate applications, hiring teams using Wellfound/AngelList, and anyone who wants to automate their hiring pipeline.
- ๐ค Fully Automated Workflow - Zero manual intervention required
- ๐ง AI-Powered Extraction - GPT-4.1 intelligently parses complex HTML emails
- ๐ Smart Scoring System - Customizable 100-point scoring criteria
- ๐ง Gmail Integration - Automatic email labeling via Pica
- ๐ Airtable Storage - Structured candidate data management
- ๐ Batch Processing - Handles 100+ emails per batch with pagination
- ๐ช Retry Logic - Built-in 5-attempt retry for reliability
- โก Real-Time UI - Live progress tracking and status updates
- ๐ Manual Controls - Stop, retry, or skip emails as needed
- ๐จ Modern Interface - Clean, responsive UI built with React
1. Load Emails
โ
2. For Each Email:
โโ Fetch email content via Pica Gmail API
โโ Extract candidate details (Name, Email, Skills, etc.)
โโ Calculate score based on criteria (0-100)
โโ Label email as "Wellfound Candidate found"
โโ Store candidate record in Airtable
โ
3. Move to Next Email (automatic)
โ
4. Complete! โ
The system processes emails sequentially with a 2-second delay between each to avoid rate limits. It automatically continues until all emails are processed or an error occurs.
| Technology | Purpose |
|---|---|
| Next.js 15.2.2 | React framework (App Router) |
| TypeScript 5 | Type-safe development |
| OpenAI GPT-4.1 | AI model for extraction & scoring |
| Pica Toolkit | Integration orchestration layer |
| Vercel AI SDK | Streaming AI responses |
| Gmail API | Email fetching & labeling (via Pica) |
| Airtable API | Candidate data storage (via Pica) |
| Tailwind CSS 4 | Modern styling |
| Radix UI | Accessible UI components |
Before you begin, ensure you have:
- Node.js 18.18+ installed (Download)
- Pica Account - Sign up at picaos.com
- Gmail Connection - Set up via Pica dashboard
- Airtable Account - Set up via Pica dashboard with a prepared candidate tracking base
- OpenAI API Key - For GPT-4 access
git clone <your-repo-url>
cd candidates-trackingUsing npm:
npm installOr using pnpm:
pnpm installCreate a .env.local file in the root directory:
cp .env.example .env.localFill in your environment variables:
# Pica API Configuration
PICA_SECRET_KEY=your_pica_secret_key_here
# OpenAI API Key
OPENAI_API_KEY=your_openai_api_key_here
# Gmail Connection (via Pica)
NEXT_PUBLIC_GMAIL_CONNECTION_KEY=your_gmail_connection_key_here
# Airtable Configuration (via Pica)
AIRTABLE_CONNECTION_KEY=your_airtable_connection_key_here
AIRTABLE_BASE_ID=your_airtable_base_id_here
AIRTABLE_TABLE_ID=your_airtable_table_id_here| Variable | Description | Where to Find |
|---|---|---|
PICA_SECRET_KEY |
Your Pica API secret key | Pica Dashboard โ Settings โ API Keys |
OPENAI_API_KEY |
OpenAI API key for GPT-4 | OpenAI Platform โ API Keys |
NEXT_PUBLIC_GMAIL_CONNECTION_KEY |
Gmail connection identifier | Pica Dashboard โ Connections โ Gmail โ Connection Key |
AIRTABLE_CONNECTION_KEY |
Airtable connection identifier | Pica Dashboard โ Connections โ Airtable โ Connection Key |
AIRTABLE_BASE_ID |
Your Airtable base ID | Airtable base URL: app{BASE_ID} |
AIRTABLE_TABLE_ID |
Your Airtable table ID | Airtable table URL: tbl{TABLE_ID} |
- Go to picaos.com and sign up
- Navigate to your dashboard
- Click "Connections" โ "Add Connection"
- Select Gmail
- Authenticate with your Google account
- Copy the Connection Key
- Click "Connections" โ "Add Connection"
- Select Airtable
- Authenticate with your Airtable account
- Copy the Connection Key
- Go to Settings โ API Keys
- Create a new API key
- Copy your Pica Secret Key
Create a new Airtable base called "Candidate Tracking" (or any name you prefer).
Your Airtable table must have these fields (exact names required):
| Field Name | Type | Description |
|---|---|---|
Name |
Single line text | Candidate's full name |
Email |
Candidate's email address | |
Location |
Single line text | Candidate's location |
Current Company |
Single line text | Current employer |
Current Title |
Single line text | Current job title |
School |
Single line text | Educational institution |
Degree |
Single line text | Degree obtained |
Skills |
Long text | Comma-separated skills |
Job Search Status |
Single line text | Job search status from email |
Years of Experience |
Single line text | Years of experience (optional) |
Score |
Number | Calculated score (0-100) |
Score Reasoning |
Long text | Detailed scoring explanation |
Base ID:
- Open your Airtable base
- Look at the URL:
https://airtable.com/app{YOUR_BASE_ID}/... - Copy
app{YOUR_BASE_ID}(e.g.,appXYZ123)
Table ID:
- Click on any table in your base
- Look at the URL:
https://airtable.com/app.../tbl{YOUR_TABLE_ID}/... - Copy
tbl{YOUR_TABLE_ID}(e.g.,tblABC456)
npm run devThe application will start at http://localhost:3000
npm run build
npm startnpm run lint-
Open the Application
- Navigate to
http://localhost:3000 - You'll see the Candidate Hiring dashboard
- Navigate to
-
Load Emails
- Click the "Load Emails" button
- The system fetches up to 100 unprocessed emails matching the criteria
- Currently searches for:
subject:"is interested in Software Engineer (Integrations) at Pica" -label:"Wellfound Candidate found"
-
Automatic Processing Begins
- The system automatically processes each email:
- โ Fetches email content
- โ Extracts candidate information
- โ Calculates score
- โ Labels email in Gmail
- โ Stores data in Airtable
- Progress bar updates in real-time
- 2-second delay between emails
- The system automatically processes each email:
-
Monitor Progress
- Progress Bar - Shows completion percentage
- Status Badge - "Processing", "Error", "Complete"
- Message View - Real-time AI processing logs
- Current Email - Shows which email is being processed
-
Handle Errors (if any)
- If an error occurs, the system stops automatically
- You'll see an error toast with details
- Options available:
- Retry - Reprocess the failed email
- Skip - Move to the next email
-
Manual Controls
- Stop Processing - Stops the current workflow
- Useful if you need to pause or review
-
Completion
- Once all emails are processed, you'll see a success message
- All candidate data is now in your Airtable base
- Processed emails are labeled in Gmail
Candidates are scored out of 100 points based on the following criteria:
| Criterion | Points | Description |
|---|---|---|
| AI/LLM Experience | 30 | Experience with LLM, LangChain, CrewAI, Generative AI, or similar |
| Python Experience | 20 | Has Python in their skills |
| Additional Languages | 20 | Experience with Rust or Scala |
| TypeScript Experience | 10 | Has TypeScript in their skills |
| Years of Experience | 20 | More than 3 years of software development experience |
Total: 100 points
Candidate A:
- โ Has LangChain experience (30 points)
- โ Python developer (20 points)
- โ No Rust/Scala (0 points)
- โ TypeScript skills (10 points)
- โ 5 years experience (20 points)
- Total: 80/100
Score Reasoning (stored in Airtable):
"Scored 80/100: Candidate has strong AI experience (30 points) with LangChain and LLM development, Python skills (20 points), TypeScript experience (10 points), and 5 years of professional experience (20 points). However, lacks Rust/Scala experience (0 points)."
candidates-tracking/
โโโ src/
โ โโโ app/
โ โ โโโ api/
โ โ โ โโโ chat/
โ โ โ โ โโโ route.ts # AI chat endpoint (GPT-4 streaming)
โ โ โ โโโ load-emails/
โ โ โ โโโ route.ts # Gmail email fetching API
โ โ โโโ page.tsx # Main UI component
โ โ โโโ layout.tsx # App layout
โ โ โโโ globals.css # Global styles
โ โโโ components/
โ โ โโโ ai-elements/ # AI UI components
โ โ โโโ ui/ # Reusable UI components
โ โ โโโ OptimizedMessage.tsx # Message rendering
โ โ โโโ VirtualizedMessageList.tsx # Efficient message list
โ โโโ lib/
โ โโโ prompts/
โ โ โโโ candidate-tracking.ts # System prompt & instructions
โ โโโ tools/
โ โ โโโ gmail-tools.ts # Gmail labeling tool
โ โ โโโ airtable-tools.ts # Airtable insertion tool
โ โโโ utils.ts # Utility functions
โโโ public/ # Static assets
โโโ .env.local # Environment variables (create this)
โโโ .env.example # Environment template
โโโ package.json # Dependencies
โโโ next.config.ts # Next.js configuration
โโโ tsconfig.json # TypeScript configuration
โโโ README.md # This file
| File | Purpose | Customize For |
|---|---|---|
src/lib/prompts/candidate-tracking.ts |
System prompt, job description, scoring criteria | Different roles, scoring systems |
src/app/page.tsx (line 143) |
Email search query | Different email subjects/filters |
src/app/api/load-emails/route.ts |
Gmail API query parameters, max results | Email filtering, pagination settings |
src/lib/tools/gmail-tools.ts |
Gmail label name, retry logic | Custom label names, retry behavior |
src/lib/tools/airtable-tools.ts |
Airtable field mapping | Custom Airtable schema |
Edit src/lib/prompts/candidate-tracking.ts:
// Update lines 13-41 with your job description
Job Title: Your Job Title Here
Location: Your Location
Company: Your Company
...Edit src/lib/prompts/candidate-tracking.ts:
// Update lines 44-86 with your scoring criteria
1. Criterion One (XX points):
- Description
...Edit src/app/page.tsx (line 143):
query: 'subject:"your email subject here" -label:"your label here"'Gmail Query Syntax:
subject:"text"- Emails with specific subject-label:"name"- Exclude emails with labelfrom:[email protected]- From specific senderafter:2025/01/01- After specific date- Combine with spaces (AND logic)
Edit tool files to change retry attempts:
// In src/lib/tools/gmail-tools.ts or airtable-tools.ts
const MAX_RETRIES = 5; // Change this numberโ "Missing PICA_SECRET_KEY" Error
- Ensure all environment variables are set in
.env.local - Restart the development server after adding variables
- Check for typos in variable names
โ "Failed to fetch Gmail emails"
- Verify your Gmail connection is active in Pica dashboard
- Check
NEXT_PUBLIC_GMAIL_CONNECTION_KEYis correct - Ensure Gmail API is enabled for your Pica account
โ "Failed to add candidate to Airtable"
- Verify Airtable field names match exactly (case-sensitive)
- Check
AIRTABLE_BASE_IDandAIRTABLE_TABLE_IDare correct - Ensure Airtable connection has write permissions
โ "No emails found"
- Check your Gmail query syntax
- Verify emails exist matching the criteria
- Ensure emails aren't already labeled
โ Processing stops unexpectedly
- Check browser console for errors
- Look for error toasts in the UI
- Verify OpenAI API key has sufficient credits
- Check if you hit Pica rate limits
Enable detailed logging:
# In browser console
localStorage.setItem('debug', 'true')Check server logs:
# Terminal where dev server is running
# All API calls and tool executions are logged with prefixes:
# ๐ง [GMAIL-TOOL]
# ๐ต [AIRTABLE-TOOL]
# ๐ [STREAM]Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Write clean, commented code
- Follow existing code style
- Test thoroughly
- Commit your changes
git commit -m "Add amazing feature" - Push to your branch
git push origin feature/amazing-feature
- Open a Pull Request
- Use TypeScript for all new code
- Follow existing naming conventions
- Add comments for complex logic
- Use descriptive variable names
- Keep functions focused and small
This project is licensed under the MIT License - see the LICENSE file for details.
- Pica - Integration orchestration platform
- Vercel AI SDK - AI streaming framework
- OpenAI - GPT-4 language model
- shadcn/ui - UI component inspiration
- Issues: Open an issue
- Discussions: Join discussions
- Pica Documentation: picaos.com/docs
Built with โค๏ธ for recruiters and hiring teams