Coders In Hoods
  • Courses
  • Roles
  • Blog
  • Setup

Coders In Hoods AI Academy

Every course is free. Sign in to start, and your progress, quiz scores and bookmarks follow you.

AI Academy

  • Courses
  • Paths
  • Setup guides
  • How we teach

Role roadmaps

  • AI Engineer
  • Forward Deployed Engineer
  • Machine Learning Engineer
  • All roles

Coders In Hoods

  • The agency
  • Coaching for teams
  • Blog
  • LinkedIn
  • X (Twitter)

Contact

codersinhoods@gmail.com

© Coders In Hoods · since 2019

Course overview

Document Ingestion Pipelines

Free · sign in to start and track progress

1 · Reading real-world documents

  • 1What a real case file contains
  • 2Parsing: text layers to vision models
  • 3Tables, plans and handwriting
  • 4Structured extraction at scale

2 · Running ingest in production

  • 5Durable ingest pipelines

    Exercise answers

    • Answer: Build a crash-safe ingest workflow
    • Answer: Simulate retry granularity
  • 6Re-ingestion, versioning and backfills
  • 7PII detection and redaction
  • 8Ingest evals and the hand-off
CapstoneIngest a case file end to endReference implementation

Module 2 · Running ingest in production · Lesson 5

Durable ingest pipelines

The architecture around the models for long-running ingest jobs - units of work and fan-out per page and document, content-derived idempotency keys, retry classes, poison-document quarantine and progress tracking that stays true under retries.

75 min 1 video 3 exercises 7-question quiz Answers
Setup for the exercises:Install Claude CodePython with uvRun Temporal locally

By the end of this lesson you can

  • Choose the unit of work and retry for each ingest stage, and compute the rework cost of retrying at the wrong granularity
  • Derive idempotency keys from content hashes and stage versions, and make every stage an idempotent upsert
  • Classify ingest failures into transient, deterministic and quality failures, and handle each differently, including poison documents
  • Implement a case ingest as a durable workflow with per-document child workflows and per-page activities in Python
  • Derive progress from artefacts rather than counters, and explain why counters drift

On this page

  • Intuition: the print shop reprints one page
  • Units of work
  • Worked example: retry granularity
  • Idempotency from content
  • Retry classes
  • Poison documents
  • Code: a matter ingest on Temporal
  • Progress that stays true
  • Connections
  • Summary
  • Sources & further reading
  • Quiz

In this lesson

  1. 01Intuition: the print shop reprints one page
  2. 02Units of work
  3. 03Idempotency from content
  4. 04Retry classes
  5. 05Poison documents
  6. 06Code: a matter ingest on Temporal
  7. 07Progress that stays true
  8. 08Connections
  9. 09Summary

Sources & further reading

  • A Fault-Tolerance Shim for Serverless ComputingPaper · Sreekanti, Wu, Chhatrapati, Gonzalez, Hellerstein, Faleiro · UC Berkeley · 2020EuroSys 2020. Why retried functions can leave partial writes visible, and why each step should commit its results atomically. The motivation section applies directly to an ingest stage that writes pages, blocks and records.
  • Serverless Computing: One Step Forward, Two Steps BackPaper · Hellerstein et al. · UC Berkeley · 2018The argument that chains of stateless functions and queues are a poor fit for stateful multi-step work, which is why ingest orchestration belongs in a workflow engine while the per-page leaves can be plain queued tasks.
  • Workflow Execution limits (Temporal docs)Docs · TemporalThe 51,200-event and 50 MB history limits, the warnings at 10,240 events and 10 MB, and the default cap of 2,000 pending activities or child workflows. These numbers decide how you shape fan-out for large documents and backfills.
  • Claude API errorsDocs · AnthropicWhich status codes are transient (429, 500, 529) and which are not (400, 413), the SDK's two automatic retries, and the spend-cap 429 that has no retry-after header and keeps failing. The basis for the retry classes in this lesson.
  • PDF support (Claude API docs)Docs · AnthropicThe page and request-size limits that make some documents fail deterministically on a single request, and the advice to split large PDFs.
Free · sign in to start

Sign in to keep reading.

Free, no card. We use your account to save progress, quiz scores, bookmarks and occasionally send updates from our team.

  • 9 more sections
  • 3 hands-on exercises
  • A 7-question quiz
  • Progress, quiz scores and bookmarks