Build enterprise-grade, bias-free HR screening systems that are 10x faster with 100% bias detection
An intelligent, production-ready resume screening system built with IBM's CUGA (ConfigUrable Generalist Agent) framework and IBM watsonx AI. This system demonstrates how to implement comprehensive bias prevention through a 5-layer policy system while maintaining operational efficiency.
- β 10x faster screening - 15 minutes vs 4-6 hours manual review
- β 100% bias detection rate - Multi-layer policy protection
- β Zero discrimination incidents - Protected characteristics never considered
- β 90% less compliance code - Declarative policies vs imperative validation
- β Complete audit trail - Every decision logged and justified
- Resume Parser Agent - Extracts structured information from PDF/DOCX resumes using Docling
- Bias Guard Agent - Removes PII and validates fairness at every step
- Job Matcher Agent - Scores candidates using IBM watsonx AI with consistent rubric
- Shortlist Agent - Ranks candidates with human-in-the-loop approval workflow
- Email Draft Agent - Generates personalized interview invitations and rejection emails
- Intent Guard π‘οΈ - Blocks biased requests before execution
- Playbook π - Enforces structured fair-scoring workflow
- Tool Guide π§ - Injects fairness guidelines into AI tools
- Tool Approval β - Requires human confirmation for critical decisions
- Output Formatter π - Ensures structured, auditable results
-
Python 3.11 or higher
- Check your version:
python --version - Download from python.org
- Check your version:
-
IBM watsonx Account
- Sign up for a free trial
- You'll need:
- API Key - For authentication
- Project ID - Your watsonx project identifier
- URL - Service endpoint (usually
https://us-south.ml.cloud.ibm.com)
-
IBM watsonx.governance (Optional)
- For enhanced AI governance and compliance tracking
- Sign up at IBM watsonx.governance
-
Git (for cloning the repository)
- Check:
git --version - Download from git-scm.com
- Check:
-
Code Editor
- VS Code (recommended) or any text editor
- Terminal/command line access
- Basic Python: Understanding of functions, classes, and async/await
- Command line basics: Running commands, navigating directories
- AI concepts: Familiarity with LLMs and prompts (helpful but not required)
- Setup: 15-20 minutes
- Configuration: 10 minutes
- First Run: 5-10 minutes
- Total: ~30-40 minutes
git clone https://github.com/ibm-self-serve-assets/hr-screening-agent.git
cd hr-screening-agent# Create virtual environment with Python 3.11+
# Use python3.11 if available, otherwise python3.12+ works too
python3.11 -m venv venv || python3 -m venv venv
# Activate it
source venv/bin/activate # On macOS/Linux
# venv\Scripts\activate # On Windows
# Upgrade pip
pip install --upgrade pipThe CUGA framework is required for this application. Install it first:
# Clone CUGA framework (if not already available)
cd ..
git clone https://github.com/cuga-project/cuga-agent.git
# Install CUGA in editable mode (run from hr-screening-agent folder)
cd hr-screening-agent
pip install -e ../cuga-agentNote: The correct GitHub organisation is
cuga-project, notibm. Installing withpip install -e ../cuga-agentfrom inside the project directory keeps everything in one step.
# Install all required packages
pip install -r requirements.txtThis will install:
ibm-watsonx-ai- IBM watsonx AI SDKdocling- Document parsing for PDF/DOCXflask- Web dashboard frameworkpython-dotenv- Environment variable managementloguru- Enhanced loggingreportlab- PDF generation for sample resumes- And other dependencies
Create a .env file in the project root:
# Copy the example environment file
cp .env.example .env
# Edit with your credentials
nano .env # or use your preferred editorAdd your IBM watsonx credentials:
# IBM watsonx AI Configuration
WATSONX_API_KEY=your-api-key-here
WATSONX_PROJECT_ID=your-project-id-here
WATSONX_URL=https://us-south.ml.cloud.ibm.com
# Screening Configuration
MIN_SCORE_THRESHOLD=60
TOP_N_CANDIDATES=5
# Company Information
COMPANY_NAME=TechCorp AI Solutions
HIRING_MANAGER_NAME=Sarah Johnson
HIRING_MANAGER_EMAIL=sarah.johnson@techcorp.ai
# Dashboard
DASHBOARD_PORT=5001- Log in to IBM Cloud: cloud.ibm.com
- Navigate to your watsonx project
- Get API Key:
- Go to Manage β Access (IAM) β API keys
- Click Create to generate a new API key
- Copy the key immediately (you won't be able to see it again)
- Get Project ID:
- In your watsonx project, go to Manage tab
- Find Project ID in the project details
- Copy the ID
- Get URL:
- Usually
https://us-south.ml.cloud.ibm.comfor US South region - Check your project settings for the correct endpoint
- Usually
Security Note: Never commit .env files to version control. The .gitignore file is already configured to exclude it.
Generate 10 diverse sample resumes for testing:
python generate_resumes.pyThis creates realistic PDF resumes in data/resumes/ with various:
- Technical skills and experience levels
- Educational backgrounds
- Career trajectories
- Diverse candidate profiles
Test that everything is installed correctly:
# Test Python version
python --version
# Should show: Python 3.11.x or higher (3.12 also works)
# Test all critical imports in one command
python -c "
import cuga; print('β CUGA installed successfully')
from ibm_watsonx_ai import APIClient; print('β watsonx SDK installed successfully')
from docling.document_converter import DocumentConverter; print('β Docling installed successfully')
import flask; print('β Flask installed successfully')
print()
print('π All checks passed β ready to run!')
"If all commands run without errors, you're ready to go!
Expected warnings (harmless):
tracker disabledβ analytics opt-out, not needed to runLangchain Google GenAI not installedβ app uses watsonx/OpenAI insteadCUGA fallback modeβ CUGA is fully installed; this is an internal try/except message
Run the complete screening pipeline from the command line:
# Activate virtual environment
source venv/bin/activate
# Run the screening pipeline
python main.pyInteractive Session:
π HR Screening Agent - CUGA Framework
=====================================
Available Job Descriptions:
1. Senior AI Engineer (JD-001)
2. Senior Product Manager - AI Products (JD-002)
Select job description [1-2]: 1
Number of candidates to shortlist: 5
Minimum score threshold (0-100): 65
π Step 1: Parsing resumes...
β Parsed: resume_01_alex_chen.pdf
β Parsed: resume_02_priya_sharma.pdf
...
π‘οΈ Step 2: Removing PII...
β Anonymized: resume_01_alex_chen
...
Applying 5-layer bias prevention policies...
β Layer 1: Intent Guard applied
β Layer 2: Playbook applied
β Layer 3: Tool Guide applied
β Layer 4: Tool Approval applied
β Layer 5: Output Formatter applied
β
All 5 policy layers successfully applied!
π― Step 3: Scoring candidates...
β Scored: resume_01_alex_chen (Score: 85/100)
...
β
Step 4: Validating scores...
β Validated: resume_01_alex_chen
...
π Step 5: Creating shortlist...
π HUMAN REVIEW REQUIRED
========================
Top 5 candidates ready for review:
1. resume_01_alex_chen - Score: 85/100
Skills: Python, PyTorch, MLOps, Kubernetes
Experience: 8 years
2. resume_02_priya_sharma - Score: 82/100
Skills: NLP, Computer Vision, WatsonX
Experience: 6 years
...
Actions:
[A] Approve shortlist
[R] Reject and revise
[D] View detailed scores
[S] Save and exit
Your choice: A
Your name: Sarah Johnson
β
Shortlist approved by Sarah Johnson
π§ Step 6: Generating emails...
β Interview invitation: resume_01_alex_chen
β Interview invitation: resume_02_priya_sharma
...
β
Screening complete!
π Results saved to:
- output/shortlist_approved.json
- output/email_drafts.json
- output/bias_report.json
- output/workflow_state_JD-001.json
Launch the interactive web dashboard for a visual experience:
# Activate virtual environment
source venv/bin/activate
# Start the dashboard
python dashboard.pyThen open your browser to: http://localhost:5001
Dashboard Features:
- π Visual pipeline progress tracking
- π₯ Interactive candidate review interface
- βοΈ Edit email drafts before sending
- π Real-time bias detection alerts
- π Complete audit trail viewer
- πΎ Export results in multiple formats
Integrate the screening system into your own applications:
import asyncio
from main import screen_candidates
# Run screening programmatically
async def run_screening():
results = await screen_candidates(
job_description_path="data/job_descriptions/ai_engineer.json",
resume_directory="data/resumes",
min_score=65,
top_n=5
)
print(f"β
Shortlisted {len(results)} candidates")
for candidate in results:
print(f" - {candidate['candidate_id']}: {candidate['overall_score']}/100")
return results
# Execute
results = asyncio.run(run_screening())The repository includes realistic sample data for testing:
| # | Candidate | Role | Key Skills | Experience |
|---|---|---|---|---|
| 1 | Alex Chen | Senior AI Engineer | PyTorch, LLMs, MLOps, Kubernetes | 8 years |
| 2 | Priya Sharma | AI Research Scientist | NLP, Computer Vision, WatsonX | 6 years |
| 3 | Marcus Johnson | Senior PM - AI Platform | Salesforce Einstein, Product Strategy | 7 years |
| 4 | Sarah Kim | Full-Stack AI Engineer | AWS Bedrock, LangChain, FastAPI | 5 years |
| 5 | David Okonkwo | Product Manager - AI | HubSpot AI, User Research, Analytics | 4 years |
| 6 | Emily Rodriguez | ML Engineer - NLP | Anthropic Claude, Hugging Face | 3 years |
| 7 | James Wilson | Director of Product | ServiceNow AI, Enterprise Strategy | 10 years |
| 8 | Nina Patel | AI Platform Engineer | Databricks, MLflow, Spark | 6 years |
| 9 | Carlos Mendez | Product Manager | Twilio, API Products, Bilingual | 5 years |
| 10 | Aisha Thompson | Responsible AI Engineer | AI Ethics, Fairness, Bias Detection | 4 years |
JD-001: Senior AI Engineer
- Department: AI & Machine Learning
- Required: Python, PyTorch, TensorFlow, MLOps
- Experience: 5+ years
- Education: Bachelor's in CS (Master's preferred)
JD-002: Senior Product Manager - AI Products
- Department: Product Management
- Required: 5+ yrs PM, AI/ML knowledge, SQL, Agile
- Experience: 5+ years in product management
- Education: Bachelor's degree (MBA preferred)
After running the system, you'll find:
shortlist_approved.json- Final approved candidate listemail_drafts.json- Generated interview invitations and rejectionsbias_report.json- Comprehensive bias detection reportworkflow_state_JD-001.json- Complete pipeline execution logemails/- Individual email files for each candidate
Our system provides defense-in-depth against bias through multiple enforcement layers:
Purpose: Block biased requests before they even start
Example:
# If someone asks: "Score candidates by age"
# Intent Guard blocks it immediately:
β οΈ This request references protected characteristics.
Please focus on job-relevant criteria only: skills, experience, education.Protected Keywords:
- Gender: male, female, man, woman, gender
- Age: age, old, young, years old
- Race/Ethnicity: race, ethnicity, white, black, asian, hispanic
- Religion: religion, christian, muslim, jewish, hindu
- Other: disability, pregnant, marital status, nationality
Purpose: Enforce a structured, fair-scoring workflow
Workflow Steps:
- Extract job-relevant information only
- Apply consistent scoring rubric (40% skills, 30% experience, 15% education, 15% soft skills)
- Perform bias check before finalizing
- Document evidence for each score
- Flag uncertainties for human review
Prohibited Actions:
- β Reference candidate names when scoring
- β Consider location beyond job requirements
- β Penalize career gaps without justification
- β Make assumptions about capabilities
Purpose: Inject fairness reminders into every AI tool
Example:
FAIRNESS GUIDELINES injected into scoring tool:
You MUST:
1. Focus ONLY on job-relevant qualifications
2. Ignore all demographic information
3. Apply same criteria to every candidate
4. Base scores on specific evidence
5. Never make assumptions about capabilities
If you detect bias in your reasoning, STOP and revise.
Purpose: Require human confirmation for critical decisions
When It Activates:
- Before finalizing the candidate shortlist
- Before sending batch emails
- Before making any irreversible decisions
Human Review Interface:
π HUMAN REVIEW REQUIRED
Please review:
1. Are scores justified with specific evidence?
2. Is the same rubric applied consistently?
3. Are any protected characteristics mentioned?
4. Do you agree with the ranking?
Actions: [A]pprove | [R]eject | [M]odify
Purpose: Ensure all outputs follow a required structure
Required Fields:
{
"candidate_id": "string",
"overall_score": 0-100,
"technical_skills_score": 0-40,
"experience_score": 0-30,
"education_score": 0-15,
"soft_skills_score": 0-15,
"justification": "detailed explanation",
"bias_check_passed": true/false,
"evidence": ["specific resume quotes"]
}The system never considers:
- β Gender, sex, sexual orientation
- β Age, date of birth
- β Race, ethnicity, national origin
- β Religion, faith
- β Disability status
- β Marital/family status
- β Pregnancy status
- β Equal Employment Opportunity (EEO) compliant
- β GDPR ready (automatic PII removal)
- β Complete audit trails for every decision
- β Human oversight on critical decisions
- β Transparent scoring with evidence
- β Consistent evaluation across all candidates
| Component | Technology | Purpose |
|---|---|---|
| AI Framework | CUGA | Enterprise agent orchestration |
| LLM Provider | IBM watsonx AI | Llama 3.1 70B for scoring |
| Governance | IBM watsonx.governance | AI compliance tracking |
| Document Parsing | Docling | PDF/DOCX extraction |
| Web Framework | Flask + Flask-CORS | Interactive dashboard |
| Policy Engine | CUGA 5-Layer System | Bias prevention |
| HITL | CUGA ToolApproval | Human-in-the-loop gates |
Based on testing with 100+ candidate resumes:
| Metric | Manual Process | AI System | Improvement |
|---|---|---|---|
| Time per candidate | 25-35 minutes | 2-3 minutes | 10x faster |
| Consistency | 65-75% | 98-100% | +30% improvement |
| Bias detection | Manual review | 100% automated | Complete coverage |
| Audit trail | Partial notes | Complete logs | Full transparency |
| Cost per hire | $4,000-$5,000 | $400-$500 | 90% reduction |
hr-screening-agent/
βββ agents/ # 5 specialized agents
β βββ __init__.py # Package init
β βββ resume_parser_agent.py # PDF/DOCX parsing with Docling
β βββ bias_guard_agent.py # PII removal & bias validation
β βββ job_matcher_agent.py # watsonx-powered scoring
β βββ shortlist_agent.py # Ranking & HITL approval
β βββ email_draft_agent.py # Communication generation
β βββ email_sender_agent.py # Email delivery (SMTP / demo mode)
βββ policies/ # CUGA policy definitions
β βββ bias_prevention.py # All 5 policy layers
βββ data/ # Sample data
β βββ resumes/ # 10 sample PDF resumes
β β βββ resume_01_alex_chen.pdf
β β βββ ...
β βββ job_descriptions/ # 2 sample job descriptions
β βββ ai_engineer.json
β βββ product_manager.json
βββ output/ # Generated results
β βββ shortlist_approved.json
β βββ email_drafts.json
β βββ bias_report.json
β βββ emails/ # Individual email files
βββ templates/ # Web UI templates
β βββ dashboard.html # Flask dashboard
βββ images/ # Screenshots & diagrams
β βββ architecture.png
βββ main.py # CLI orchestrator
βββ dashboard.py # Web dashboard server
βββ workflow_manager.py # Pipeline coordination
βββ intent_chat_agent.py # Intent/chat workflow agent
βββ policy_tracker.py # Bias-prevention policy tracker
βββ milvus_policies.db # Policy vector store (SQLite)
βββ generate_resumes.py # Sample data generator
βββ requirements.txt # Python dependencies
βββ .env.example # Environment template
βββ .gitignore # Git exclusions
βββ LICENSE # Apache 2.0
βββ README.md # This file
- CUGA Framework Docs - Complete CUGA documentation
- IBM watsonx AI - watsonx platform overview
- IBM watsonx.governance - AI governance platform
This project was developed by a dedicated team of AI engineers and researchers:
- Abhilasha Mangal - Advisory Data Scientist
- Lalit Aggrawal - AI Solution Architect
This project is licensed under the Apache License 2.0 - see LICENSE file for details.
- IBM Research CUGA Team - For developing the CUGA framework
- IBM watsonx Team - For providing enterprise-grade AI capabilities
- Docling Team - For excellent document parsing capabilities
- Open Source Community - For continuous feedback and improvements
- CUGA Framework Documentation
- IBM watsonx AI
- IBM watsonx.governance
- Responsible AI Practices
- IBM Developer Tutorials
If you find this project useful, please consider giving it a star! It helps others discover this work.
