Mistral OCR
Mistral OCR converts PDF documents into Markdown through Mistral's /v1/ocr endpoint. Reaktors use it to extract text from uploaded or linked PDFs so that AI models can process the content. It is an alternative to Document Intelligence; both produce Markdown from a PDF.
You configure Mistral OCR as a Connection of type mistral-ocr under Connections in the sidebar.
API Configuration
Connect to Mistral's OCR service with a Mistral API key.
| Field | Default | Description |
|---|---|---|
| API Key | required | Mistral API key for the OCR service. Create one at console.mistral.ai. |
| Model | mistral-ocr-latest | Mistral OCR model id. |
| Base URL | https://api.mistral.ai | Mistral API base URL. Change only to route through a compatible endpoint. |
Caching
Every PDF is hashed before conversion. If the same document has been converted before, the cached result is returned without a Mistral API call. Caching happens in two layers:
- Database — primary cache, checked first.
- File Cache — gzipped files on disk, used as a fallback when the database cache misses.
Cache Key Prefix
The optional Cache Key Prefix scopes the cache. The prefix is prepended to the document hash, so documents cached under different prefixes are treated as separate entries.
Use cases:
- Set a prefix per organisation or Reaktor to isolate caches.
- Change the prefix (e.g. from
v1tov2) to force re-conversion of all documents without deleting old cache entries. - Leave it empty to use the default (unprefixed) cache shared by all consumers.
File Cache
| Field | Default | Description |
|---|---|---|
| File Cache Directory | uploads/docs/convert-to-markdown | Local directory for storing converted documents as gzipped files. |
| Enable File Cache | On | When enabled, the file cache is checked as a fallback if the database cache misses. |
Timeout
| Field | Default | Description |
|---|---|---|
| Conversion Timeout | 3 min | Maximum wait time for a single PDF conversion. Range: 10 000-600 000 ms. |
Usage in Reaktors
Reference the connection by name in your Reaktor code. The @operaide/document package provides two aktors:
| Aktor | Purpose |
|---|---|
aktorConvertPDFToMarkdownMistral | Convert a single PDF (URL or base64) to Markdown |
aktorConvertMultiplePDFsToMarkdownMistral | Convert multiple PDFs to an array of Markdown strings |
See Using Mistral OCR for the developer guide and examples.