Skip to main content
@kneeraazon
Live ProductAI & AutomationCase Study

Built for Recruiting Teams · Python · Typer · Gemini · Notion API

AI Recruitment Scanning Agent

A command-line tool that screens a folder of CVs (PDF and DOCX) against a job description with Google Gemini and files one ranked, checked candidate page per CV in a Notion database. It scores each CV from 0 to 100, derives the fit category from the score, skips candidates already in the database, shows a live progress bar and a summary, and exits non-zero if any CV failed. Python, Typer and Rich, published on PyPI.

OUTCOME.01250Automated tests passing
OUTCOME.02253 / 253Seeded bugs caught by the tests (recorded)
OUTCOME.03100%Line and branch coverage
2D SYSTEM TOPOLOGY // END-TO-END REQUEST PIPELINE4-STAGE DATA FLOW

CV Folder → Text Extract → Gemini Score → Notion Pages

FIG.01 // INTERFACE & SYSTEM CAPTURE1 / 7
A terminal frame showing ai-recruit --help, which lists the process and setup-notion commands, and ai-recruit process --help, with its two required arguments (a CV folder and a job description PDF) and the Notion options.
A terminal frame showing ai-recruit --help, which lists the process and setup-notion commands, and ai-recruit process --help, with its two required arguments (a CV folder and a job description PDF) and the Notion options.

Role

Python Developer

Duration

Since April 2026

Tech Stack

Python 3.14Typer and RichGoogle Gemini (google-genai)Notion API (notion-client 3)pypdf and python-docxpytestRuffuv
SECTION 01 // PROBLEM STATEMENT

The Problem

Screening a pile of CVs against a job description is repetitive work, and the results usually end up scattered across a spreadsheet or a tracker. The aim was one command that does the first pass and files the results where the team already works, in a Notion database.

The published version had stopped working on current dependencies: it named a Google model that has been retired, so every CV failed while the command still printed 'Done' and exited 0, and an upgrade of the Notion library had silently switched duplicate detection off.

SECTION 02 // SYSTEM ARCHITECTURE & EXECUTION

My Approach

  1. Commands. A Typer and Rich command line with ai-recruit process <cv folder> <job description PDF> and ai-recruit setup-notion, keys read from a .env file in the working directory.
  2. Extraction. PDF and DOCX CVs are read (the first 50 pages of a PDF, and files over 25 MB are skipped).
  3. Screening. A Gemini model, set by GEMINI_MODEL, returns JSON for each CV: name, e-mail, phone, skills, an experience summary, a match score and a reason. The documents are fenced as untrusted data in the prompt, so a CV cannot instruct the model.
  4. Checking. The model's answer is validated before it is stored: the score must be 0 to 100, the category (High, Medium or Low Fit) always follows from the score, an address Notion would refuse is dropped, skills are cleaned, and text is cut to Notion's limits.
  5. Notion. One page per candidate in the database's data source (Notion's 2025 data-source API). setup-notion adds the twelve properties the tool needs. A candidate already present is skipped, matched on e-mail and job id, or on the CV file name when there is no e-mail.
  6. Operation. A live progress bar, a summary table, exit code 1 if any CV failed, and a stop after three Gemini failures in a row.
  7. Quality. Six small modules, 250 tests that run on the real Notion library with only HTTP stubbed, mutation checks, locked dependencies and CI.
  8. Review. The retired model name, the dead duplicate check, a .env that was looked for next to the installed package, a model answer that was trusted (a CV could set its own score), and file names that broke the terminal markup were all fixed.
SECTION 03 // VERIFIED OUTCOMES

Results & Impact

Re-run on 2026-11-14 in a scratch copy: ruff check passes, 250 tests pass, and coverage is 100% of 478 statements and 122 branches. uv audit found no known vulnerabilities in 50 packages and the 0.3.2 wheel builds.

The real command line was also run that day against local stand-ins for Gemini and Notion. setup-notion added the twelve properties. process screened five fictional CVs (three PDF, two DOCX) against a fictional job description: two High Fit at 100 of 100, one Medium Fit at 57 and two Low Fit at 42 and 0, all five filed. Running it again skipped all five as duplicates and added none. The scores in those frames come from a rule-based stand-in, not a language model.

Recorded in the repository's work-done.md (2026-11-10): the suite grew from 44 to 250 tests and a mutation check put 253 deliberate bugs back one at a time with the tests failing for every one.

Not verified: the real Gemini and Notion services (the model name and the Notion requests were checked against documentation and the library, and no key was available); how well a model scores real CVs, which a person should read before acting on; scanned (image-only) PDFs, which are not supported; behaviour under Gemini quotas for large batches; and the mutation run, which was not repeated on 2026-11-14.