×
Menu
Index

5.7.5. AI Assistant

 
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
How it works
Setting it up
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: 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:
How the value is chosen
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.
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:
In ChronoScan Enterprise the web indexing client has the same window.
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.