Problem
The client needed fields pulled out of packaging-label PDFs in several languages and compared across documents. Doing this by hand was slow and error-prone. A plain LLM prompt was fast but couldn't be trusted, because a single wrong field costs more than a missing one.
Approach
- OCR + LLM extraction into a fixed schema, orchestrated as LangGraph pipelines with tool calls, retries, and fallbacks, so a failing step degrades instead of propagating bad output.
- QA / QC gates apply business-rule checks to every model output. Anything that fails is flagged for review instead of being shipped.
- Evaluation on real data: eval sets built from reviewed production samples, with results measured on held-out documents.
- Observability: every LLM call traced in Langfuse (latency, token cost, output quality). Production traces drove each round of prompt and pipeline changes.
Results
- False positives driven to zero on held-out data.
- Early versions were demoed to the client before the production build, so scope matched what they actually needed.
- Cost and latency visible per call, which made prompt changes a measured decision instead of a guess.