An automated system for managing contractor applications with Airtable integration, intelligent shortlisting, and LLM-powered candidate evaluation.
β οΈ Note: Airtable's free plan does not support webhook automations or custom scripts in automations. The automation runs via an external Python webhook server that can be triggered manually or via API calls. For full automation, Airtable Team/Business plan is required.
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Airtable ββββββΆβ Webhook Server ββββββΆβ OpenAI API β
β (5 Tables) βββββββ (Flask/Python) βββββββ (GPT-4o) β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
- New Application β Airtable triggers webhook
- Compress β Aggregates data from linked tables into JSON
- Shortlist β Evaluates against criteria (experience, rate, location)
- LLM Eval β GPT-4o scores and summarizes candidate
| Table | Purpose |
|---|---|
| Applications | Main applicant records with compressed JSON, LLM results |
| Personal Details | Name, email, location, LinkedIn (linked to Applications) |
| Work Experience | Job history with technologies (linked to Applications) |
| Salary Preferences | Hourly rates, currency, availability (linked to Applications) |
| Shortlisted Leads | Approved candidates with reasons (linked to Applications) |
Application ID- Unique identifierCompressed JSON- All applicant data as JSON blobShortlist Status- "Shortlisted" or "Rejected"LLM Score- 1-10 rating from GPT-4oLLM Summary- AI-generated candidate summaryLLM Follow-Ups- Suggested interview questions
Base URL: http://YOUR-SERVER-IP
Full pipeline - compress, shortlist, and LLM evaluate.
curl -X POST http://YOUR-SERVER-IP/webhook/new-application \
-H "Content-Type: application/json" \
-d '{"record_id": "recXXXXXXXXX"}'Response:
{
"status": "processing",
"record_id": "recXXXXXXXXX",
"message": "Pipeline started in background"
}Compress applicant data only.
curl -X POST http://YOUR-SERVER-IP/webhook/compress \
-H "Content-Type: application/json" \
-d '{"record_id": "recXXXXXXXXX"}'Response:
{"status": "compressed", "record_id": "recXXXXXXXXX"}Run shortlist evaluation only.
curl -X POST http://YOUR-SERVER-IP/webhook/shortlist \
-H "Content-Type: application/json" \
-d '{"record_id": "recXXXXXXXXX"}'Response:
{"status": "shortlisted", "record_id": "recXXXXXXXXX"}Run LLM evaluation only.
curl -X POST http://YOUR-SERVER-IP/webhook/llm-eval \
-H "Content-Type: application/json" \
-d '{"record_id": "recXXXXXXXXX"}'Response:
{"status": "evaluated", "record_id": "recXXXXXXXXX"}Health check endpoint.
curl http://YOUR-SERVER-IP/healthResponse:
{"status": "ok", "service": "mercor-pipeline"}API documentation.
curl http://YOUR-SERVER-IP/Candidates are automatically shortlisted if they meet ALL criteria:
| Criteria | Requirement |
|---|---|
| Experience | β₯ 3 years total |
| Hourly Rate | β€ $150 USD equivalent |
| Location | USA, Canada, UK, Germany, or India |
Bonus: Candidates from Tier-1 companies (Google, Apple, Microsoft, Amazon, Meta, Netflix, Tesla, SpaceX, IBM, Intel) get highlighted.
GPT-4o evaluates shortlisted candidates and provides:
- Score (1-10): Overall fit rating
- Summary: 2-3 sentence assessment
- Follow-up Questions: 3 suggested interview questions
mercor-tooling/
βββ src/
β βββ __init__.py
β βββ config.py # API keys, table names, criteria
β βββ utils.py # Logging, date parsing, validation
β βββ airtable_client.py # Airtable API wrapper
β βββ compress.py # Data compression logic
β βββ decompress.py # JSON to tables restoration
β βββ shortlist.py # Shortlisting criteria evaluation
β βββ llm_eval.py # OpenAI integration
βββ airtable_scripts/ # Scripts for Airtable Scripting Extension
βββ tests/ # Unit tests
βββ webhook_server.py # Flask webhook server
βββ reset_data.py # Test data population script
βββ requirements.txt # Python dependencies
βββ .env # Environment variables (not in git)
βββ mercor-pipeline.service # Systemd service file
βββ nginx.conf # Nginx reverse proxy config
βββ README.md
# Clone repository
git clone https://github.com/Suhaib3100/mercor-tooling.git
cd mercor-tooling
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Create .env file
cp .env.example .env
# Edit .env with your API keysAIRTABLE_API_KEY=pat...
AIRTABLE_BASE_ID=app...
LLM_API_KEY=sk-proj-...
LLM_PROVIDER=openai
LLM_MODEL=gpt-4o# Compress all applicants
python3 -m src.compress
# Shortlist candidates
python3 -m src.shortlist
# LLM evaluation
python3 -m src.llm_evalpython3 webhook_server.py
# Server runs on http://localhost:8080# SSH into VM
ssh user@your-vm-ip
# Clone and setup
git clone https://github.com/Suhaib3100/mercor-tooling.git
cd mercor-tooling
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Create .env with your keys
nano .env
# Setup systemd service
sudo cp mercor-pipeline.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable mercor-pipeline
sudo systemctl start mercor-pipeline
# Setup Nginx
sudo cp nginx.conf /etc/nginx/sites-available/mercor-pipeline
sudo ln -sf /etc/nginx/sites-available/mercor-pipeline /etc/nginx/sites-enabled/
sudo rm -f /etc/nginx/sites-enabled/default
sudo systemctl restart nginx# Check status
sudo systemctl status mercor-pipeline
# View logs
sudo journalctl -u mercor-pipeline -f
# Restart service
sudo systemctl restart mercor-pipeline- Go to Airtable β Automations tab
- Create new automation:
- Trigger: When record created in "Applications"
- Action: Send webhook
- Configure webhook:
- URL:
http://YOUR-SERVER-IP/webhook/new-application - Method: POST
- Body:
{"record_id": "{{Record ID}}"}
- URL:
- Turn on automation
| Code | Meaning |
|---|---|
| 200 | Success |
| 202 | Accepted (processing in background) |
| 400 | Bad request (missing record_id) |
| 404 | Record not found |
| 500 | Server error |
# Health check
curl http://YOUR-SERVER-IP/health
# Test with a real record ID from Airtable
curl -X POST http://YOUR-SERVER-IP/webhook/new-application \
-H "Content-Type: application/json" \
-d '{"record_id": "recANTrJO2vkL5tol"}'python3 reset_data.pyMIT License
Suhaib SZ - GitHub