5.7. Generative AI integration
ChronoScan can send the text (and optionally the images) of a document to a generative AI model and get back the data of the document as a JSON structure that is written to the fields and tables of the job. No templates or regular expressions are needed: each field is described in plain language.
What the AI can do
-
Field extraction: header fields and line-item tables (grids) from the description of each field.
-
Classification: decide the document type among the types defined in the job, from a description of each one.
-
Document splitting: find where each document starts in a mixed pile of pages.
-
Validation and normalization: check consistency (for example, sum of lines = total), fix formats and resolve OCR ambiguities.
-
Translation and OCR correction: translate the document text or correct OCR errors, immediately or deferred.
-
Script-assisted requests: a prompt can be run from VBScript for special cases (ChronoDocument.GPTRequest, GeminiRequest).
-
-
Supported providers
-
OpenAI (GPT-4.1 and GPT-5 families, including the mini and nano models). Supports deferred batch processing at a discount.
-
Azure OpenAI: the same models deployed in your own Azure tenant, for customers who need the data to stay in their Azure subscription and region.
-
Google Gemini (Flash, Flash-Lite and Pro models). Good price/quality ratio; also supports deferred batches.
-
DeepSeek: low-cost alternative.
-
Ollama (local): Llama and other open models running on a server of your own. Nothing leaves your network and there is no usage cost, but it needs a suitable GPU and the quality is below that of the large cloud models.
-
Local OpenAI-compatible server (for example LM Studio): any server on your local network exposing the OpenAI API. Local addresses only, no key and no credits; ADVANCED or Enterprise license, enabled on request.
The available models depend on your license and are listed in the configuration window. Models are retired by the providers from time to time; ChronoScan shows an AI Model Deprecation Warning when a configuration uses a model that is about to be withdrawn, so do not hard-code model names in your documentation or scripts.
How it is configured
Each job can have one or more AI configurations (provider + model + prompts + JSON template + field mapping), and each document type can choose which configuration it uses. Configurations can be copied and converted between providers. The main concepts are:
-
System prompt: the instructions for the model. Recommended content: business context, a definition of every field, the expected formats (dates, decimals) and what must not be returned. Do not include examples with real identifiers: the model copies them when the document does not contain them.
-
JSON template (system JSON prompt): the structure the model must return. First-level nodes are fields; an array of objects is a table (grid) and its keys are the columns. A response schema derived from the template avoids truncated or invented JSON.
-
User prompt before/after the document: optional text placed around the document text.
-
Field mapping: which JSON node goes to which field or grid column (by default, the node with the same name as the field).
-
Pages and images: which pages are sent, whether the page images are sent too (vision models), and how long documents are chunked.
-
Conditions: run only for certain masterkeys, document types or field values.
Example prompts for a basic invoice application:
Example prompts for basic invoice processing application. The AI Quick Start Guide (AI panel of the ribbon) walks through the configuration with your own document, and the AI prompts button of the Data Entry tab lets you try sample prompts on the selected document.
Values written by the AI do not overwrite values read from OCR zones or typed by the user; if the AI must take precedence, run it before the field reading stage or disable the zone. The AI can be disabled per document type and per masterkey.
AI Assistants
Per-field AI Assistants match what the AI (or the OCR) has read against a master list (customers, suppliers, items...) using a vector index and a dictionary, and return the canonical value and its code. They are enabled per field in the field properties; the index is rebuilt from the command line with -rebuild_ai_assistant or from a script. The Invoice AI sample job (Sample Jobs button of the Batches panel) shows a complete setup.
How it is paid
-
Your own API key: enter your OpenAI, Azure, Gemini or DeepSeek key in the Program options and pay the provider directly. ChronoScan is not involved in the cost.
-
ChronoScan credits: buy credit packs in the ChronoScan HUB and let ChronoScan handle the provider; no accounts with each provider are needed and the consumption is visible in the HUB (ChronoScan Cr. button of the Help panel). The application warns when the balance is low; without balance the AI and cloud OCR features stop and the rest of the product keeps working.
-
AI Batches (deferred processing): for OpenAI and Gemini, requests can be sent in asynchronous batch mode, resolved by the provider within hours at roughly half the price. The AI Batches panel shows their status and the batch is marked as pending AI until the response arrives. Ideal for night hot folders and archives.
-
AI cost estimation (AI panel of the ribbon): calculates, before processing a batch, how much it will cost per model and per mode (immediate or deferred), and compares models.
Privacy and data flow
What is sent: the OCR text of the document and/or the page images, with the prompt. Never your databases or other batches. Where it goes: directly to the provider with your key, or through the ChronoScan HUB to the provider when credits are used; with Azure OpenAI the data stays in your Azure subscription and region, and with Ollama nothing leaves your network. The paid APIs of OpenAI, Azure and Google do not use API data to train their models, according to their business terms. ChronoScan stores the result (the fields) in your batch; the HUB records consumption metrics and errors, never document content.