Skip to content

AI classify and extract

Settings, outputs and examples for the AI classify and AI extract steps, and the limits administrators set.

Both steps need an AI connection and something to read: Text, such as OCR text or a template with the file's name, an Image from a Load content step, or both. Add each with Add text input or Add image input. An image needs a model that takes images. Only the text and image you add are sent; nothing else from the file is.

Selecting either step shows a summary in the inspector, such as the connection, model, inputs and categories. Configure step, Edit beside a section, or double-clicking the step opens the larger editor:

  • Configuration: Model (the connection and model side by side), the inputs (What should be classified? or What information should be analyzed?) and the step's task: its categories or its values.
  • Advanced: Additional instructions and Generation settings, then Execution.
  • Outputs and Test.

Model

Choose a Connection, or add one from the same list. Model starts at Connection default, with the model that means underneath, such as llama3.2:latest; choose another to use it for this step only. The information button beside it shows what the model is known to support. When the model can't take something the step needs, such as an image, a warning says so under the picker; when it's unknown, the warning says that instead. Tessra never clears an input because the model changed.

Model checks

Before you test or publish, Tessra checks the model each AI step will use (the one you chose, or the connection's default) against what the step needs: image input when an Image is set, and structured output or JSON mode when Require structured output is on. A step whose connection doesn't offer the kind of model its Method uses can't be published either.

  • When the model is known not to support it, that's an error, and testing and publishing stop until you choose another model or change the step.
  • When it's not known either way, that's a warning. You can still test; Tessra tries the feature and reports what happened. Mark the feature under the connection's model features to settle it.
  • When the connection has no default model and the step names none, that's an error.

The step never switches to another model by itself, and never sends an image you didn't choose.

AI classify

Chooses the best matching category for an image or text. Define the possible categories, and the AI chooses the one that best matches. Categories are possible answers, not folders or tags: the step only answers, and later steps act on the answer.

The categories are a table: Category and What belongs in this category?, such as Fruit and Fruits such as apples and oranges. Add category adds a row, and each row's menu moves it up or down or removes it. Names can't be empty or repeat. When a later step compares against a category you remove, Tessra asks first; it never changes that step for you. Below the table, an illustrative example shows how an answer maps to a category; it isn't a real result.

On the canvas, the step shows its category names, such as Fruit, Vegetable.

AI classify sorting screenshots into Receipts, Code and Chats, with a Switch on its answer.
Connection
connection required
An AI connection. With Decision model, one that offers decision models, such as OpenAI, Vercel AI Gateway, OpenRouter or llama.cpp.
Method
choice
Decision model (new steps) asks a decision model for each category's probability. Language model asks a chat model, which also gives a reason, and works with every connection, including Ollama. Steps saved before this setting existed use Language model. See Decision models and language models.
Categories
list required
Up to 50. Each has a Category name, such as Receipts, and What belongs in this category, a description the model can follow, such as Receipts and invoices from shops or restaurants.Each category also gets an id, made from its name when you add it, such as fruit. Later steps match on the id, and it stays the same when you rename the category, so renaming never breaks them. The editor doesn't show the ids; the Outputs tab shows how to refer to the answer.
Text
text
What to classify. Up to 20,000 characters in the setting; the connection and server limits decide how much is sent.
Image
content
An image to classify: PNG, JPEG or WebP.
Model
text
Empty follows the connection's default model for the method: its default decision model or its default model.
Allow no match when none of the categories fit
boolean
On by default: the model may answer that nothing fits, and matched is false. When off, it must choose a category. A decision model gets an extra option, None of the other categories fits.
Minimum probability
number
Decision models only. When the most likely category is less likely than this, from 0 to 1, the step treats it as no match. Empty accepts any answer.
Additional instructions
text
Under Advanced. Tessra already tells the model how to classify; add guidance only when it needs more, such as how to choose between close categories. It's formatted text, so lists and emphasis reach the model as Markdown.

Produces: category (the id, empty when nothing fits), label, matched, confidence, probabilities, reason and ai (the run record, with method set to decision or language).

  • With a decision model, confidence is the chosen category's probability, probabilities has every category's probability by id (and _none for no match), and reason is empty.
  • With a language model, confidence is the model's own estimate from 0 to 1, not a measured probability, probabilities is empty, and reason is one sentence.

For example, when a decision model picks Receipts, the step returns:

{ "category": "receipts", "label": "Receipts", "matched": true, "confidence": 0.93, "probabilities": { "receipts": 0.93, "screenshots": 0.05, "_none": 0.02 }, "reason": null }

A language model returns a reason instead:

{ "category": "receipts", "label": "Receipts", "matched": true, "confidence": 0.92, "probabilities": null, "reason": "It shows a shop name, items and a total paid." }

A Switch on steps.<id>.category with one case per category id sends each kind of file its own way; its Otherwise port catches the files nothing fits.

AI extract

Reads typed values, such as a receipt's total and date, from an image or text. It only reads them: add a Save file or Set field step to store them.

The values are a table: Value, Type, Required and Description. Add value adds a row; Use existing fields adds one per custom field, with a matching type, ready to write back with Save file. Below the table, an illustrative example shows the shape of the result, such as Total: 48.72.

On the canvas, the step shows its value names, such as Merchant, Total, Purchase date.

Connection
connection required
An AI connection.
Values
list required
Up to 30. Each has a Value name, such as Purchase date, a Type, an optional Description the model can follow, such as The total paid, without the currency, and Required.Each value also gets a key made from its name when you add it, such as purchaseDate. The key names the output, and it stays the same when you rename the value. Values added before names existed show their key as the name.
Text
text
Where to find the values.
Image
content
An image to read the values from, such as a photo of a receipt.
Method
choice
Extraction model (the default for new steps) reads every value in one request, with a confidence for each, and leaves out what the content doesn't state. It needs a connection that offers extraction models. Language model asks a chat model for the values in JSON and works with every AI connection. Steps saved before this setting existed use language models. See Extraction models and language models.
Model
text
Empty follows the connection's default model for the step's method.
Additional instructions
text
Under Advanced. Extra guidance, such as which date to use when there are several. An extraction model gets it with every value's description. It's formatted text, so lists and emphasis reach the model as Markdown.

The types are Text, Number, Whole number, Yes or no, Date (YYYY-MM-DD) and List of text.

Produces: one output per value, named by its key, plus missing (the keys that weren't found), confidence (each value's confidence by key, from 0 to 1, from an extraction model; empty for a language model) and ai. The keys missing, confidence and ai can't be used.

An extraction model reads dates written without a year against the day the step runs.

The model is told to leave out what it can't find instead of guessing, and Tessra never fills a value in: an empty answer, or a date that isn't a real YYYY-MM-DD date, counts as not found. A value that isn't found is empty and listed in missing. When it's Required, the step fails with ai_required_missing instead, so the run stops before later steps use a gap.

Generation settings

These are under Generation settings on the Advanced tab. Empty settings show Use connection default. Decision and extraction models take only Max input characters and When text is too long:

Setting
TemperatureFrom 0 to 2. Empty uses the connection's setting. Left out for models that don't take it, which the run notes.
Max output tokensThe longest answer. Empty uses the connection's setting, then 1,024.
Max input charactersThe most text to send. Empty uses the connection's setting, then the server's limit.
When text is too longFail the step (the default) stops with ai_input_too_large. Send only the start sends only the first characters and records inputTruncated in the run.
Require structured outputFail when the model is known not to support structured output, instead of checking a looser answer. See How answers are checked.

Server limits

Administrators set upper bounds under Tessra:Plugins:tessra.ai in the server configuration, for example with the environment variable Tessra__Plugins__tessra.ai__MaxOutputTokens=8192. A step or connection asking for more fails with ai_limit_exceeded.

SettingDefaultControls
MaxOutputTokens4096The most output tokens any request may ask for
MaxInputCharacters16000The most text characters any request may send
MaxImageBytes10 MiBThe largest image a step may send
DefaultOutputTokens1024Output tokens when neither the step nor the connection sets them

Errors

CodeMeans
ai_model_missingNeither the step nor the connection names a model. For decision and extraction steps, the connection's default model for that kind counts.
ai_model_wrong_kindThe step uses a decision or extraction model, but the connection's model list says the chosen model is another kind. Nothing was sent.
ai_model_unavailableThe provider doesn't know the model (404). Check its name in the model picker.
ai_model_missing_featureThe model is known not to support something the step needs, such as images or, with Require structured output, structured output. Nothing was sent.
ai_input_too_largeThe text is over the step's, connection's or server's character limit, or the image is over the size limit.
ai_input_unsupportedThe image isn't PNG, JPEG or WebP.
ai_limit_exceededA setting asks for more than the server allows.
ai_invalid_outputThe answer didn't fit the expected shape, twice.
ai_output_truncatedThe answer hit the output token limit. Raise Max output tokens.
ai_refusedThe model or the provider's filter refused to answer, or a decision model declined the question. The run shows its explanation when there is one.
input_invalidA decision step sent an image through the System One API, which takes text only, or an extract step sent more than 4 images to an extraction model, or an image OpenRouter doesn't take (only PNG, JPEG and WebP).
ai_required_missingA required value wasn't found.

Connection problems use the usual codes, such as connection_auth_failed and provider_throttled; see Errors in runs.