Skip to main content
Loading navigation

Automated Document KYC Extraction Pipeline with Vercel AI SDK

Manual processing of unstructured customer onboarding documents slows down digital bank verification workflows. Build an automated KYC document extraction and risk verification engine using Vercel AI SDK and Windsurf, processing identity documents with 99% structured field extraction accuracy.

CybersecurityHosted by Vera

What you are building

Develop a high-throughput TypeScript backend using Vercel AI SDK generateObject and Windsurf development workflows to parse unstructured passport and utility bill documents into validated JSON schemas.

How work is evaluated

Evaluation

Evaluates structured KYC JSON field accuracy extracted from test document images.

Datasets

Public datasets, plus the private datasets you have access to.

How submissions are scored

Dimensions
2 scoring checks
Binary
2 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

Strict Zod Validation

Extracted JSON must fully conform to required Zod schema without extra fields.

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

extraction_accuracy

Exact match rate on identity attributes • target: 0.99 • range: 0.95-1

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

  • Implement structured JSON output generation using Vercel AI SDK and Zod schemas

  • Integrate Windsurf IDE automation rules for rapid schema refactoring and testing

  • Build multi-modal OCR parsing pipelines for identity documents and proof of address

Resources

Dataset notes

Dataset of 1,000 synthetic OCR document texts simulating passports, driver licenses, and utility bills.

Challenge setup

Evaluates structured KYC JSON field accuracy extracted from test document images.

Challenge input

Base64 encoded identity document image or OCR string

AI SDK

Assigned agentic framework for TypeScript/JavaScript.

Windsurf

Assigned AI engineering tooling.

Evaluated output

JSON matching Zod schema: { passportNumber, fullName, expiryDate, mrzValid }

Evaluation checks
  • Extracted JSON must fully conform to required Zod schema without extra fields.
  • Exact match rate on identity attributes • target: 0.99 • range: 0.95-1
Configured evaluation evidence
  • Benchmark: DocExtract-Bench
  • Extraction Accuracy target: 0.99
  • 1 public reference case
Configured runtime
  • JavaScript execution harness
  • javascript sandbox (unavailable on Versalist)

Shows the first task, up to three tools, and up to three evidence items.

View technical recipe

Configured tools

Action Space
  • Vercel AI SDK · Required
  • Windsurf · Optional
Observation
  • Windsurf · Optional
Orchestration
  • Vercel AI SDK · Required

Evaluation contract

  • Strict Zod Validation · Weight 1
  • extraction_accuracy · Weight 1

Metrics

  • extraction_accuracy · Target 0.99

Benchmarks

  • DocExtract-Bench
  • general

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: Base64 encoded identity document image or OCR string

    Output: JSON matching Zod schema: { passportNumber, fullName, expiryDate, mrzValid }

    Execution harness: JavaScript

Evaluation tools

  • AI SDK · Agent & Prompt Orchestration
  • Windsurf · AI Developer Environment

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Automated Document KYC Extraction Pipeline with Vercel AI SDK