The AI Assistant links what the AI has read in a document with the right entry of a master list: the supplier of your ERP, the customer, the item code, the cost centre. The AI model returns "Acme Industries S.L." and a tax number; the assistant finds that supplier in the help list of the field and writes its value, the code or the canonical name. When the field is the master key of the job, the document also gets the document type of that supplier (see Understanding Masterkeys).
The matching runs on the station with a local model: nothing is sent outside and no credits are used. Only the reading of the document by the AI model, which happens before, is a call to the AI provider.
What you need
-
An AI configuration in the job (OpenAI, Gemini, Ollama...) that returns the texts to look up, for example the nodes supplier_name and supplier_vat. See AI configurations per job. The assistant searches the answer of the AI: a document without an AI answer gets no candidates.
-
A help list on the field with the valid values, a text list or a list on a database (Using Lists, Value List on Database). The value of each entry is what is written to the field; its description (a name, a tax number, an address) is searched as well. The Intelli-Tags of the field can be used as a second source.
-
The vector index of that list, built once and rebuilt when the list changes.
How it works
-
When a batch is processed, the stage AI_ASSISTANTS runs after the AI model stages (Processing Batches). For every field with the assistant active it takes, from the AI answer of the document, the texts of the nodes selected in the configuration.
-
Each text is searched in the help list by three engines, a literal name comparison, a vector (semantic) search and a word dictionary, and in the Intelli-Tags if they are enabled.
-
Every hit is a candidate: a value of the list with a score from 0 to 1. Each value keeps its best score.
-
If the field is empty and the best candidate reaches the minimum score, its value is written to the field. Otherwise the field is left for the operator, who sees the candidates in the AI Field Assistant window.
-
The readings, the candidates and their scores are saved with the document, so the window shows exactly what the process saw.
Setting it up
-
In the Data entry tab select the field and open its properties (Object Properties Panel). In the group AI assistant set AI Search Active to true.
-
In the same group click the button of AI Search Configuration. The window AI search assistant configuration opens: tick Use helplist value/description, add the AI nodes to search and accept. Open it with a processed document selected, so the lists of engines, prompts and nodes are filled with the ones of that document.
-
In the job configuration (Administration tab, Configure job), section AI Searchs, check the Model for AI-assisted searches. The model installed with ChronoScan is selected by default.
-
Build the index: Check vector index in the configuration window opens AI Searching Maintenance; click Rebuild all Indexes.
-
Process a batch. The fields with the assistant show an assistant button next to their value in the data entry form.
The AI search assistant configuration window of a field.
The AI search assistant configuration window
|
Option
|
Default
|
Description
|
|
Allow user to link AI results with existing values
|
on
|
The operator can link a text read by the AI to a value of the list, from the AI Field Assistant window. Always enabled.
|
|
Allow user to ignore AI results
|
on
|
The operator can mark a text read by the AI as ignored. Always enabled.
|
|
Use configured lookup data
|
on
|
Reserved for the database lookups of the field. It has no effect in this version.
|
|
Use helplist value/description
|
off
|
Searches the help list of the field. Each entry can be found by its value or by its description.
|
|
Use intellitag entries on this field
|
off
|
Also searches the Intelli-Tag entries that fill this field.
|
|
Use a custom database and select statement
|
off
|
Not available in this version.
|
|
Minimum score to set the value automatically
|
0.80
|
From 0.0 (any match) to 1.0 (exact match). The best candidate must reach this score to be written without the operator. Candidates below it are only shown.
|
|
Vector margin over 2nd candidate
|
0.05
|
Only for vector matches: the best candidate must beat the runner-up, a different list entry, by at least this much. 0 disables the rule.
|
|
when score is below
|
0.90
|
The margin is only required when the best score is below this value. From this score up the match is trusted on its own.
|
|
Use selected AI nodes to search matches
|
all
|
The readings of the AI that are searched: rows of Engine, Prompt and Nodes. See below.
|
|
Add row / Delete selection
|
|
Add a row to the list of nodes or delete the selected rows.
|
|
Check vector index
|
|
Opens AI Searching Maintenance to check, test and rebuild the indexes of the job.
|
|
Online help
|
|
Opens this page.
|
The (i) icons next to the margin values show a summary of the margin rule.
Choosing the AI nodes
Each row of the grid selects readings of the AI by three columns: Engine (oai, gemini...), Prompt (the alias of the AI configuration) and Nodes (the node of the JSON answer). Each cell offers the names found in the selected document and accepts either an exact name or a regular expression, which must match the whole name:
|
Value of the cell
|
Matches
|
|
company
|
Only the node company; not company_name.
|
|
company.*
|
Every node whose name starts with company.
|
|
supplier_name|supplier_vat
|
Either of the two nodes.
|
|
lines\[.*\]\.description
|
The node description of every row of the array lines. This is how the list proposes the nodes of an array.
|
|
.* or empty
|
Everything.
|
A reading is used when one of the rows matches its engine, its prompt and its node. Without rows every reading of the document is used, which is rarely wanted: every text is searched and can produce candidates, so select only the nodes that identify the entry, such as the name and the tax number. When two engines return the same text under the same alias and node, it is searched once.
Embedding model and vector index
The vector search compares meanings through an embedding model, a file in GGUF format that turns a text into a vector. It is chosen per job in Model for AI-assisted searches, which lists the models of the folder Bin\ChronoLink\models.gguf of the installation. ChronoScan installs all-MiniLM-L6-v2, small and fast; other embedding models can be copied to that folder. Scores are not comparable between models: some rate two unrelated names of the same kind at 0.75 to 0.80, so after changing the model rebuild the index and review the minimum score and the margin with a few documents.
The index is saved in the folder chronolink\cslinks of the configuration (Where things live), one per help list and job. Each entry is indexed twice, by its value and by its description, and counts with the better of the two. Without an index the vector search returns nothing; the literal and dictionary engines keep working.
Rebuild the index when entries are added or changed in the list and when the model changes:
-
AI Searching Maintenance (button Check vector index): the tree shows the model of the job and the help lists and Intelli-Tag lists of its fields with their number of values. Rebuild all Indexes rebuilds the indexes of the fields that have the assistant active; Rebuild selected Index rebuilds the one selected in the tree; Test selected index asks for a text and shows the closest entries with their scores, useful to try a name before processing.
-
A scheduled task of type Rebuild AI assistant, for lists that change every day (Scheduled tasks).
-
The command line: -rebuild_ai_assistant:"job,type,field", with the name of the job or All, the type All, helplists or intellitags and the name of the field or All (Executing ChronoScan on Command line).
-
A script: ChronoBatch.AI_AssistantRebuild(type, field) (ChronoBatch).
AI Searching Maintenance: the indexes of the job.
Building takes about a hundredth of a second per text on a processor with AVX2, so a list of 5,000 entries with descriptions needs a couple of minutes. On a processor without AVX2, as in some virtual machines, ChronoScan warns and uses a compatibility engine several times slower. The engine works with one processor thread so that it does not compete with the OCR; on a machine dedicated to it the environment variable LEMBED_THREADS (1 to 64) raises the number of threads. Do not set more threads than free processors: it becomes much slower.
Result types
The column Engine of the AI Field Assistant says which engine found each candidate:
|
Type
|
How it matches
|
Score
|
Best for
|
|
helplistExact
|
The text read equals the value or the description of an entry of the list once case, accents, punctuation and the legal form at the end (S.A., S.L., Ltd, GmbH, Inc...) are removed. A text in parentheses at the end of the description is left out.
|
Always 1.00, marked EXACTNAME.
|
Identical names, including short ones such as "IBM" or "PwC" that the other two engines skip, and lists with a code as value and the name as description.
|
|
helplistVec
|
Vector search: the entries whose value or description is closest in meaning and spelling to the text read. The 20 closest are shown.
|
Similarity from 0 to 1.
|
Names written differently from the list: abbreviations, missing words, typing errors, another word order.
|
|
helplistDic
|
Word dictionary: the entries of the list, by value or description, whose words are all in the text read. Case, accents, punctuation and leading zeros are ignored.
|
How much of the text read the entry covers, and in the same order. 1.00 when the text is exactly the entry.
|
Codes and identifiers: tax numbers, customer and supplier codes.
|
|
itag
|
The same vector search on the Intelli-Tag entries of the field; if it finds nothing, a dictionary search of those entries.
|
Similarity from 0 to 1; 1.00 for the dictionary.
|
Values learned through Intelli-Tags.
|
What makes them different in practice:
-
The vector engine is tolerant, the dictionary is literal. The vector search always returns the nearest entries, even when none is the right one, so its scores need a threshold and the margin rule. The dictionary only returns an entry when its words are really in the text.
-
The vector engine skips codes. A text that is mostly digits, that looks like an alphanumeric code or that has fewer than four letters or digits is not sent to it; the dictionary deals with those.
-
The dictionary skips short single words. An entry of one word with fewer than five characters is not in the dictionary, unless it is a number of four or more digits.
-
Numbers adjust the vector score. When the text read contains numbers, as in an address, the candidates with the same numbers gain up to 0.15 and those with other numbers lose up to 0.15.
-
Only vector candidates can be LOWMARGIN. When the best vector score is below 0.90 and leads the runner-up by less than the margin, the vector candidates of that text are shown but not used. This protects names made of generic words, where several entries score almost the same and the closest one is right only by chance.
-
EXACTNAME is above both limits. A helplistExact candidate does not depend on the minimum score or on the margin rule. A vector candidate whose value equals the text read, once case, accents, punctuation and the legal form are removed, also gets 1.00 and is not subject to the margin rule.
-
The literal comparison looks at the value, then at the description. The text read is compared with the value of each entry, then with its whole description, then with the description without the text in parentheses at its end: "Acme Industries" is found in a list whose entry has the value 40012 and the description "Acme Industries S.L. (Northern branch)". The name left before the parentheses needs at least four letters or digits, legal form apart. A match by description counts only when a single value of the list has that name: when two entries with different values share it, as when the same supplier is entered once for each company of a group, the literal comparison does not choose and the other engines decide.
How the value is chosen
-
Each value of the list keeps its best score among all the engines and all the texts read. The candidates marked LOWMARGIN do not count.
-
The highest score wins. With equal scores the value with more evidence wins, for example the one found both by the name and by the tax number.
-
The value is written if the score reaches Minimum score to set the value automatically and the field is empty: a value read from a zone, typed by the operator or set by a script is never replaced.
-
When the field is the master key, the master key of the document is set and the document type detection runs again for that document.
A rule made by the operator that links a text to a value (SETKEY, see below) comes before the scores: if the AI reads that text, that value is assigned. When the texts of one document have rules that point to different values, nothing is assigned.
Example: the list has the entry ACME INDUSTRIES with the description B12345678, and the AI reads the name "Acme Industries, S.L." and the tax number "B12345678". The name is an EXACTNAME match (1.00) and the tax number a dictionary match on the description (1.00): the value ACME INDUSTRIES is written. If the AI had read "Acme Ind." instead, only the vector engine would propose the entry, with a score such as 0.86, and it would be written only if no other supplier scored above 0.81.
The AI Field Assistant window
In the data entry form (Form View) the fields with the assistant have an assistant button next to their value. It opens the window AI Field Assistant for the selected document:
The AI Field Assistant: the texts read by the AI, the value of the field and the candidates.
-
Text found by the AI: one row per reading used, with the Prompt, the Node, the Extracted text and the rule of that text, if any (RuleAction and SetKey).
-
The value of the field: the current value or, when the field is empty, the candidate the process would choose. The ... button opens the help list to pick any value.
-
Similar matches: the candidates, sorted by score. The columns are the Engine, the text searched (Searching), the value of the list and its description (Found as), the Score, the Threshold, RuleAction (EXACTNAME or LOWMARGIN) and Margin. Margin shows, for the best vector candidate, its lead over the runner-up and the lead required, as in 0.11/0.05. The rows discarded by the margin rule have the score in orange. Clicking a row copies its value to the value of the field.
-
OK writes the value to the field, or sets the master key; Refresh repeats the search.
The RuleAction cell of a text read by the AI creates a rule for that exact text in this field, kept for all the documents of the job:
-
SETKEY links the text to the value shown in the window. Choose the value first, then SETKEY. From then on, a document where the AI reads that text gets that value, whatever the scores. Use it for a supplier that is always written in a way the engines do not resolve.
-
IGNORE marks the text as ignored; it is shown in red.
-
The empty option removes the rule. VALIDMATCH is not a rule: it is shown when the best candidate reaches the minimum score.
Diagnosis
Each document keeps the result in the file aiassistant.<field>.json of its folder, with the readings, the candidates and their scores. It is also a cache: after changing the configuration, the list or the index, a document already processed shows the old result until it is processed again or until Refresh is clicked in the AI Field Assistant. The process also writes two fields in the document, AI_Assistant_found_<field> with the value proposed and AI_Assistant_score_<field> with its score and the minimum, as in 0.86/0.80; they can be used in scripts and exports.
|
Symptom
|
Cause and what to do
|
|
Text found by the AI is empty.
|
The document has no AI answer, or no row of the node list matches. Names are compared whole: company does not match company_name. Check that the AI stage ran and review the rows.
|
|
There are texts but no helplistVec candidates.
|
The index has not been built or the list has no index for this job: rebuild it. It is also normal for a code, a number or a very short text, which the vector engine skips.
|
|
The right candidate is listed but not written.
|
Its score is below the minimum; or it is LOWMARGIN because another entry is almost as close; or the field already had a value; or the result is the cached one from before a change.
|
|
The right candidate is always LOWMARGIN.
|
Look at the runner-up. If it is the same company entered twice in the list with two values, remove the duplicate. If the names of the list are very alike, lower the margin, or link the text with SETKEY. If every description carries the same additional text, such as the company or the branch the entry belongs to, that text counts in the vector search and brings the scores of all the entries together: an identical name is still found by helplistExact when the additional text is in parentheses at the end; for the others, keep the name alone in the list or link the text with SETKEY.
|
|
A wrong value is written.
|
The minimum score is too low for the model in use: raise it. Check also the node list: a node that does not identify the entry, such as the address or the customer of the invoice, produces candidates of its own.
|
|
New entries of the list are not found.
|
The index is older than the list: rebuild it, or schedule the rebuild.
|
|
All the scores changed after changing the model.
|
Expected: rebuild the index and review the minimum score and the margin.
|
|
The rebuild is very slow.
|
A processor without AVX2, or more threads than free processors (LEMBED_THREADS). A virtual machine with one or two processors that is also running OCR will take longer.
|