Read Document — OCR & Extraction

Extract text from PDFs, images, Office documents, and more — entirely on-device with no uploads. Yukkai reads the document so you don't have to.

What is it?

Read Document is a built-in Yukkai tool that extracts readable text from files you'd normally can't open directly — PDFs, scanned images, screenshots, Office documents (.docx, .xlsx, .pptx), and rich text (.rtf).

It runs entirely on your device using Apple's Vision framework and PDFKit. Nothing is ever uploaded to a server, which means your sensitive documents — invoices, contracts, medical records — stay private.

You can ask Yukkai things like "read this PDF and summarize it" or "extract the total amount from this invoice photo", and it will use the Read Document tool behind the scenes.

How it works

When you ask Yukkai to read a document, here's what happens:

  1. File detection — Yukkai identifies the file type (PDF, image, Office, RTF).
  2. Text extraction — Depending on the format:

  • PDF with embedded text → text is extracted directly via PDFKit.
  • Scanned PDFs or images → Apple Vision performs OCR (Optical Character Recognition) to read text from pixels.
  • Office documents (.docx, .xlsx, .pptx) → structured text is parsed from the file.
  • RTF files → rich text content is extracted.

  1. Output — Yukkai receives the extracted text and can then summarize, translate, answer questions, or store key facts from it.
An extraction-method header is included in the result, so Yukkai knows whether the text came from a digital source or was OCR'd from an image.

How to use it

Just ask Yukkai in natural language — you don't need to invoke the tool manually.

Supported file formats

Format Extensions Method
PDF (digital) .pdf Direct text extraction
PDF (scanned) .pdf On-device OCR
Images .png, .jpg, .jpeg, .heic, .tiff On-device OCR
Word .docx Structured parsing
Excel .xlsx Structured parsing
PowerPoint .pptx Structured parsing
Rich Text .rtf Text extraction

Parameters

Parameter Required Description
file_path Yes Path to the document file
max_chars No Maximum characters to extract (default: 60,000)

Examples

Summarize a PDF report

You: "Summarize the PDF at ~/Documents/quarterly-report.pdf"

Yukkai reads the PDF, extracts the text, and gives you a concise summary.

Extract data from a scanned invoice

You: "Read ~/Downloads/invoice-scan.heic and tell me the total amount and invoice number"

Yukkai uses OCR to read the scanned image, then pulls out the relevant fields.

Read a Word document

You: "What are the key points in ~/Documents/contract.docx?"

Yukkai parses the .docx file and summarizes the main clauses.

Process an Excel spreadsheet

You: "Read ~/Documents/budget.xlsx and list all categories with their totals"

Yukkai extracts the tabular text and organizes the data for you.

Set a character limit

You: "Read the first 10,000 characters of ~/Documents/large-manual.pdf"

This is useful for very long documents when you only need the beginning.

Tips & best practices

Choose the right tool for the job

  • For plain text or code files (.txt, .swift, .json, .md, etc.) — Yukkai uses a lighter file reader instead of Read Document. This is faster and preserves formatting.
  • For PDFs, images, and Office files — Read Document is the right choice because it handles OCR and structured formats.

Image quality matters for OCR

When asking Yukkai to read text from a photo or scan:

  • Good lighting and sharp focus dramatically improve accuracy.
  • Low-resolution or blurry images may produce errors or missing text.
  • HEIC files from your iPhone camera work great since they're high quality.

Mind the limits

  • PDFs are capped at 50 pages. For longer documents, ask Yukkai to read specific page ranges or use the max_chars parameter to get the most relevant portion first.
  • Charts, diagrams, and photos without text are not captured. Read Document extracts text only — it won't describe what an image looks like. If you need visual analysis, ask Yukkai to take a screenshot or use image generation instead.

Privacy is built in

Everything runs on-device. This makes Read Document safe for:

  • Financial documents (invoices, tax forms, bank statements)
  • Legal documents (contracts, NDAs)
  • Medical records
  • Any confidential file you'd rather not upload to a cloud service

Chain with other actions

Once Yukkai has extracted the text, you can ask it to:

  • Summarize the content
  • Translate it to another language
  • Extract specific fields (dates, amounts, names)
  • Store facts in memory for later reference
  • Create tasks based on action items found in the document

Large documents strategy

For very long documents, consider a step-by-step approach:

  1. Ask Yukkai to read the first portion and give you a table of contents or overview.
  2. Then ask it to read specific sections in more detail.
This avoids hitting the 60,000-character default limit and gives you more focused results.