Documents

Uploading PDFs

How PDF files enter the system and become searchable, citable documents.

Supported files

  • Text-based PDFs and scanned PDFs — both are accepted.
  • Up to 100 pages per document in this OCR pipeline.
  • Research papers, contracts, manuals, financial reports, and other long-form documents.

Every PDF is OCR'd

Unlike many PDF tools, ChatPDF does not read embedded text directly. All uploads — including text-based PDFs — are processed through Mistral OCR 4. This keeps one consistent extraction path for scanned and native PDFs.

Processing states

After upload, a background Convex action runs the full pipeline. The document status moves from uploaded to processing to ready — or failed if it cannot complete.

  1. 01UploadThe file is stored in Convex file storage and connected to a document record.
  2. 02OCRMistral OCR 4 extracts page markdown from the PDF.
  3. 03ChunkText is split into ~450-word chunks with 75-word overlap, keeping page spans for citations.
  4. 04Embed & summarizeChunks are embedded (1536-dim), and per-page plus document summaries are generated.
  5. 05ReadyThe document can be selected for grounded chat and citation lookup.
Rendering diagram…
The full ingestion pipeline, including the retry path. Transient failures retry up to 3 times before the document is marked failed.

Failure handling

Transient errors (timeouts, rate limits, 5xx responses) are retried automatically — up to three attempts with 15s and 60s backoff. Persistent failures stop the pipeline and surface an error on the document.

First places to check

If a document lands in failed, verify service credentials: the Convex deployment, Clerk keys, OpenAI key, and Mistral API key are the most common causes.