# Quinto Trade Document Validation

> Automate OCR extraction and cross-document validation for international trade documents in FastAPI.

Quinto Trade Document Validation is a free AI agent skill on Agensi by Rajasekhar Vedula, in APIs & Backend. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Rajasekhar Vedula](https://www.agensi.io/creators/rajasekhar-vedula)
- Category: [APIs & Backend](https://www.agensi.io/skills/apis-backend)
- Version: 1.0
- Last updated: 2026-11-28
- Security: scan passed (2026-11-28); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/quinto-trade-document-validation
- Tags: api, fastapi, ocr, trade-finance, python

## About this skill

Inconsistent data across shipping manifests, bills of lading, and invoices creates massive bottlenecks in trade finance. This skill extends or repairs the Quinto FastAPI pipeline to automate OCR extraction and cross-document validation for international trade paperwork.

### What it does
- **Document classification** defines and extracts specific `DocumentType` values from raw PDF scans.
- **Cross-document validation** checks extracted fields against a Master Registry to find discrepancies between related documents.
- **OCR-tolerant extraction** utilizes Tesseract and Poppler with specific keyword normalization for noisy scans.
- **Semantic review** implements Gemini for text-heavy comparisons like addresses, ports, and entity names.
- **Deterministic checking** maintains local logic for quantities, weights, and HS codes to ensure reliability.
- **Report generation** flattens extraction results and validation issues into UI-ready API responses.

### How it works
1. **Define extraction logic** in `extractor.py` to handle new document types or OCR-tolerant labels.
2. **Map labels** in `main_input.py` to ensure the extractor output aligns with validation requirements.
3. **Configure the Registry** in `field_checker.py` to set the rules for cross-document field comparisons.
4. **Update the UI contract** to reflect new report keys or validation categories in the web frontend.

### Frameworks & tools
Built for FastAPI backends using Poppler, pdf2image, and Tesseract for the OCR layer. It uses Google Gemini for LLM-based semantic validation and pytest for integration coverage.

### Why this beats prompting it yourself
Generic prompts fail to maintain the strict document-to-registry mapping required for trade compliance. This skill ensures changes are applied across all layers, from extraction enums to validation aliases, preventing breaking changes in the reporting schema.

### Use cases
- Add a new trade document type like a Certificate of Origin to the pipeline.
- Implement specialized validation rules for HS code consistency across an invoice and packing list.
- Repair OCR extraction failures for specific shipping line document formats.
- Integrate Gemini for smarter address matching between different document issuers.

### Known limitations
OCR integration tests require Tesseract and Poppler to be installed on the host system. Gemini validation requires environment-configured credentials and falls back to local logic if unavailable.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Quinto Trade Document Validation skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What specific problem does the Quinto Trade Document Validation skill solve for logistics teams?

This skill automates the extraction and cross-referencing of data between trade documents like bills of lading and invoices, identifying discrepancies that usually cause delays in trade finance and customs clearance.

### What are the technical requirements for integrating this skill into my existing AI agent?

The skill is designed specifically for FastAPI-based AI agents and requires Python, Tesseract OCR, and Poppler to be installed on your host system for document processing.

### Can I customize the skill to support unique trade document formats specific to my region?

Yes, the logic is highly modular; you can add new document types like Certificates of Origin or modify validation rules for specific HS codes within the provided script structure.

### What components are included in the package upon purchase?

The purchase includes the core OCR extraction layer, the semantic validation engine powered by Gemini, the deterministic field-checking logic, and a standardized API reporting schema.

### How does this skill handle noisy or low-quality document scans?

It uses a hybrid approach: Tesseract handles the raw text extraction, while Gemini performs semantic reviews for complex fields like varying address formats or entity names that deterministic logic might miss.

### What happens if the Google Gemini API is unavailable during a validation task?

The skill includes built-in fallback logic that reverts to local, deterministic checking if the Gemini API is unreachable, ensuring your trade pipeline doesn't come to a total halt.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
