Document Extraction Agent — Stock Statements & Beyond Home - Incentius - Enable Digital Transformation 

[![Logo](/img_astro/incentius-logo.svg)](/)

Solutions

About

[Case Studies](/portfolio/)

[Blogs](/blog-posts/)

[Career](http://aurochs.freshteam.com/jobs)

Open main menu ![Menu icon](/img_astro/menu1.png)  

[Get In Touch](/contact/)

Solutions

 [![](/img_astro/generative-black.svg) ![](/img_astro/brain-green.svg)

Voice AI](/voice-ai/)

 [![](/img_astro/product-development-black.svg) ![](/img_astro/product-development.svg)

Product Development](/product-engineering/)

 [![](/img_astro/generative-black.svg) ![](/img_astro/brain-green.svg)

Generative AI](/generative-ai/)

 [![](/img_astro/data-black.svg) ![](/img_astro/database-green.svg)

Data Engineering](/data-engineering/)

 [![](/img_astro/mvp-black.svg) ![](/img_astro/rocket-green.svg)

Data & Analytics](/data-analytics/)

 [![](/img_astro/cloud-black.svg) ![](/img_astro/computing-green.svg)

DevOps & CloudOps](/devops-and-cloudops/)

About Us

  [![](/img_astro/product-black.svg)  ![](/img_astro/product-green.svg)

About Us](/about-us/)

  [![](/img_astro/team_black.svg)  ![](/img_astro/team_green.svg)

Team](/team/)

Solutions ![](/img_astro/dropdown-arr.svg) 

[

![](/img_astro/generative-black.svg)

Voice AI



](/voice-ai/)[

![](/img_astro/product-development-black.svg)

Product Development



](/product-engineering/)[

![](/img_astro/generative-black.svg)

Generative AI



](/generative-ai/)[

![](/img_astro/data-black.svg)

Data Engineering



](/data-engineering/)[

![](/img_astro/mvp-black.svg)

Data & Analytics



](/data-analytics/)[

![](/img_astro/cloud-black.svg)

DevOps & CloudOps



](/devops-and-cloudops/)

[Blogs](/blog-posts/) About ![](/img_astro/dropdown-arr.svg) 

[

![](/img_astro/product-black.svg)

About Us



](/about-us/)[

![](/img_astro/team_black.svg)

Team



](/team/)

[Case Studies](/portfolio/) [Career](http://aurochs.freshteam.com/jobs)

[Get In Touch](/contact/)

AI Agent

# Document Extraction

## From PDFs and Scans to Structured, Validated Data

Stock statements, invoices, distributor reports, KYC packs — the documents that power your operations rarely arrive as clean data. Our extraction agent reads them the way a careful accountant would, validates against a typed schema, and writes the result straight into your systems.

[Request a Demo](/contact/)

## What This Agent Does

Document understanding is more than OCR. The agent reads layouts, infers field meaning, validates types, and tags low-confidence cells for review — so what reaches your downstream system is reliable.

### Ingest Any PDF

### Schema-Constrained Output

### Header & Line-Item Split

### Validate & Correct

### Async Worker Queue

## Reference Use Case — Stock Statements

Pharma distributors send monthly stock statements as PDFs. Each one has a different layout. Our agent reads them all into one canonical schema — distributor metadata up top, dozens of SKU rows in the body, validated types throughout.

### Distributor Header

Identifying details extracted with the type and format the downstream system expects — not free-text strings.

*   ✓ Name, full address, city, state, pincode
*   ✓ GSTIN (validated format), PAN
*   ✓ Drug License & FSSAI numbers
*   ✓ Contact, email, website
*   ✓ Statement period start & end dates

### Line Items

Every SKU on the statement, parsed into a typed row — quantities as integers, values as floats, units normalised.

*   ✓ Product description & packing unit
*   ✓ Opening, purchase, sale, closing quantities
*   ✓ Opening, purchase, sale, closing values (₹)
*   ✓ Type-checked: integers, floats, dates

## The Pipeline

01

### Upload

PDF arrives via the upload endpoint — UI, email-ingest, or a watched folder. The document gets a record and status of `processing`.

02

### Enqueue

An RQ job is enqueued on a Redis-backed worker queue, so the API stays responsive while heavy extraction runs in the background.

03

### VLM Extraction

A vision-language model runs against the typed Pydantic schema. Output is constrained to the shape your downstream code expects.

04

### Validate

Field types are checked, totals are sanity-checked against line items, and low-confidence cells are flagged for review.

05

### Persist

The structured result is saved alongside the source file, with an audit trail and a status of `processed`.

06

### Review & Edit

A side-by-side viewer lets a human compare the original PDF and the extracted fields, edit anything that needs correcting, and approve.

## Sample Output

What you get back — a clean JSON document validated against the typed schema, ready to load into your warehouse, ERP, or analytics pipeline.

stock\_statement\_oct\_2024.json

```
{
  "distributor_name": "Aarogya Pharma Distributors Pvt. Ltd.",
  "distributor_address_line": "Plot 14, MIDC Industrial Area, Phase II",
  "distributor_city": "Pune",
  "distributor_state": "Maharashtra",
  "distributor_pincode": "411019",
  "distributor_gstin": "27AABCA1234N1Z5",
  "distributor_pan": "AABCA1234N",
  "distributor_dl_no": "20B/MH-PUN/2019",
  "distributor_fssai_no": "11522003000324",
  "start_date": "Oct 2024",
  "end_date": "Oct 2024",
  "items": [
    {
      "product_description": "Paracetamol 500mg Tablets",
      "packing": "STRIP",
      "opening_qty": 1240,
      "opening_value": 18600.00,
      "purchase_qty": 5000,
      "purchase_value": 75000.00,
      "sale_qty": 4820,
      "sale_value": 96400.00,
      "closing_qty": 1420,
      "closing_value": 21300.00
    }
    // ... 187 more rows
  ]
}
```

## Under the Hood

A boring, reliable pipeline — which is exactly what you want when you're processing thousands of documents a month.

### Vision-Language Models

VLM Run for production extraction. Pluggable — we can swap in your preferred VLM provider or run it on-prem.

### FastAPI + Postgres + Redis

A typed API surface, a relational store for documents and extractions, and an RQ-based async worker queue.

### Pydantic-Typed Schemas

Schema-as-code. The same types validate the model output, the API response, and your downstream consumers.

## Where It Fits

### Pharma Distribution

Stock statements, secondary sales reports, distributor returns.

### Finance & AP

Invoice and bill-of-lading capture into your ERP without manual entry.

### KYC & Onboarding

Identity documents, address proofs, and licence packs into structured records.

### Legal & Contracts

Key clause extraction and structured summaries from long-form contracts.

## Explore other AI agents

### Lumière — Restaurant Concierge

### Aria — Real Estate Agent

### Eric — Voice Concierge

### GTM Engine

## We use cookies

We use cookies to improve site. Some cookies are necessary for our website and services to function properly. Other cookies are optional and help personalize your experience, including advertising and analytics.You can consent to all cookies or decline all optional cookies. Without a selection, our default cookie settings will apply.

I agree I decline

[![logo](/img_astro/logo.svg)](/)

Incentius is a technology and professional services company providing analytics, operations and product engineering services.

 [![facebook](/img_astro/facebook.svg)](https://www.facebook.com/Incentius/)[![twitter](/img_astro/twitter.svg) ](https://x.com/incentius/)[![linkedin](/img_astro/linkedin.svg)](https://www.linkedin.com/company/incentius/posts/?feedView=all)

![location](/img_astro/pin.svg)

Office No.201B, 2nd Floor, Beta-1, Giga Space IT Park, Viman Nagar, Pune - 411014, Maharashtra, India

![email](/img_astro/message-icon.svg)

info@incentius.com

![phone](/img_astro/telephone.svg)

+1 (302) 415 3208

![](/img_astro/secure-footer.svg) ![](/img_astro/secure-footer-mobile.svg)

*   Solutions
*   [Voice AI](/voice-ai/)
*   [Generative AI](/generative-ai/)
*   [Data Engineering](/data-engineering/)
*   [Product Development](/product-engineering/)
*   [Data & Analytics](/data-analytics/)
*   [DevOps & CloudOps](/devops-and-cloudops/)
*   [UI/UX Design](/ui-ux-design/)

*   Recent Blog
*   [Medallion Architecture in Practice: Six Layers, One Source of Truth](/blog-posts/medallion-architecture-in-practice-six-layers-one-source-of-truth/)
*   ["Document later" is how teams say "document never"](/blog-posts/document-later-is-how-teams-say-document-never/)
*   [Your Business & AI - What It Actually Means for You](/blog-posts/your-business-ai-what-it-actually-means-for-you/)
*   [How Internal Agent-Built Software Reduced Our SaaS Dependency](/blog-posts/how-internal-agent-built-software-reduced-our-saas-dependency/)
*   [MarkItDown: A Powerful Utility for File Conversion to Markdown](/blog-posts/markitdown-a-powerful-utility-for-file-conversion-to-markdown/)
*   [Python 3.14: A Game-Changing Release for Modern Development](/blog-posts/python-314-a-game-changing-release-for-modern-development/)
*   [Building a RESTful Blog API with Flask and Swagger: A Complete Guide to Streamlined API Development](/blog-posts/building-a-restful-blog-api-with-flask-and-swagger-a-complete-guide-to-streamlined-api-development/)
*   [Tailwind CSS 4.0 vs 3.x: What Changed and How We Implemented It](/blog-posts/tailwind-css-40-vs-3x-what-changed-and-how-we-implemented-it/)
*   [The Future of AI: What to Expect in the Next 5 Years](/blog-posts/the-future-of-ai-what-to-expect-in-the-next-5-years/)

*   Menu
*   [About](/about-us/)
*   [Blog](/blog-posts/)
*   [Career](http://aurochs.freshteam.com/jobs)
*   [Case Studies](/portfolio/)
*   [For Startups](/startups/)
*   [Let's Talk](/contact/)

© Copyright 2025 Incentius

[Request Site](/)  
  
[Terms and Conditions](/)  
  
[Privacy Policy](/privacy-policy/)