Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
tristanmanchester avatar

Extracting Mistral Ocr

  • 83 installs
  • 3 repo stars
  • Updated June 29, 2026
  • tristanmanchester/agent-skills

Helps with ai & agent building tasks during AI-assisted development.

About

extracting-mistral-ocr is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • extracting-mistral-ocr
  • AI & Agent Building
  • AI-coding skill

Extracting Mistral Ocr by the numbers

  • 83 all-time installs (skills.sh)
  • Ranked #5,135 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/tristanmanchester/agent-skills --skill extracting-mistral-ocr

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs83
repo stars3
Last updatedJune 29, 2026
Repositorytristanmanchester/agent-skills

What it does

Helps with ai & agent building tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

Mistral OCR PDF extraction

Quick start (default)

Run the bundled script to OCR a local PDF and write Markdown + JSON outputs:

python {baseDir}/scripts/mistral_ocr_extract.py --input path/to/file.pdf --out out/ocr

Output directory layout:

  • combined.md (all pages concatenated)
  • pages/page-000.md (per-page markdown)
  • raw_response.json (full OCR response)
  • images/ (decoded embedded images, if requested)
  • tables/ (separate tables, if requested)

Workflow

1. Pick input mode

  • Local PDF (most common): upload via Files API, then OCR via file_id.
  • Public URL: OCR directly via document_url.

2. Choose output fidelity (defaults are safe for RAG)

  • Keep table_format=inline unless the user explicitly wants tables split out.
  • Set --include-image-base64 when the user needs figures/diagrams extracted.
  • Use --extract-header/--extract-footer if header/footer noise hurts downstream search.

3. Run OCR

  • Use scripts/mistral_ocr_extract.py to produce a deterministic on-disk artefact set.

4. (Optional) Structured extraction from the whole document

  • If the user wants fields (invoice totals, contract parties, etc.), provide an annotation prompt.
  • The OCR API can return a document-level document_annotation in addition to page markdown.

Example:

   python {baseDir}/scripts/mistral_ocr_extract.py \
     --input invoice.pdf \
     --out out/invoice \
     --annotation-prompt "Extract supplier_name, invoice_number, invoice_date (ISO-8601), currency, total_amount. Return JSON." \
     --annotation-format json_object

Decision rules

  • If the PDF is local and not publicly accessible, upload it (the script does this automatically).
  • If the PDF URL is private or requires authentication, do not pass it as document_url; upload instead.
  • If output quality is critical, prefer table_format=html for downstream parsing over brittle regex.

Common failure modes

  • Missing `MISTRAL_API_KEY`: set it in the environment before running.
  • URL OCR fails: the URL likely is not publicly accessible; upload the file.
  • Large files: upload supports large files, but very large PDFs may need page selection (--pages) or batch processing.

References

  • API + parameters: references/mistral_ocr_api.md
  • Output mapping rules (placeholders to extracted images/tables): references/output_mapping.md
  • Example annotation prompts for common document types: references/annotation_prompts.md

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.