# Doctr OCR

> Extract text, tables, and formulas from scans and PDFs into Markdown or JSON using local deep-learning OCR.

Doctr OCR is a paid AI agent skill on Agensi by Felix, in Agents & Orchestration. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $9.99 (one-time purchase)
- Creator: [Felix](https://www.agensi.io/creators/felix-doctr-onnxtr)
- Category: [Agents & Orchestration](https://www.agensi.io/skills/agents-orchestration)
- Version: 1.0
- Last updated: 2026-11-29
- Security: scan passed (2026-11-29); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/doctr-ocr
- Tags: ai-agents, python-doctr, pytorch, ocr, document-processing

## About this skill

Extracting text and structured data from low-quality scans or photos shouldn't require a cloud API subscription. This skill provides a high-performance, local deep-learning OCR pipeline to turn image-based PDFs, receipts, and documents into structured Markdown, JSON, or pandas dataframes.

### What it does
- **Multi-stage OCR** uses detection and recognition models to extract text from images and scanned PDFs.
- **Layout analysis** identifies headers, footers, titles, and figures to preserve document structure.
- **Table extraction** converts scanned tables directly into structured grids or pandas dataframes.
- **Formula detection** recognizes LaTeX mathematical expressions within scientific papers or reports.
- **Orientation correction** automatically straightens skewed, sideways, or upside-down pages for better accuracy.
- **Batch processing** handles large folders and long documents using memory-efficient lazy loading.

### How it works
1. **Load documents** using `DocumentFile` to handle mixed inputs like JPGs, PNGs, and PDFs.
2. **Configure predictor** by selecting architectures like `fast_base` for speed or `parseq` for high accuracy.
3. **Execute OCR** on the processed frames to generate a structured `Document` tree.
4. **Export results** into the requested format, such as Markdown for LLMs or JSON for data pipelines.

### Frameworks & tools
Built on `python-doctr` using the PyTorch backend. Integrates with `pypdfium2` for PDF rendering, `pandas` for table management, and `matplotlib` for visualization.

### Why this beats prompting it yourself
Writing reliable OCR glue code involves complex coordinate math, batching logic, and model configuration that defaults to random weights if missed. This skill handles the specific `pretrained=True` requirements, memory-efficient streaming, and reading-order reconstruction that raw prompting often gets wrong.

### Use cases
- Building RAG pipelines by converting image-only PDFs into clean Markdown.
- Extracting line items and totals from scanned invoices into a structured database.
- Digitizing scientific papers while preserving LaTeX formulas and layout regions.
- Automating high-volume document triage with local, GPU-accelerated processing.

### Known limitations
Pretrained models target printed text and struggle with handwriting. The default vocabulary is optimized for English and French, lacking support for non-Latin scripts or certain extended Latin characters.

## Requires

- Python
- Git

## 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 Doctr OCR skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill differ from standard cloud-based OCR APIs?

Unlike cloud-based services, Doctr OCR runs entirely on your local infrastructure using PyTorch, ensuring your sensitive documents never leave your environment while avoiding recurring API costs. It also handles complex layout analysis, such as tables and LaTeX formulas, which basic OCR tools often ignore.

### Are there any specific document types or languages that are not supported?

The skill is optimized for printed text in English and French; it currently does not support handwriting recognition or non-Latin scripts like Cyrillic, Arabic, or Kanji. Performance is best on documents with standard layouts, though it includes orientation correction for skewed scans.

### Can I use the output of this skill directly with an LLM or RAG pipeline?

Yes, the skill is designed to export data in formats like Markdown and JSON that are natively understood by Large Language Models. This makes it an ideal preprocessing tool for RAG (Retrieval-Augmented Generation) pipelines where image-based PDFs need to be converted into searchable, structured text.

### What is included in the purchase of the Doctr OCR skill?

You will receive the complete Python-based skill package, including the pre-configured OCR pipeline, integration logic for PyTorch, and documentation on how to export results into various data formats. The purchase includes the logic needed to handle batch processing and layout reconstruction out of the box.

### Which AI frameworks and environments are compatible with this skill?

This skill is built for Python environments using the PyTorch backend and is compatible with any AI agent framework that supports Python execution. It requires `python-doctr` and `pypdfium2`, and can be easily integrated into custom agentic workflows or automated data pipelines.

---

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.
