Skip to content

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.

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

  • 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.

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.

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

SituationRoute
Stable format, many documents a monththe classic reader
A one-off invoice from a new supplierAI analysis
Stable format but drifting line boundariesclassic + boundary verification
Documents that must not leave the companyneither route — both send the file out

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

The token columns in the log answer “what does analysing one invoice actually cost” better than any estimate. → AI API logs