More Documents Than Anyone Can Ask
Contracts, reports, correspondence, inspection records and tickets pile up in systems built to run the business, not to answer questions about it. Most of what matters is free text, in templates that differ by department and keep changing. A question that takes ten seconds to ask becomes a ticket to IT or a manual review, and often it is simply never asked.
Two constraints rule out the obvious answer. The data cannot leave, because regulation, client confidentiality or trade secrets forbid it. And the cost has to be predictable: one pass of a large cloud model over millions of complex documents can cost tens of thousands of dollars, and every improvement means another pass.
Where the Usual Tools Fall Short
- A model that writes the query. It returns a plausible number nobody can verify.
- Keyword search. A term in a list of recommended options is a plan, not an event, yet search counts the record.
- A chatbot over documents. It retells a few passages. It cannot count contracts across millions of files, and counting documents instead of contracts is the classic error.
- A BI dashboard. It answers the questions someone thought of in advance, from structured fields the documents mostly do not have.
- A full cloud pipeline. Every document and every re-run is billed again, so the bill grows with how much the company holds.
From a Question to a Checkable Answer
Every step is designed to run inside the perimeter, on a read-only copy of the documents.
- Mask. Names, contacts and reference numbers are masked before anything else touches the text. What the record already labels is removed by rule.
- Extract. Dated facts are taken from the text by written, versioned and tested rules.
- Read the question. A local model turns it into a structured plan: which entities, which conditions, which period. The question can be typed or spoken, in seven interface languages.
- Count. A planner assembles the database query from parts that are already tested. A condition the plan cannot express gets an honest refusal and is never quietly dropped.
- Answer. The answer opens with how the question was understood, followed by the number, the list, the reason each row is there and the source document.
A question about contracts counts contracts, however many documents mention each one. "Renewed more than twice" means three dated renewals, not three places where the word appears. Summaries are written overnight by a local model and marked as not yet checked by a person.
Technology Stack
Closed Where It Protects, Open Where It Connects
The model proposes. The planner counts. A person signs.
- Isolation. The system is reachable only over the company's VPN. It reads documents and writes nothing back to the source.
- Cloud models for narrow jobs only. They are off by default, and used for a second check of the masking or for genuinely hard cases. They see only masked text, through one gateway that logs every request.
- More people, same rules. Everyone searches the same masked text under a personal login and role, with a full audit log. For a full record, a person goes to the source system.
- Open for integration. A versioned API, file exports and a link to every answer, under the same roles and the same log.
- Checked on every change. Control questions with expected answers and the masking accuracy are release gates. Agents watch the perimeter, the audit log and the architecture.
- Complaints become rules. A user's complaint is asked again against the real data, and the rule learned from it is written down with a test.
A Cost That Stays Predictable
Each job goes to the cheapest class of model that does it well enough.
- Rules and record fields mask labeled details and extract dated facts. They cover most of the work.
- Small name-finding models catch what no field labels, on ordinary processors.
- A mid-size local model reads the question and fills in the plan.
- A large local model writes summaries and checks answers at night, when the servers are free.
- The largest models improve the rules and settle hard cases. They never go through the documents one by one.
Heavy runs have a budget, run outside working hours and resume where they stopped. Growing from a first slice to the full archive takes more hours on the same servers, with no per-token bill for every document.
What the Assistant Is Designed For
These are the targets and limits in the design.
- More than 100 million documents.
- A typical counting question answered in under 10 seconds.
- No number written by a language model.
- No document sent to a cloud model in day-to-day operation.
- Masking measured per class on every release against a fixed bar; a release below it does not ship.
- No complaint closed without asking the question again against the real data.
Every choice has a price. Some questions get a refusal instead of a guess, some numbers are lower bounds and say so, and scanned files come after the first stage.
Where This Design Fits
The same conditions repeat in many document-heavy organizations:
- questions go to IT or to analysts and come back days later;
- most of the value is free text, in templates that keep changing;
- the data is regulated, confidential or commercially sensitive;
- a wrong number costs more than no number.
Legal and contract teams, insurers, banks and compliance functions, engineering and maintenance records, and government contractors all share these signs. A first stage needs a read-only copy of the documents, proven masking and a set of real questions with the answers people expect. Our private LLM and data residency and enterprise knowledge assistants pages describe the services behind it, and the glossary explains open-weight models, text-to-SQL and data residency. The AI data analyst in Microsoft Teams applies the same split between model and code to a live database.
documents the design is built for
numbers written by a language model, by design
documents designed to go to a cloud model in day-to-day operation