Writing AI Hints¶
Intuitive AI uses a large language model in two places, and you steer both with plain-language hints. The Zero-Shot Classifier picks the class of a document from a description of each class. Auto Extraction fills Index fields from a hint on each field. A good hint is short, names the words printed on the page, and says what to skip. This page explains what the engine does with each hint, then gives rules and worked examples.
At a glance
- Runs On the server, on the Intuitive AI worker
- Language Plain English sentences
- Configured in Intuitive AI app: Document Classification (class hints) and the Default Rule's Auto Extraction action (field hints)
- Status The Zero-Shot Classifier is generally available
- Best for Classes that differ in meaning, and fields on documents with no fixed layout
How the engine uses your hints¶
graph TD
A["Class hints"] --> B["Cleanup: no commas or brackets, 1000 characters"]
B --> C["One list of every candidate class"]
C --> D["Model picks one class or None"]
D --> E["Matched class"]
E --> F["Field hints become a schema"]
F --> G["Model fills each field"]
G --> H["Threshold splits high and low confidence"]
Zero-Shot Classifier hints¶
Where you configure a class hint¶
Open the Intuitive AI app, open a class (not a subclass), and go to the Document Classification section. The condition is "Zero Shot Classification". Pick one of two modes:
| Mode | What the model sees |
|---|---|
| Class Name | The class name only. New classes start in this mode. |
| Hint | The class name plus your description of the documents that belong to the class |
The Zero-Shot Classifier works on a class only. It chooses between classes, not subclasses. To choose a subclass, use page refiners on each subclass. See Pick a Vendor Subclass from Page Text and Tell Form Revisions Apart.
What the engine does with a class hint¶
- It builds one list of every candidate class, written as
Class Name (hint). - It asks the model to choose the single best class from that list, or "None". The model is told to focus mainly on the beginning of the document text.
- The document text is trimmed to fit the model's input limit, so text near the end of a long document can be cut off.
- It matches the answer to a class name, case-insensitive.
- The chosen class gets a confidence based on how certain the model was. Every other class gets 0.
Before it sends the list, the engine cleans each class name and each hint:
- It removes line breaks, parentheses
( ), square brackets[ ]and commas. - It cuts the hint to 1000 characters after that cleanup.
- If a class has more than one Zero-Shot condition with a hint, it joins the hints with ". " before the cut.
What this means for a class hint¶
- Hints compete. The model reads all class hints side by side. Write each hint to separate its class from the other classes.
- Commas disappear. "Lists invoice number, date, and amount" becomes "Lists invoice number date and amount". Write short sentences that end in a period, and join list items with "and".
- Lead with the strongest signal. Put the words that appear near the top of the document first.
- Keep class names distinct. "Statement" and "Statement Copy" are hard to tell apart, even with hints.
- Stay under 1000 characters. Anything after the cut is lost without warning.
Auto Extraction field hints¶
Where you configure a field hint¶
Open the class or subclass. In the Default Rule, add or open the Auto Extraction action ("AI Extraction"). Each field row has:
| Box | Meaning |
|---|---|
| Property | The Index field to fill |
| Type | Text, Number, Date, Table, Boolean or List |
| Hint | Your instructions for this field |
| Threshold | Confidence in percent. Blank or 0 uses the default, 93%. |
Extraction Strategy sets how the model reads the document:
| Strategy | Use it for |
|---|---|
| Text Only (default) | Text-heavy documents |
| Structured Text | Complex tables or fields. Uses a layout-aware OCR pass. |
| Image Only | Visual-only features such as stamps, handwriting and logos. The model reads page images. |
What the engine does with a field hint¶
- It sends a schema with one line per field. The field name keeps only letters and digits:
Invoice TotalbecomesInvoiceTotal. - Your hint goes on that line as a comment. Line breaks become spaces, and a period is added if the hint does not end with one. Commas are kept.
- The model is told to prefer an empty string over null, unless your hint says otherwise.
- The text of up to 25 pages is sent.
- List fields always come back as a JSON array.
- Table fields have two modes. If the table field has no hint and no threshold, you get Table Columns:, and each column has its own name, type, hint and threshold. If the table field has a hint, the hint alone describes the table.
- Threshold splits results. A value at or above the threshold is high confidence. A value below it is low confidence, so a reviewer can see it.
- Training documents teach by example. The engine adds up to 2 example documents to the request: training documents of the same class and subclass that have saved correct values, and whose first page matched the incoming document with confidence above 0.4.
Hint Refinement
The subclass ribbon has a Hint Refinement button ("Analyze documents and refine AI extraction hints"). It compares your current hints against possible improvements on your known documents. Use it after you write a first draft.
Rules for a good hint¶
- One rule per sentence. The model follows short, separate sentences more reliably than one long sentence.
- Name the distinguishing words. Quote the labels printed on the document: "It is labeled Amount Due or Balance Due."
- Say what to exclude. Name the look-alike values to skip: "Do not use the subtotal. Do not use a line-item amount."
- Give the format. "Return the date as YYYY-MM-DD." "Return a number with two decimals and no currency symbol."
- Say what to do when the value is missing. "If there is no PO number, return an empty string."
- Do not repeat the field name. The model already sees it. Spend the words on what makes the value hard to find.
- Test on hard documents. Use the class Test button with documents that failed before, not only clean ones.
Worked example: a transcript GPA field¶
A records office extracts the cumulative GPA from academic transcripts. The first hint returned a term GPA on some transcripts and a transfer-credit GPA on others, and the format varied.
The cumulative grade point average for all terms at this school. It is usually labeled Cumulative GPA or Overall GPA near the end of the transcript. Do not use a term or semester GPA. Do not use a GPA for transfer credit. If two GPAs are printed, one with credit-only courses (CR or P) and one without, use the one without them. Return the number exactly as printed with two decimals, for example 3.47.
The date the degree was conferred. It is labeled Degree Date or Date Conferred. Do not use the date the transcript was issued or printed. Do not use an enrollment or term date. If no degree is shown, return an empty string.
The higher threshold (95) sends more borderline GPA values to review. Raise the threshold for fields where a wrong value costs more than a manual check.
Worked example: statements and invoices¶
An accounts receivable team receives statements and invoices that share one content type. Statements came back with an invoice number taken from the activity table. The fix applies one test (one invoice versus several invoices) to every field, or splits the kinds into two classes with classifier hints. See Tell Statements from Invoices with Hints for both versions.
Copy this into your assistant¶
Paste the block below into your AI assistant together with the AI Assistant Primer. Then paste your class names, your field list and two or three sample documents (as text), and ask for hints.
# Intuitive AI hints: context for AI assistants
You write plain-language hints for KnowledgeLake Intuitive AI. There are two kinds.
## Zero-Shot Classifier hint (one per class)
- The engine lists every candidate class as `Class Name (hint)` and asks the model to pick one class or "None". The model focuses on the beginning of the document.
- Before sending, the engine removes line breaks, commas, parentheses and square brackets from names and hints, then cuts each hint to 1000 characters.
- Hints are read side by side, so each hint must separate its class from the other classes.
- It chooses between classes only, never subclasses.
## Auto Extraction field hint (one per Index field)
- Each field becomes one schema line: the field name with only letters and digits, then the hint as a comment. Commas are kept here.
- Field types: Text, Number, Date, Table, Boolean, List. List fields return a JSON array. A Table field with no hint uses per-column hints instead.
- The model prefers an empty string over null unless the hint says otherwise. The text of up to 25 pages is sent.
- A threshold (percent, default 93) marks values below it as low confidence for review.
## Rules for every hint
1. One instruction per sentence. Short sentences that end with a period.
2. Name the words printed on the document: "It is labeled Balance Due or Total Due."
3. Name the look-alike values to exclude: "Do not use a line-item amount."
4. Give the return format: "Return the date as YYYY-MM-DD."
5. Say what to return when the value is missing: "If there is no PO number, return an empty string."
6. Do not repeat the field name or the class name.
7. Classifier hints only: no commas, parentheses or brackets; join list items with "and"; put the strongest signal first; stay well under 1000 characters.
8. When two kinds of document share fields, apply one shared test in every field hint (for example, one invoice versus several invoices).
## Example
Class "AR Statement" hint:
```text
A customer account statement. The title says Statement or Statement of Account. It lists several invoices with their dates and a running balance. It shows one Balance Due for the whole account. It has no line items for goods or services.
```
Field "Amount Due" hint (Type: Number):
```text
The total amount the customer must pay now. On an invoice it is labeled Invoice Total or Amount Due. On a statement it is labeled Balance Due and it sums all open invoices. Do not use a line-item amount. Return a number with two decimals and no currency symbol.
```
## Output
For each class or field: the name, the type (for fields), a suggested threshold when a wrong value is costly, and the hint as plain text in its own code block. Then list the look-alike cases the user should include when testing with the class Test button. If a class name, field name or label printed on the documents is not known, ask the user. Do not invent one.
Related¶
- How Classes, Refiners and Actions Fit
- Tell Statements from Invoices with Hints
- Intuitive AI API: read and update Auto Extraction hints from code