Intelligent Document Processing (IDP) - Multi-Agent System

Enterprise-level Multi-Agent Orchestration Framework using LangGraph and Gemini 2.5 Flash to automate data extraction from complex Mutual Fund forms. Features self-correcting agents and confidence-based automation.

Problem

Processing complex financial documents (such as Mutual Fund redemption requests and multi-page TIFFs) was a manual bottleneck. The lack of standardized layouts, presence of handwritten text, and strict compliance requirements made traditional OCR insufficient, resulting in slow turnaround times and high operational costs for manual verification.

Solution

Engineered a Multi-Agent Orchestration Framework using LangGraph to handle the full document lifecycle. The system utilizes a 'Router-Extractor-Auditor' architecture where a Semantic Router classifies documents, a Vision Extractor (Gemini 2.5) pulls structured data, and a Self-Reflective Auditor enforces business logic. If validation fails, the Auditor triggers a feedback loop, prompting the Extractor to self-correct before final output.

Impact

Key features

Tech stack

System architecture

Trust boundary — Runs inside CAMS GCP — Cloud Run. Documents carry PAN numbers, folio numbers and customer signatures, so no production output can be shown publicly. The graph below is the system.

Document intake — The inputs traditional OCR could not handle

↓ Multi-page TIFF / PDF + document metadata

LangGraph state machine — StateGraph(AgentState) — a cyclic graph, not a pipeline

↓ AgentState initialised

Agent 01 · Semantic Router — semantic_router_agent — which AMC, and therefore which schema

↓ AMC identity + AMC-specific field schema

Agent 02 · Vision Extractor — gemini_vision_agent — multimodal, re-entrant

↓ Structured JSON candidate + per-field confidence

↺ Validation failed → re-extract with error context

Agent 03 · Self-Reflective Auditor — business_logic_validator — the reflection step

↓ errors[] · confidence · retries

Conditional edge · check_quality — add_conditional_edges("auditor", …) — three outcomes

↓ Routed to its terminal state

Terminal states — Automated or escalated — never dropped

What this replaced

Control loops

What K Laxman learned

← All 27 projects by K Laxman

Explore more

GitHub · LinkedIn · Email