Skip to content
Built in-house

Virgil: cited answers from a library of long documents

Experts lose time finding the passage behind an answer. Virgil, which we built for our own use, answers from a library of long documents and cites the paragraph and page it relied on.

The problem

Specialists in regulatory, legal, and research work rely on libraries of long, dense documents, and locating the passage that supports an answer can take hours. Generic chat assistants answer fluently but cannot show where an answer came from, and when the documents are silent, they invent. Anyone who must defend an answer to a regulator, a client, or a reviewer then has to check it from scratch, and a confident fabrication can pass unnoticed.

Design patterns

The decisions that make the system work, and that carry to other settings.

  1. 1Documents become traceable records

    Sections, figures, tables, references, entities, claims, and results are extracted as fields, and bibliographic details are checked against public registries. Each field records its provenance. A document that cannot be processed fully is marked degraded, not silently passed, which keeps the library's gaps visible.

  2. 2Citations to paragraph and page

    Retrieval combines semantic and keyword search, then reranks the candidates. Answers carry numbered citations mapped to the source paragraph and page. An evidence ledger records the passages the model was shown, and a reviewer can reconstruct how an answer was formed.

  3. 3Built to decline

    When the library does not hold the answer, Virgil is designed to say so. Unanswerable questions sit in the benchmark alongside answerable ones, and declining is tested with the same rigour as accuracy.

  4. 4Data residency by configuration

    Models are routed by task, and the pipeline can run entirely on local models. A firm can keep its documents and questions on infrastructure it controls, and decide task by task where a hosted model is acceptable. Model costs are logged per call.

  5. 5Acceptance measured against a benchmark

    Questions are written from the source documents and scored by a judge kept separate from the system under test, with a triage record for each defect. A second model checks extractions, and reviewers separate from the pipeline audit them in rounds, with fixes made between rounds.

The result

An expert can put a question to the whole library and check the answer against the passages it cites: hours of searching become minutes. A compliance or regulatory team can defend an answer by pointing to the paragraph behind it, and we can show how Virgil was tested before anyone relied on it.

Applied

The same pattern in a regulated firm

Illustrations of how we would apply the pattern. They describe what we would build, not past client work.

Setting What it would do
Life sciences A regulatory affairs team would query submissions and agency guidance, with answers cited to paragraph and page and the pipeline running on local models inside the company.
Healthcare Clinical governance staff would search guidelines and audit reports, and see a declined answer where the guidance is silent.
Banking We would build it over a bank's internal policies and the regulator's rulebook, and a compliance officer could trace an answer to the clause behind it.

You may need something like this if

  • Your experts spend hours finding the passage that supports an answer.
  • You cannot act on an AI answer you cannot trace to its source.
  • Your documents must stay on infrastructure you control.