Skip to main content
Document Processing

Document Processing with AI

This guide demonstrates how to extract content from documents and process it with Gately AI’s AI models.

Step 1: Upload and Extract Document Content

First, upload your document to extract its content:
The API will return the extracted content:

Step 2: Process with AI Models

Use the extracted content with Gately AI’s AI models:

Working with Large Documents

For large documents, use the embeddings extraction mode:
This returns the document split into chunks:
Process the chunks sequentially or use a RAG pattern:

Using Document Processing Options

Extract Images from Document

OCR Processing for Scanned Documents

Page-Based Processing

Best Practices

File Size

For files approaching the size limit (50MB), compress them before uploading

Image Quality

For OCR, ensure images are at least 300 DPI for optimal text extraction

Chunking

Use embeddings mode for large documents to get proper chunking

Headers & Footers

Use remove_headers=true to clean repeated elements from each page

Handling Specific Document Types

PDFs with Forms

The API will extract form fields and their values.

Presentations

The API preserves slide structure in the extracted content.

Audio Files (Transcription)

Returns the transcribed text from the audio file.