Mistral OCR PDF Extraction for Openclaw

A powerful tool for converting complex PDFs and scanned documents into structured Markdown and JSON using the Mistral OCR API.

tristanmanchester
v1.0.0
Feb 21, 2026
0
1.2k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install extracting-mistral-ocr

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install extracting-mistral-ocr using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Mistral OCR PDF Extraction?

This skill leverages the Mistral OCR API to provide high-fidelity document understanding, capable of processing both digital and scanned PDFs. It is designed to bridge the gap between unstructured documents and LLM-ready data, making it an essential component within the Openclaw Skills ecosystem for developers building RAG systems or document processing pipelines.

By automating the extraction of text, tables, and images, it ensures that your AI agents have access to the full context of any document. The skill handles the complexity of file uploads, API communication, and output organization, providing a developer-friendly interface for document intelligence.

Mistral OCR PDF Extraction Use Cases

  • Converting scanned PDF documents into searchable Markdown for RAG applications.
  • Extracting structured data like invoice totals or contract dates using custom annotation prompts.
  • Parsing complex multi-page reports while preserving table structures and visual elements.
  • Automating document ingestion pipelines that require high-accuracy optical character recognition.

How Mistral OCR PDF Extraction Works

  1. The script identifies the input source, supporting both local file paths and public URLs.
  2. Local files are automatically uploaded to the Mistral Files API to generate a unique file ID for processing.
  3. The OCR request is sent to Mistral with specific configuration parameters for table formatting and image extraction.
  4. The API processes the document and returns a detailed response including page-level markdown, metadata, and optional annotations.
  5. The skill organizes the output into a structured directory containing the full text, individual pages, and any extracted assets.

Mistral OCR PDF Extraction Setup

Ensure you have an active Mistral API key and Python 3.9+ installed with the mistralai package. This tool is a core part of the Openclaw Skills collection.

# Set your environment variable
export MISTRAL_API_KEY='your_api_key_here'

# Run the extraction script
python scripts/mistral_ocr_extract.py --input path/to/file.pdf --out out/ocr

Mistral OCR PDF Extraction Data Schema & Taxonomy

The skill generates a deterministic output folder with the following structure to ensure compatibility with downstream Openclaw Skills:

File/Folder Description
combined.md The entire document concatenated into a single Markdown file.
pages/ Individual Markdown files for each page (e.g., page-000.md).
raw_response.json The complete, unedited JSON response from the Mistral OCR API.
images/ Decoded images and diagrams extracted from the PDF if requested.
tables/ Extracted tables saved as separate files if HTML format is requested.

Mistral OCR PDF Extraction Advanced Features

  • Structured Extraction: Pass custom annotation prompts to extract specific JSON fields from the document level.
  • High-Fidelity Tables: Support for HTML table formatting to improve parsing accuracy for complex data sets.
  • Asset Decoding: Automatic handling and decoding of base64-encoded images for visual document context.
  • Selective Processing: Option to process specific page ranges to optimize token usage and processing speed.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*