Back to all articles
8 min read

Build an AI CV Extractor: JSON Structured Output Workshop

By Dorian Laurenceau

Updated

📅 Last reviewed: April 24, 2026. Updated with April 2026 findings and community feedback.

Theory is useless without practice. In this hands-on workshop, you will build a complete CV/resume data extractor, from raw resume text to clean, validated JSON. This is the exact pattern used by HR tech companies processing thousands of applications daily.

The Workshop Goal

By the end of this workshop, you will have a prompt pipeline that:

  1. →Takes raw CV/resume text as input
  2. →Extracts structured candidate data into a predefined JSON schema
  3. →Handles edge cases (missing data, ambiguous entries, multiple roles)
  4. →Validates output and retries on failure

Step 1: Define Your Schema

Before writing any prompt, define the exact output structure you need.

Designing the CV Schema

From requirements to JSON structure

Identify Required Fields

Start with what the HR team actually needs. Do not extract everything, focus on fields that drive decisions.
code
Required: name, email, phone, location
Experience: company, role, duration, key achievements
Education: institution, degree, year
Skills: technical skills, soft skills, languages

💡 Start with the minimum viable schema. Add fields only when needed.

1/3

Step 2: Build the Extraction Prompt

Click to expand

Step 3: Test with Real Examples

Quick Check

Why should the schema use 'string|null' instead of just 'string'?

Step 4: Handle Edge Cases

Edge Cases and Solutions

Edge CaseProblemSolution
Missing Contact InfoNo email or phone listedReturn null, flag for manual review
Multiple Roles at One CompanyPromotions within same companyList as separate experience entries with same company name
Non-Standard DatesApproximate dates like "3 years" or "since 2020"Convert to best estimate: "2020-01 to Present"
Mixed LanguagesCV in French with English job titlesExtract as-is, preserve original language
Very Long CVsAcademic CVs with 20+ publicationsLimit to latest 5 roles, note "additional items omitted"

← Scroll horizontally →

Step 5: Validation and Retry

Building the Validation Pipeline

Catch errors before they reach your database

JSON Parse Check

First, verify the output is valid JSON. If the model included markdown fences or extra text, strip them before parsing.
code
try {
  const data = JSON.parse(response);
} catch (e) {
  // Strip markdown fences and retry parse
  const cleaned = response.replace(/```json?\n?/g, '').replace(/```/g, '');
  const data = JSON.parse(cleaned);
}

💡 Always strip markdown fences, models add them even when told not to.

1/4

Limitations

  1. →No cross-referencing, The extractor trusts what the CV says. It cannot verify employment claims.
  2. →Layout dependent, Heavily formatted CVs (columns, tables, graphics) may lose structure when converted to text.
  3. →Bias risk, AI may assign higher confidence to CVs that match patterns in its training data.
  4. →Privacy, Always send CV data through secure, compliant channels. Never log PII in development.
Click to expand

Test Your Understanding

Question 1 of 5.

CV Extractor Workshop Check

0 / 5 answered

Q1.What is the first step in building a CV extractor?

5 questions remaining

What's Next

You have built a complete structured extraction pipeline! In the next module, you will learn advanced reasoning techniques, Chain-of-Thought and Self-Consistency, to tackle problems that require multi-step logic.


Continue to Chain-of-Thought and Self-Consistency to master AI reasoning patterns.

Go deeper — free guide

Module 2 — Structured Outputs

Learn to get reliable, formatted responses like JSON and tables.

D

Dorian Laurenceau

Full-Stack Developer & Learning Designer

Full-stack web developer and learning designer. I spent 4 years as a freelance full-stack developer and 4 years teaching React, JavaScript, HTML/CSS and WordPress to adult learners. Today I design learning paths in web development and AI, grounded in learning science. I founded learn-prompting.fr to make AI practical and accessible, and built the Bluff app to gamify political transparency.

Prompt EngineeringLLMsFull-Stack DevelopmentLearning DesignReact
Published: March 9, 2026Updated: April 24, 2026

One practical AI workflow in your inbox

Methods, resources and new exercises. Free, unsubscribe at any time.

FAQ

What will I learn in this Structured Outputs guide?+

Hands-on workshop to build a CV/resume data extractor using structured AI outputs. Extract names, skills, and experience into clean JSON with validation and error recovery.