Documents and AI

How answers are generated and verified

Logley’s assistant writes each answer with the language model inside your installation, from the passages and records it retrieved for that question, and hands you that evidence with the answer. Verifying means opening the evidence and comparing it with the original page.

ABOUT 8 MINUTESEXPLAINERFOR EVERYONE

Logley principleThe original has the last word

An answer points to a document; it does not replace it. Logley shows what each answer was built from, so the page can settle any doubt.

Goal

Check one answer against its original, then run the same check across a set of questions whose answers you know.

From question to answer

Four things happen between pressing Enter and reading the answer.

  1. The question is read

    A command such as /stats is answered straight from the database by counting; no language model is involved. Anything else goes to the assistant, together with the conversation so far — up to the last ten messages.

  2. The assistant chooses what to look up

    The language model is offered a set of read-only lookups, limited to what your role may read: search the text of your documents; list or read invoices, suppliers, shipments, contracts, alerts and reports. It decides which to run, at most eight per question. Each lookup is recorded on the server as the assistant acting for you.

  3. It writes from what came back

    It works under fixed instructions: state only what the lookups returned; say it could not find something rather than invent a number, a reference or a file name; never report that a record does not exist before a lookup has looked for it; name the currency with every amount and never add different currencies together; name the file it quotes. An answer written without any lookup is sent back once, with an instruction to check.

  4. The evidence comes with it

    The documents it retrieved passages from are listed under the answer as Sources, each with its type and page. Each lookup it made shows as a label above the answer, such as Listing invoices, and the answer is instructed to link the records it read.

What if the assistant cannot work this way? When the model cannot call lookups, your role can read nothing it could look up, or the model twice answers without looking, Logley takes a simpler path. It retrieves the five documents that best match your question, by meaning and by the words it uses, with up to two passages from each. The model answers from those alone and is instructed to reply “I don’t have enough information in the uploaded documents to answer this.” when they do not hold the answer. A greeting, or a question about Logley itself, is answered without retrieval and without sources.

What comes with each kind of answer

The evidence each kind of answer carries, and how to check it
Built fromWhat you seeHow to check it
The text of your documentsA Sources list: each document with its type and pageOpen the file the answer names and find the passage
Records it looked upLabels such as Listing invoices above the answer, and a link to the recordOpen the record, then the document behind it
A commandCounts, with no sourcesOpen the list the counts describe
Nothing: a general questionNo sources and no labelsIt is not about your data; treat it as unsourced

Check an answer against the original

  1. Open the source the answer names

    Click the file the answer names (in brackets, or as a link in the sentence itself) rather than simply the first in the list; it opens the document’s page. A file name that is not in the Sources list is not evidence. A record link opens the record instead: an invoice opens with its original in the Document Preview beside its fields.

    Sources, then the file the answer names, then the document’s page

  2. Find the passage

    The source gives the page. Extracted OCR Text holds everything Logley read from the document; Show full text and your browser’s find will locate the words the answer relied on.

  3. Show the values on the page

    On a PDF, Highlight fields in the Document Preview marks each extracted value where it appears on the page, coloured by kind: references, parties, amounts, dates.

    Highlight fields on: every value Logley read is marked where the page prints it.
  4. Compare

    Read the value in the answer, then on the page. Where Logley located a value in the document’s text, Extracted Data says so beside the field: Found on page 1 brings that page into view in the preview, and the quotation mark before it shows the page’s own words around the value (On the document). Where a scan was hard to read at that spot, it adds the scan is hard to read here.

    The citation of a value read from a PDF's own text layer. On a scan that was hard to read at that spot, the field adds: the scan is hard to read here.
  5. Correct what is wrong

    If the page and the record disagree, the page wins. Correct the field, and answers built from that record read the corrected value from then on.

Open the invoice the answer listed and the page prints the same number, FV/D1/2026/001 — with the route, which the invoice record itself does not hold.
When nothing is highlighted

Highlight fields looks for each value’s exact text in the PDF’s own text layer. A scanned PDF without one, an amount printed as 1 783,50 but stored as 1783.50, or a value broken across two lines gets no highlight — which does not make it wrong. Compare those by eye.

Closeness is not correctness

Retrieval ranks passages by how close they are to your question, in meaning and in the words used, not by whether they hold the answer. That is why an answer written from document text names the file it read: that file, and not simply the first thing on the page, is the one to open.

The answer names the contract it read, and the source beneath it carries the passage it was cited for. Where the text says nothing (here, on late delivery), the answer says so rather than filling the gap.

Two things follow from ranking by closeness. A very short passage (the text of a logo, a stamp, a page header) sits close to almost any question, because there is too little in it to differ. And where your documents are laid out alike, one supplier’s invoice is about as close to a question about an invoice as another’s, so a source that looks plausible is not evidence on its own: open it. The same holds for the Match percentage on the Search page: it measures how well a document matched your query, by meaning and by the words it contains, not whether it answers your question. How search finds the right document explains the Match score.

A repeatable trust check

For an evaluation, test the answers the way you would test a new colleague: with questions whose answers you already know.

  1. Write the questions before you start

    From documents you know: some answered by one value on one page, some that need a list (every overdue invoice from one supplier), and a few whose answer is not in your documents at all.

  2. Check the value and the source separately

    An answer can be right from the wrong source, or cite the right document and misread it. Record both, every time.

  3. Ask each question twice

    Rephrase it once. If the answer changes with the wording, note which phrasing found the document.

  4. Score every answer the same way

    Keep the question, the answer, the source you opened and the score together.

Scoring an answer in an evaluation
What happenedScore
The value is right, and the source you opened shows itPass
It could not find the answer, and your documents do not contain itPass
It could not find the answer, but your documents do contain itMiss: rephrase, and check the document has finished processing
The value is right, but nothing it shows supports itFail: not verifiable
The value is wrong, or the answer claims what the documents do not sayFail

Preparing a first evaluation covers choosing the documents and the questions.

Limits

  • Only what is in Logley. The lookups read your organization’s documents, records and search index. The assistant has no web access.
  • General questions get unsourced answers. A question that is not about your data (what an Incoterm means) can be answered from the model’s general training, with no sources, or declined when it is taken for a question about your documents. Treat an answer with no sources like any text without a reference.
  • Instructions are not guarantees. The rules above make a wrong answer less likely and a missing one more honest; they do not make the model infallible. That is why the evidence is attached.
  • A record is only as right as its extraction. An answer read from an invoice record repeats what extraction committed, a misread value included, until someone corrects it. Why a value is never a guess explains what keeps misreads out in the first place.
  • Long lists are cut short. The model reads at most 6,000 characters of each lookup’s result, so an answer that adds up a long list can miss rows. Ask for the total instead: several lookups return totals Logley has already worked out per currency.
  • Check an answer while it is on screen. A reopened conversation shows its answers without the labels of what was looked up.
NEXT GUIDEAutomation, end to end
Continue

Continue exploring

Was this guide useful?

If something was missing or unclear, the contact page says where to write.

Contact