Analysing a document with AI
Stockly’s own reader needs the layout described first: a struct, its columns and the mappings that recognise values. AI analysis turns that around — the model reads the document and works out the lines itself.
Starting it
Section titled “Starting it”On the document: Analyze with AI. Pick the model under AI model and confirm with Start analysis.
With no connection configured the model list is empty. → Connections
What it gives you
Section titled “What it gives you”- It copes with invoices the classic reader stumbles on.
- It supports any number of pages.
- It joins line items cut off at a page break — the usual failure of multi-page documents.
- It needs no table layout described in advance.
What to know
Section titled “What to know”The classic route is not the quiet alternative: it sends the document to Adobe PDF Services and is billed there too. What differs is what comes back. Adobe returns raw tables that a struct and its mappings still have to interpret, which is work done once and then repeated for free on every later invoice of the same shape. The model returns finished lines every time, and charges every time.
That is the real trade: a stable supplier format is cheaper through the classic reader, a one-off document is cheaper through the model.
AI inside the classic reader
Section titled “AI inside the classic reader”There is a middle setting. A struct with Use AI line recognition switched on uses the model only to verify item boundaries, on top of the usual heuristics. The rest of the reading stays classic.
That suits a supplier whose format is essentially stable but whose lines break up unpredictably. → Structs in Stockly
Which to choose
Section titled “Which to choose”| Situation | Route |
|---|---|
| Stable format, many documents a month | the classic reader |
| A one-off invoice from a new supplier | AI analysis |
| Stable format but drifting line boundaries | classic + boundary verification |
| Documents that must not leave the company | neither route — both send the file out |
How the document is chunked
Section titled “How the document is chunked”A long document does not go to the model in one piece. Two settings decide how it is cut, in Stockly → Settings → Import, card Native AI Import (OpenAI):
Pages per AI request — how many pages go in one request. Fewer, larger requests cost less overhead; lower this when requests time out on dense documents.
Overlap pages — how many trailing pages of the previous chunk are sent again as context. This is what lets a line item cut off at a page break be completed, so setting it to zero trades a little cost for exactly the failure AI analysis is usually chosen to avoid.
Which engine a document uses by default is Stockly’s own setting, Default analysis engine, in the same screen. → Import settings in Stockly
Where the cost shows up
Section titled “Where the cost shows up”The token columns in the log answer “what does analysing one invoice actually cost” better than any estimate. → AI API logs