Hands-on build-along

Build a Contract-Intelligence Pipeline

Build a working contract-intelligence pipeline end to end. Ingest sample contracts, run OCR + open-source LLM extraction, persist to Postgres against a realistic contract data model, build an evaluation harness, expose results via API. ~3 hours start to finish; ~6 chapters of working code at every step.

What you'll build

A minimal but real contract-intelligence pipeline. Drop a PDF in a folder; an ingestion job picks it up, runs OCR, extracts structured fields with an LLM, persists to Postgres with the contract data model, and exposes results via a FastAPI endpoint. An eval harness scores accuracy against a small gold set. Working code; ready to extend.

Prerequisites

Python 3.11+, Docker (for Postgres), an LLM API key (Anthropic Claude or OpenAI — Claude shown by default), familiarity with FastAPI or willingness to read along, and a few sample contracts (5–10 PDFs work; public templates are fine for a first pass).