How hanshikasahu/redrob-talentmatchai works
Purpose and Entry Points
TalentMatchAI is an offline Python candidate-ranking pipeline for a Senior AI Engineer role. It is designed to rank a large candidate dataset under a CPU-only, five-minute online-ranking constraint.
Primary entry points:
• precompute.py — offline survivor filtering and embedding generation.
• rank.py — online ranking and CSV submission generation.
• validate_submission.py — validates the produced submission format.
Input, Output, and Contract Boundary
The pipeline consumes a candidate dataset (described as candidates.jsonl, not committed) plus role requirements embedded or read by the ranking logic. Candidate shape is documented by candidate_schema.json.
Primary output is a ranked CSV, represented in the repo by submission.csv and Edward.csv. Submission requirements and metadata are captured in submission_spec.docx and submission_metadata.yaml.
Offline Precomputation Stage
precompute.py is the expensive, one-time stage. It streams the candidate dataset rather than loading all records at once, applies hard disqualification rules, and encodes surviving career histories with Sentence Transformers.
Its architectural purpose is to move model inference outside the constrained ranking window. Generated artifacts—embeddings, survivor IDs, and survivor profiles—are intentionally excluded from source control and become the interface consumed by rank.py.
Grounding paths:
• precompute.py
• candidate_schema.json
• .gitignore
Hard Eligibility Gate
Before semantic scoring, the system removes candidates who appear to have only consulting-company experience or who have been inactive for six or more months. This is a major control-flow boundary: rejected candidates never enter embedding generation or downstream scoring.
The gate reduces the candidate population and protects the online stage from unnecessary compute. Its rules are part of the ranking design rather than a separate service.
Grounding paths:
• precompute.py
• rank.py
Semantic Relevance Layer
Career-history text, rather than candidate skill lists alone, is represented as embeddings using the all-MiniLM-L6-v2 Sentence Transformers model. rank.py compares survivor embeddings against the job-description embedding using cosine similarity.
Candidates below a semantic-similarity threshold are zeroed, creating a second relevance boundary after hard eligibility. Embedding computation is offline; similarity evaluation is online.
Grounding paths:
• precompute.py
• rank.py
• requirements.txt
Composite Ranking and Penalties
rank.py combines semantic similarity with structured recruiter-style signals: experience quality, behavioral availability, verification/assessment evidence, and role-specific nice-to-haves. It then applies title-relevance and job-hopping penalties before ordering candidates and writing the submission.
This stage owns final score formation and deterministic rank ordering; it should load precomputed artifacts directly and avoid rereading the full raw candidate dataset during normal ranking.
Grounding paths:
• rank.py
• submission.csv
Runtime and Dependencies
The system is a local Python 3.13, CPU-only batch workflow. Key libraries are Sentence Transformers for embeddings and NumPy/scikit-learn for vector and scoring operations. There is no indicated web service, database, GPU dependency, or external runtime infrastructure.
Exploration and score-development work is separated from production execution in:
• notebooks/explore.ipynb
• notebooks/top500_final.json
Validation and Delivery Flow
The expected operational sequence is: run offline precompute, run online ranking to create a CSV, then validate the CSV against submission expectations. Validation is a final delivery boundary rather than part of scoring.
Grounding paths:
• precompute.py
• rank.py
• validate_submission.py
Main entry points: precompute.py Hard eligibility gate · .gitignore Survivor artifacts · requirements.txt MiniLM embeddings · rank.py Ranking entry point
Components 13
Offline precompute
One-time CPU-heavy survivor and embedding preparation.
- Precompute entry point · Streams records and produces reusable survivor artifacts.
precompute.py - Hard eligibility gate · Excludes consulting-only and inactive candidates before inference.
precompute.py - MiniLM embeddings · all-MiniLM-L6-v2 represents career histories.
requirements.txt - Survivor artifacts · Embeddings, survivor IDs, and profiles excluded from source control.
.gitignore
Online ranking
CPU-bound ranking path constrained to five minutes.
- Ranking entry point · Loads precomputed artifacts without rereading the full dataset.
rank.py - Semantic relevance · Compares survivor vectors with the job-description embedding and zeroes low matches.
rank.py - Composite scoring · Combines recruiter signals and applies title and job-hopping penalties.
rank.py
Delivery
Submission creation and format validation.
- Ranked submission
submission.csv - Submission validator · Final format and delivery boundary.
validate_submission.py
Other components
- Candidate dataset · Uncommitted candidate records streamed by precompute.
- Candidate schema
candidate_schema.json - Score exploration · Separate score-development work from production execution.
notebooks/explore.ipynb - Top-500 reference
notebooks/top500_final.json
Connections 12
- Candidate schema → Precompute entry point: defines records
- Candidate dataset → Precompute entry point: streamed input
- Precompute entry point → Hard eligibility gate: applies
- Hard eligibility gate → MiniLM embeddings: eligible histories
- MiniLM embeddings → Survivor artifacts: writes vectors
- Hard eligibility gate → Survivor artifacts: writes IDs and profiles
- Survivor artifacts → Ranking entry point: loads
- Ranking entry point → Semantic relevance: computes similarity
- Semantic relevance → Composite scoring: thresholded relevance
- Composite scoring → Ranked submission: orders and writes
- Ranked submission → Submission validator: validates
- Score exploration → Top-500 reference: produces