Back to work

Case study / AGENTIC PIPELINE

SmartIngest

An agentic document-intelligence pipeline that ingests messy documents and returns validated, routed structured data — with guardrails, grounding and an intelligent retry loop.

Python 3.12LangGraphFastAPIGeminiPydanticDockerLangSmith
View on GitHub

Architecture

retry on low confidenceGuardrailsClassifyExtractValidateRoute

How it works

01

Guardrails

Every document is screened first — prompt-injection scanning and PII redaction before anything reaches the model.

02

Classification

The document is classified and routed to the correct extraction schema, so each type is handled by the right rules.

03

Extraction

Gemini produces structured output validated against Pydantic models — typed, predictable data instead of free text.

04

Validation & grounding

Outputs are grounded against the source to catch hallucinations; low-confidence results trigger an automatic retry loop.

05

Routing

Validated data is routed by deterministic YAML rules to its destination, with full LangSmith tracing end-to-end.

Engineering highlights

72 tests with an eval harness wired as a CI gate

Intelligent retry loop triggered on low-confidence extractions

Deterministic YAML routing + full LangSmith tracing

Next project

RecruitRadar