AISI — extraction, OCR and summaries
This page covers what AISI does with a file once a sync has selected it: which file types it reads and how, the limits it enforces, the Markdown it writes into the index, how scanned pages and images are recognized, how summaries, titles and document metadata are produced, what model spending costs and how it is capped, and which setting changes process documents again. What each failure means and what to do about it is in AISI — operations; roles, quarantine and audit are in AISI — security and governance.
1. Supported file types
AISI decides a file's type from its bytes, never from its extension alone. The extension must agree with the
bytes: a file whose contents are not what its name claims is skipped as TYPE_MISMATCH, rather than handed to the
wrong reader.
| Type | Extensions | How its text is read |
|---|---|---|
.pdf |
the text layer, page by page, in reading order. Two-column pages are read column by column | |
| Word | .docx |
paragraphs, headings, lists and tables of the document body |
| Excel | .xlsx |
every visible worksheet, as a table |
| Plain text | .txt, .text, .log |
as it is |
| Markdown | .md, .markdown |
as it is |
| CSV | .csv |
as a table |
| Images | .jpg, .jpeg, .png, .bmp, .tif, .tiff |
only through OCR (section 5). A multi-page TIFF is read whole |
- Text encodings. A byte-order mark decides first, then UTF-8, then Windows-1252. Files saved by older Windows tools therefore keep their accented characters.
- Google Docs and Sheets are exported by Google Drive as
.docxand.xlsx, and AISI reads the export. They appear with that extension added to their name, so a sync's File types filter sees them as Word and Excel files. A document Google refuses to export is skipped asEXPORT_TOO_LARGE. - Not supported: presentations (
.pptx,.ppt, and Google Slides), legacy Word and Excel files (.doc,.xls) and every macro-enabled Office format (.docm,.dotm,.xlsm,.pptm). Google forms, drawings and the other native Google types are not offered at all.
A file of an unsupported type is never selected. It does not appear in Documents as skipped: a sync simply does not see it. A sync's File types list narrows the supported types further; left empty, it means every supported type. The Portal refuses an extension AISI cannot read.
2. Limits
Each limit bounds memory, time or decompression that a file could otherwise force on the worker. A file that exceeds one is never indexed in part: it is Skipped, and the message in Documents names the limit.
| Limit | Value | Classification |
|---|---|---|
| File size | 1 GB (AISI__PROCESSING__MAXFILESIZEBYTES), or less with the sync's Largest file (MB) |
TOO_LARGE |
| Extracted text | 20,000,000 characters per document | TOO_LARGE |
| PDF pages | 5,000 | TOO_LARGE |
| Image size | 100,000,000 pixels, read from the image header before anything is decoded | TOO_LARGE; a page image in a PDF, OCR_INCOMPLETE — see section 5 |
| TIFF pages | 500 | TOO_LARGE |
| Spreadsheet cells | 2,000,000 per workbook | TOO_LARGE |
| Office package | 4,096 entries, 1 GB uncompressed, a compression ratio of 100 | MALFORMED_DOCUMENT |
| OCR pages | 1,000 per document (AISI__OCR__MAXPAGESPERDOCUMENT) |
OCR_INCOMPLETE — see section 5 |
| Time | 15 minutes per document, end to end (AISI__PROCESSING__DOCUMENTTIMEOUT) |
TIMEOUT, retried |
- The sync's size cap filters. A file larger than the sync's Largest file (MB) is not selected, like a file of
an unsupported type. A file larger than the deployment's ceiling, on a sync with no cap of its own, is fetched up to
the ceiling and then skipped as
TOO_LARGE. - A document is also limited by its index. When its text needs more parts than the index allows, it is skipped as
TOO_MANY_PARTS, never indexed in part. The part ceiling is set under Splitting on the index.
3. What is skipped, and why
| Classification | The file |
|---|---|
UNSUPPORTED_FORMAT |
has a type AISI does not read. Rare: unsupported types are not normally selected |
TYPE_MISMATCH |
contains something other than its extension claims, such as an Excel workbook renamed .docx |
ENCRYPTED_DOCUMENT |
is a password-protected PDF, Word (DOCX) or Excel (XLSX) file |
MALFORMED_DOCUMENT |
is corrupt, cannot be parsed, or breaches an Office package limit |
TOO_LARGE |
exceeds a limit in section 2 |
TOO_MANY_PARTS |
needs more parts than its index allows |
EMPTY_DOCUMENT |
holds no text: an empty file, or a scan in which OCR recognized nothing |
OCR_REQUIRED_BUT_DISABLED |
is an image, or a PDF with no text layer, on an index with OCR Off |
OCR_INCOMPLETE |
has more pages needing OCR than the OCR page budget, or a page image over the pixel limit. It is never indexed without those pages; the message names the limit and the pages |
EXPORT_TOO_LARGE |
is a Google document over Google's export limit |
These are content failures: retrying the same file cannot help, so AISI does not retry it. The document is tried again when the file changes, or when someone with AISI Operate chooses Retry document in Documents.
- A partly scanned PDF on an index with OCR Off is indexed with the text its other pages carry. Only a PDF with no text at all is skipped.
What to do about each classification is in AISI — operations.
4. The Markdown the index stores
Every file becomes Markdown, whatever its type. Markdown keeps the structure a search and a reader need, and the splitter cuts long documents along it: at a heading, a page or a paragraph rather than at an arbitrary character.
| Type | What the Markdown keeps |
|---|---|
| headings, recognized by text markedly larger than the body; paragraphs, with words hyphenated across a line rejoined; a boundary at every page | |
| Word | headings from the heading styles (localized style names included); bulleted lists as - and numbered lists as 1.; tables as Markdown tables |
| Excel | one ## Sheet: <name> section per visible sheet, its used range as a table. The first non-empty row is the header. A formula contributes its last calculated value, and a date is written as an ISO date |
| CSV | one table, with the delimiter detected from the first line |
| Markdown | its own syntax and headings |
| Plain text | its paragraphs |
| Images | the text OCR recognized |
Left out on purpose:
- Word headers and footers, comments, footnotes, deleted revisions and field codes;
- hidden Excel worksheets;
- anything a file refers to outside itself: remote resources are never fetched.
Normalized: Unicode composed form (NFC), control characters other than tab and newline removed, runs of whitespace collapsed and line endings made consistent.
When a table is split across parts, its header row is repeated on each part, so a part from row 40,000 still says what its columns are.
Titles. Every document gets a title, from the first source that yields a usable one. Documents shows which:
| Source | Shown as |
|---|---|
the file's own title property, unless it is a placeholder such as Untitled or the file name |
from the file's metadata |
| the document's first heading | from its first heading |
| a title generated by the model (section 7) | generated |
| the file name without its extension | from the file name |
5. Text recognition (OCR)
OCR is set per index on the Processing tab of the index's page → Text recognition (OCR), or in the OCR & titles step of Create an index. A new index starts at When a page has no text, with Tesseract and English: scans and images are recognized on the worker, a document with a text layer is never recognized, and no model is called. Choose Off to skip scans instead.
| Setting | What is recognized |
|---|---|
| Off | nothing. An image, or a PDF with no text layer, is skipped as OCR_REQUIRED_BUT_DISABLED |
| When a page has no text | every image file, and every PDF page that carries an image and fewer than 16 characters of text (AISI__OCR__MINTEXTCHARSPERPAGE) |
| Always | every image file, and every PDF page whose largest image covers at least half of the page, even when it has a text layer. Slower; for archives of scans whose text layers are unreliable |
On a PDF page, the largest embedded image is recognized: a scanned page is almost always one full-page image. AISI does not render pages. Recognized text replaces the page's text layer, which is why Always leaves a typed page alone when its only image is a logo, a signature or a figure: recognizing a header logo would otherwise index the page as the logo's words. A page whose text is drawn as vector shapes, with neither a text layer nor an image, cannot be recognized and contributes nothing.
Engines
OCR engines chooses one engine or a chain of two:
| Option | Means |
|---|---|
| Tesseract | runs on the Jobs Worker. No model cost. Reads JPEG, PNG, BMP and TIFF, except run-length-compressed BMP files |
| Vision model | sends each page image to a model. Better on handwriting and complex layouts; costs tokens. JPEG and PNG pages of at most 20 MB only |
| Tesseract, then a vision model | the vision model reads only what Tesseract could not |
| A vision model, then Tesseract | Tesseract reads only what the vision model could not, or could not take |
- Tesseract is installed in the Jobs Worker image with English (
eng), German (deu), French (fra), Italian (ita), Spanish (spa), Portuguese (por), Dutch (nld), Polish (pol), Czech (ces) and Russian (rus), all allowed out of the box. OCR languages lists the languages this deployment allows: choose one and select Add, at most 16 per index. A saved language the deployment no longer allows stays listed, marked not available in this deployment, so you can remove it. Another language must be installed in a derived worker image (tesseract-ocr-<code>) and allowed inAISI__OCR__TESSERACT__ALLOWEDLANGUAGES__0,__1and so on, on both the Portal API and the Jobs Worker. A configured list replaces the shipped one rather than adding to it, so name every language you want, the shipped ones included; configuring a shorter list is also how a deployment narrows it. Each page may take at most 1 minute (AISI__OCR__TESSERACT__PAGETIMEOUT), and words recognized below a confidence of 40 are dropped (AISI__OCR__TESSERACT__MINCONFIDENCE). - The vision model is chosen under Vision model. Only model profiles that declare Images among their Input modalities under AI Settings are offered, and there is no "use default": the tenant's default model may not read images. Its tokens are charged to the index (section 8).
- Turning an engine off for the deployment.
AISI__OCR__TESSERACT__ENABLEDandAISI__OCR__LLMVISION__ENABLEDremove an engine from every chain. The Portal then refuses to save an index that names it.
When an engine cannot help
- An engine that cannot take a page (a format, a size, a missing language) is passed over. One that recognizes nothing hands the page to the next engine.
- An engine that cannot run (Tesseract missing, the model unreachable, a page timing out) hands the page over too.
When every engine that took the page failed to run, the document fails as
OCR_ENGINE_UNAVAILABLEand is retried: indexing it without that page would publish an incomplete document with nothing to say so. - A page that no engine recognized keeps whatever thin text layer it has. An image in which nothing was recognized is
skipped as
EMPTY_DOCUMENT. - A PDF with more pages needing OCR than the 1,000-page OCR budget, or with a page image over the pixel limit, is
not indexed: indexing it would publish it without those pages. It is skipped as
OCR_INCOMPLETE, and Documents shows the reason -- how many pages, which ones, and the setting that limits them (AISI__OCR__MAXPAGESPERDOCUMENTorAISI__EXTRACTION__MAXIMAGEPIXELS). Raise the limit, then choose Retry document, or filter Documents onOCR_INCOMPLETEand choose Retry all shown. The pages already recognized are kept, so the retry pays only for the rest. If every page needing OCR is over the pixel limit and the PDF has no text of its own, it is skipped asTOO_LARGE.
Recognized pages are kept until the document is indexed. A worker that stops on page 280 of 300 resumes at page 280 on the next attempt, and pays for nothing twice. Changing the engines, the languages or the vision model recognizes every page again. Pages left behind are pruned after 7 days (see retention).
Recognized text is not trusted: it is scanned with the rest of the document (section 9).
6. Indexing modes
Indexing mode decides what is written for each document. A new index starts with Full content.
| Mode | What is indexed | Parts per document | Model |
|---|---|---|---|
| Full content | the document's text, split only as far as the destination needs | one or more | none |
| Summary only | a summary of the document; its text is not searchable | exactly one | one summary per document |
| Summary and content | the text, split as needed, with the summary added to every part, so a search can match either | one or more | one summary per document |
How a document is split into parts, and what each destination can hold in one part, is set under Splitting on the index.
7. Summaries
An index in Summary only or Summary and content summarizes each document after it has been extracted and scanned.
| Setting | Means | New index |
|---|---|---|
| Summary model | the model profile that writes the summaries. Left empty: the tenant's default model | — |
| Summary length (characters) | the length asked for. At most 4,000 (AISI__SUMMARIZATION__MAXTARGETCHARS); the field shows this deployment's ceiling and refuses more |
1,500 |
| Summary language | a language code, or auto to write each summary in its document's language |
auto |
| When a summary fails | Index without the summary or Wait for the summary (section 8) | Index without the summary |
| Daily token budget | see section 8 | no limit |
The Portal refuses to save summary settings when the tenant has no model it can use: the summary model must be one of the tenant's model profiles, or the tenant must have a default model.
How a document is summarized
- A document of up to 48,000 characters (
AISI__SUMMARIZATION__MAXINPUTCHARSPERCALL) is summarized in one call. - A longer document is split along its structure into sections of that size. Each section is summarized, and the section summaries are combined into one. Each section summary is kept as it is produced, so a retry, or tomorrow's budget, pays only for the sections left.
- More than 64 sections (
AISI__SUMMARIZATION__MAXSECTIONSPERDOCUMENT): the sections that open a heading are kept first, then an even spread of the rest. The summary's coverage is then Partial, on the document in Documents and on every part in the index, so a reader can tell. Otherwise it is Full. - One model call may take at most 2 minutes (
AISI__SUMMARIZATION__CALLTIMEOUT).
What is accepted
The document's text is sent to the model as data, fenced off from the instructions. The model is asked for a summary
of the requested length at temperature 0. A summary is refused as SUMMARY_INVALID, and the document retried, when
it:
- is empty;
- is more than one and a half times the length asked for;
- contains the fence markers;
- matches a prompt-injection pattern.
An answer that cannot be read is asked for once more, when the call's time allows it.
Summarized once
Summaries are cached for the whole tenant, by the file's content and everything that shapes the answer: the model profile, the length, the language and whether a title was asked for. For a document OCR read, the OCR settings are part of that too, so changing the OCR engines, languages or vision model summarizes it again from the new recognition; a document with its own text keeps its summary. The same file in two folders, or in two indexes with the same summary settings, is summarized once. A cached summary costs nothing. Cached summaries unused for 180 days are pruned.
Generated titles
Generate a title when the document has none asks the model for a title when the document's title would otherwise be its file name. The title rides in the summary call, or in the metadata classification call, so it never adds a model call of its own. It can therefore be switched on only on an index that summarizes or classifies documents into metadata fields.
A generated title that is missing, longer than Longest title (characters) (160 on a new index), more than one line,
or flagged by the prompt-injection scan is dropped. The file name stands, and the document's history records
TITLE_GENERATION_SKIPPED with the reason. A title never fails or delays a document.
Document metadata
An index can also declare up to 32 metadata fields on the Metadata tab of the index's page → Classify documents into these fields: text, choice, number, date or yes/no values that a model fills in from each document, and that ESRA can filter on.
- On an index that summarizes, the fields ride in the summary call.
- On an index that does not, one classification call reads an excerpt of the document, of at most 16,000 characters. The Classification model answers; left empty, the summary model, else the tenant's default.
- A value that does not fit its field, or that matches a prompt-injection pattern, is left empty. The document's
history records
METADATA_VALUE_REJECTEDwith the field names, never the values. - Metadata never fails or delays a document. When the model cannot answer, the document is indexed without
metadata (
METADATA_SKIPPED) and the call is tried again later, as a deferred summary is. - Each field is a column in the destination. Adding a field adds its column. On an index whose objects a DBA creates, the index waits in Awaiting schema until the DBA has run its schema script again (objects a DBA creates).
- Removing a field never drops its column. The column and the values already written stay in the destination (on Elasticsearch and MongoDB, the field and its values), unused: AISI no longer writes or reads them. A field that an ESRA source binds cannot be removed until the ESRA field is bound elsewhere.
- Adding back a field of the same name reuses its column only when it holds the same kind of value (text and choice count as one), a text is no longer than before, and no fill value is given. Its old values then reappear until Reclassify documents overwrites them. Otherwise the save is refused, naming the column: choose another name.
- A choice field's allowed values reach ESRA. An ESRA source created from the index lists them on the field bound to
the choice column, read-only, and tells callers and its planning model every one of them, so a filter names a value
the documents can hold. After changing the list, apply Update from AISI on the source: until then it shows
AISI_SCHEMA_DRIFT(ESRA data sources).
Reclassify documents
After adding a metadata field, or changing one's instructions, allowed values or length, choose Reclassify documents on the index's summary panel or its page (AISI Manage configuration), or open the index's Reclassify tab, to give the documents already indexed values under the new definition. It is offered on a Ready index that extracts metadata, and disabled with the reason on any other.
- Fields. Each field shows how many documents it is stale on: they have no value from its current definition. The stale fields are selected for you. Only the chosen fields' values change; every other field keeps its value. A protected field is marked: a new value can change who sees a document through ESRA.
- Classify from (an index that summarizes): the stored summary — nothing is fetched or read again, OCR included, and the input is small, but a summary may leave out exact facts — or the document, fetched and read again. A number or date field selects the document; keeping the summary for one shows a warning. An index that does not summarize always classifies from the document. A document that has no summary yet is classified from the document.
- Documents: those where a chosen field is stale (the default), or every indexed document. The tab shows how many documents will be queued.
Each document costs one classification call (the metadata purpose of the token budget). Its summary is never
regenerated. A document whose file changed since it was indexed is indexed in full instead, which extracts every field.
A failure never touches the document: it keeps its values and keeps serving, the call is retried as other model calls
are, and after the last attempt it is given up for the run, its fields still stale for the next one.
One reclassification runs at a time per index. While it runs, the Reclassify tab shows its progress and Cancel
reclassification; the documents already done keep their new values. Changing a chosen field while it runs makes the
documents not yet done skip that field: reclassify again under the new definition. The document's history records
RECLASSIFIED with the field names and the source, never the values.
8. Model spending and the daily token budget
Every model call is accounted to its index, by purpose: summary, metadata and ocr. AISI → Overview shows the
day's total under Model tokens today, and the aisi_llm_tokens_total metric carries it by tenant and purpose.
Daily token budget caps an index's model tokens per UTC day. Left empty, there is no cap.
- It is checked before every model call -- every summary and classification call, and every page sent to the vision model for OCR -- not only the first, so a long document stops at the budget rather than past it. Its finished section summaries and recognized pages are kept, and the next budget day resumes from them.
- It counts every purpose: summaries, metadata and vision OCR. A document whose scanned pages need the vision model once the budget is spent is Awaiting budget; it is never indexed without those pages. Tesseract spends no tokens and is never stopped by the budget.
- An exhausted budget is not a failure. It never uses up a document's attempts.
What happens to a document when its summary cannot be produced now, because the budget is spent or the model is unavailable:
| Index | The document |
|---|---|
| Summary only | is not indexed. With the budget spent, it is Awaiting budget until the next UTC midnight. With the model unavailable (LLM_UNAVAILABLE), it fails and is retried |
| Summary and content, Wait for the summary | as Summary only |
| Summary and content, Index without the summary | is indexed now without its summary and stays Indexed. Documents shows the summary as Pending, with its next attempt: after the retry delay, or at the next budget day. After 5 attempts (AISI__PROCESSING__MAXATTEMPTS) the backfill gives up; the document stays indexed without a summary, and Reindex documents tries again |
A document that needs only metadata classification is never held for the budget: it is indexed without metadata and classified later.
9. Prompt injection and quarantine
A document's text can contain instructions addressed to a language model. AISI scans the whole extracted Markdown, OCR included, before anything is summarized or indexed.
- A finding quarantines the document. It is Quarantined, classified
PROMPT_INJECTION_DETECTED, and nothing of it is indexed or summarized. - Release from quarantine (AISI Operate) indexes it anyway. The release covers that content only: a changed file is scanned and judged again.
- Model output is scanned too. A summary that matches is refused; a generated title or a metadata value that matches is dropped.
The record keeps the names and positions of the patterns found, never the text. See content held for review.
10. Changing settings later
Changing an index's settings on the Processing tab of its page needs AISI Manage configuration. Saving them queues, at once, exactly the documents that were processed under different settings. The index keeps serving the current parts while they are processed again.
| Setting | Effect on indexed documents |
|---|---|
| Indexing mode, Summary model, Summary length, Summary language | processed again |
| Text recognition (OCR), OCR engines, OCR languages, Vision model | processed again; pages are recognized again |
| Splitting, Part size override, Most parts per document | processed again |
| Generate a title when the document has none, switched on | only documents titled from their file name are processed again |
| Daily token budget, When a summary fails, Longest title | none; applies to documents processed from now on |
| Metadata fields | none; new and changed documents use the new definitions — Reclassify documents for the rest |
Processing again costs what the change needs. A document is fetched and extracted again. Its summary comes from the cache when the summary settings it depends on did not change.
Reindex documents, on the index's summary panel or its page (AISI Manage configuration), queues documents by hand:
- Documents processed under different settings. — catches up on anything a settings change left queued or failed;
- Every document. — after a change on the destination's side that AISI cannot see.
To give documents new metadata values without processing them again, use Reclassify documents.
A file whose content has not changed, processed under the same settings, is never extracted or summarized again: only its metadata, such as its name or path, is rewritten.