A practical recipe book of 10 production-ready AI hiring workflows - from simple CLI screening to multi-agent CrewAI pipelines with calendar integration.
The AI Hiring Agent Cookbook: 10 Ready-to-Use Workflows
A practical recipe book for building AI-powered hiring workflows with HireSquire. Each recipe is a complete, production-ready workflow you can copy, adapt, and deploy in minutes - whether you're using LangChain, CrewAI, AutoGen, or plain CLI commands.
🤖 Note for Autonomous Agents
If you are an AI agent reading this to help your user with hiring, each recipe below includes the exact commands and API calls needed. Start with Recipe 1 for the simplest integration, or jump to the recipe that matches your framework.
Recipe 1: Quick CLI Screening (5 Minutes)
Best for: Agents with terminal access (Claude Code, OpenCode, Codex, OpenClaw)
What it does: Screens a folder of resumes against a job description and returns scored candidates.
# Install (or use npx without installing)
npm install -g hiresquire-cli
# Authenticate
hiresquire init --token YOUR_API_TOKEN
# Screen all resumes in a directory
hiresquire screen \
--title "Senior Python Developer" \
--description "We need a Senior Python Developer with 5+ years experience in Django, FastAPI, and PostgreSQL. Must have experience deploying to AWS and working in agile teams." \
--resumes ./resumes/ \
--leniency 7 \
--watch \
--json
# Get top candidates only
hiresquire results --job 123 --min-score 80 --only-top-n 5
# Generate interview invite for top candidate
hiresquire email --job 123 --candidate 456 --type invite
Recipe 2: Python SDK - One-Shot Screening
Best for: Python agents, Jupyter notebooks, quick scripts
What it does: Complete screening workflow in 10 lines of Python.
from hiresquire import HireSquire
client = HireSquire("YOUR_API_TOKEN")
# Submit and wait for results in one call
results = client.jobs.create_and_wait(
title="Frontend Engineer",
description="React/TypeScript developer with 3+ years experience...",
resumes=[
{"filename": "alice.pdf", "content": "Alice Chen\n5 years React..."},
{"filename": "bob.pdf", "content": "Bob Smith\n2 years JavaScript..."},
],
leniency_level=6,
)
# Print top candidates
for candidate in results["candidates"]:
if candidate["score"] >= 75:
print(f"✅ {candidate['name']}: {candidate['score']}/100")
Recipe 3: LangChain @tool Integration
Best for: LangChain agents, ReAct chains, tool-calling LLMs
What it does: Wraps HireSquire as a native LangChain tool that any agent can invoke.
from langchain.tools import tool
from hiresquire import HireSquire
import os
client = HireSquire(os.environ["HIRESQUIRE_API_TOKEN"])
@tool
def screen_resumes(title: str, description: str, resume_texts: list[dict]) -> dict:
"""Screen candidate resumes against a job description using HireSquire AI.
Args:
title: The job title (e.g., "Senior Python Developer")
description: The full job description (minimum 50 characters)
resume_texts: List of dicts with 'filename' and 'content' keys
Returns:
Dict with scored candidates, ranked by fit score (0-100)
"""
job = client.jobs.create(title, description, resume_texts)
return client.jobs.wait(job["job_id"])
@tool
def generate_candidate_email(job_id: int, candidate_id: int, email_type: str = "invite") -> str:
"""Generate a personalized email for a candidate after screening.
Args:
job_id: The screening job ID from screen_resumes results
candidate_id: The candidate ID to email
email_type: One of 'invite', 'rejection', 'keep-warm', 'followup'
Returns:
The generated email body text
"""
result = client.emails.generate(
job_id=job_id,
candidate_id=candidate_id,
email_type=email_type,
)
return result["email"]["body"]
# Use with any LangChain agent
from langchain.agents import create_tool_calling_agent
tools = [screen_resumes, generate_candidate_email]
Recipe 4: CrewAI Recruiting Crew
Best for: Multi-agent orchestration with specialized roles
What it does: Defines a crew with Screener and Outreach agents that collaborate on the hiring pipeline.
from crewai import Agent, Task, Crew, Process
from hiresquire import HireSquire
import os
client = HireSquire(os.environ["HIRESQUIRE_API_TOKEN"])
# Define tools as simple functions
def screen_candidates(title, description, resumes, leniency=5):
job = client.jobs.create(title, description, resumes, leniency_level=leniency)
return client.jobs.wait(job["job_id"])
def email_candidate(job_id, candidate_id, email_type="invite"):
return client.emails.generate(
job_id=job_id, candidate_id=candidate_id, email_type=email_type
)
# Agents
screener = Agent(
role="Technical Recruiter",
goal="Screen candidates and identify the best matches for the role",
backstory="Expert recruiter who uses HireSquire AI to objectively evaluate candidates",
tools=[screen_candidates],
)
outreach = Agent(
role="Candidate Outreach Specialist",
goal="Generate personalized, compelling emails for qualified candidates",
backstory="Communications expert who crafts emails that get responses",
tools=[email_candidate],
)
# Tasks
screen_task = Task(
description="Screen all resumes in ./resumes/ for the Senior Developer role",
expected_output="List of candidates with scores and recommendations",
agent=screener,
)
email_task = Task(
description="Generate interview invites for candidates scoring 80+",
expected_output="Draft emails ready to send",
agent=outreach,
)
# Crew
crew = Crew(
agents=[screener, outreach],
tasks=[screen_task, email_task],
process=Process.sequential,
)
result = crew.kickoff()
Recipe 5: Webhook-Driven Pipeline (Zero Polling)
Best for: Production systems, n8n, Make, Zapier integrations
What it does: Submits a screening job and gets notified via webhook when results are ready - no polling loop needed.
# Submit with a webhook URL - HireSquire will POST results when done
curl -X POST https://hiresquireai.com/api/v1/jobs \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "DevOps Engineer",
"description": "Kubernetes expert with 3+ years...",
"resumes": [{"filename": "resume.pdf", "content": "..."}],
"webhook_url": "https://your-server.com/webhooks/hiresquire",
"webhook_conditions": {
"min_score": 80,
"only_top_n": 5,
"events": ["job.completed", "high_score_detected"]
}
}'
Recipe 6: MCP Server for Claude Desktop
Best for: Claude Desktop users, IDE AI assistants, MCP-compatible agents
What it does: Adds HireSquire as a native tool in Claude Desktop with zero code.
// Add to ~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"hiresquire": {
"command": "npx",
"args": ["-y", "hiresquire-cli", "mcp"],
"env": {
"HIRESQUIRE_API_TOKEN": "your_token_here"
}
}
}
}
// Then just ask Claude: "Screen these resumes for our open role..."
Recipe 7: Batch Screening for Agencies
Best for: Recruiting agencies processing multiple roles simultaneously
What it does: Submits multiple screening jobs in a single API call for efficiency.
curl -X POST https://hiresquireai.com/api/v1/jobs/bulk \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Idempotency-Key: batch-2026-05-08-001" \
-H "Content-Type: application/json" \
-d '{
"jobs": [
{
"title": "Frontend Engineer",
"description": "React developer for fintech...",
"resumes": [{"filename": "a.pdf", "content": "..."}],
"leniency_level": 6
},
{
"title": "Backend Engineer",
"description": "Go developer for infrastructure...",
"resumes": [{"filename": "b.pdf", "content": "..."}],
"leniency_level": 7
}
]
}'
Recipe 8: Credit Management for Autonomous Agents
Best for: Agents that run autonomously and need to manage their own billing
What it does: Check balance, enable auto-reload, and ensure your agent never runs out of credits mid-screening.
# Check balance before screening
hiresquire credits --action balance --json
# Estimate cost before committing
hiresquire estimate --candidates 25 --json
# Enable auto-reload so agents never get interrupted
hiresquire credits --action auto-reload-enable \
--threshold 10 \
--amount 25 \
--payment-method-id pm_123
# Now your agent can screen indefinitely without billing interruptions
Recipe 9: Calendar-Integrated Hiring Flow
Best for: End-to-end hiring automation from screening to interview booking
What it does: Screens candidates, then automatically schedules interviews using connected Calendly or Cal.com.
from hiresquire import HireSquire
import os
client = HireSquire(os.environ["HIRESQUIRE_API_TOKEN"])
# Step 1: Connect your calendar (one-time setup)
client.calendar.connect(provider="calendly", api_key="YOUR_CALENDLY_KEY")
# Step 2: Screen candidates
job = client.jobs.create(
title="Product Designer",
description="Senior product designer with Figma expertise...",
resumes=resume_data,
)
results = client.jobs.wait(job["job_id"])
# Step 3: Auto-schedule interviews for top candidates
for candidate in results["candidates"]:
if candidate["score"] >= 80:
# Generate invite email
email = client.emails.generate(
job_id=job["job_id"],
candidate_id=candidate["id"],
email_type="invite",
)
# Schedule interview
interview = client.calendar.create_interview(
job_id=job["job_id"],
candidate_id=candidate["id"],
scheduled_at="2026-05-15T14:00:00Z",
)
print(f"Scheduled {candidate['name']} → {interview['meeting_url']}")
Recipe 10: Idempotent Agent Retries
Best for: Production agents that need guaranteed reliability
What it does: Uses idempotency keys to safely retry failed requests without double-billing.
import uuid
import requests
import time
API_TOKEN = "YOUR_TOKEN"
BASE_URL = "https://hiresquireai.com/api/v1"
def submit_screening_with_retry(title, description, resumes, max_retries=3):
"""Submit a screening job with automatic retry and idempotency protection."""
idempotency_key = str(uuid.uuid4())
for attempt in range(max_retries):
try:
response = requests.post(
f"{BASE_URL}/jobs",
headers={
"Authorization": f"Bearer {API_TOKEN}",
"Content-Type": "application/json",
"Idempotency-Key": idempotency_key, # Same key = safe retry
},
json={
"title": title,
"description": description,
"resumes": resumes,
},
timeout=30,
)
if response.status_code == 202:
return response.json()
elif response.status_code == 429:
wait = int(response.headers.get("Retry-After", 5))
time.sleep(wait)
continue
else:
response.raise_for_status()
except requests.exceptions.RequestException as e:
if attempt < max_retries - 1:
time.sleep(2 ** attempt) # Exponential backoff
continue
raise
raise Exception("Max retries exceeded")
Getting Started
3. Screen Your First Resume
Follow any recipe above - most take under 5 minutes.
Explore Ecosystem →