Reading a contract without sending it to a server

SecureRAG lets a lawyer, paralegal or compliance analyst ask questions across up to 40 PDF or DOCX files at once, with parsing, embedding and search all running in the browser. Files never leave the device. This page lists the formats that work, the questions that retrieve well, and the cases where a local tool is the wrong choice.

Last updated:

Contract questions come in two kinds: find an exact identifier, or find a passage that says the same thing in different words. This pipeline searches for both at once, which is why vector ranking and BM25 run side by side and get fused rather than chosen between.

What a legal working set looks like

A typical set is 30–40 files: the agreement under review, its annexes, the internal policy it has to fit, and the template it was drafted from. All of it is small enough that the 40-file cap is the first limit you meet, not the 200 MB one.

Table 1 — what each format gives back
FormatTypical sizeWhat parsing preservesWhat it loses
PDF with a text layer1–12 MB for 20–300 pagesPage numbers on every chunk, so a citation reads “page 14”Table grid structure collapses into a stream of cells
DOCX80 KB – 2 MBHeading levels, so Clause 8.2 keeps its nestingComments and tracked changes are ignored
Markdown or TXTUnder 1 MBHeading and line structuren/a
CSV or JSONUnder 25 MBRow boundaries, so a question can target a columnn/a
Image-only scanned PDFAny sizeNothing — the file is detected and reportedThe entire document until you run OCR elsewhere

Questions that retrieve well, and why

A question that pairs one exact token with one paraphrase engages both rankers. A question that needs arithmetic across three documents does not: retrieval returns passages, and the optional generation step is a 0.5B–1.5B local model with a limited context window.

  1. “Where is the notice period defined?” — the defined term is an exact-token match, the paraphrase is a vector match.
  2. “Which clauses let the supplier raise prices, and under what conditions?” — returns the clause plus its carve-outs, which is where the 15% chunk overlap earns its keep.
  3. “Show every mention of clause 8.2.” — exact-token question; keyword ranking does the work and the citations carry page numbers.
  4. “Compare the liability cap in these four contracts.” — returns four passages with file and page references, and you do the comparing.
  5. “Which agreements expire in the next 90 days?” — works when dates are written as text; a date inside a scanned stamp is invisible.
  6. “Who signed, and on what date?” — signature blocks are plain text in most DOCX and text-layer PDF files, so this usually resolves.

A 40-minute pass over one supply agreement

01

Load the agreement with its annexes

Drop the main agreement PDF, the pricing annex PDF and the service-level annex DOCX into one library. Three files index in well under a minute on a laptop; no GPU is involved at this stage.

02

Ask for the definition first

Question: “What does Effective Date mean in this agreement?” The definitions clause repeats the term densely, so it outranks the places where the phrase is merely used.

03

Walk the obligations one at a time

Delivery windows, price adjustment, exclusivity, termination triggers — one question each. Numbered citations let you click straight to the page and nearby paragraph.

04

Hunt the exception

Exceptions usually sit in the sentence after the rule, which is exactly where a chunk boundary can cut. Raise the overlap in settings, or ask for the passage following the one you were shown.

05

Read the citations you did not click

Retrieval surfaces the passages it ranked highest, which is not the same set as the passages that matter to the deal.

06

Leave a trace

Export the question list with its citations to Markdown or CSV so the same reading can be repeated later. The index itself stays in this browser profile and disappears when site data is cleared.

Where retrieval will let you down

Table 2 — failure modes you can predict
SymptomCauseWhat to do instead
A clause you know exists never appearsThe annex is a scan with no text layerRun OCR first, then import the text version
Numbers land in the wrong columnThe PDF table was flattened into reading orderAsk for the page number and read the table by eye
A defined term resolves to the wrong placeThe term is defined once and reused forty timesAsk for “the clause that defines X”, not for X
A cross-reference misleads“Subject to clause 12” is quoted without clause 12Ask for clause 12 by number — an exact-token match
A long answer is partly wrongThe generation tier inferred across passagesSwitch back to the default retrieval tier for a quoted-only answer

When this is not the right approach

  • The analysis has to be reviewable by someone else inside a shared system. There is no backend and no shared index: each person imports their own copies, into their own browser profile.
  • The document set runs past 40 files or 200 MB. Split it by matter, or use a repository built for scale.
  • The key documents are scans without a text layer. Without OCR the file yields no text at all, and the parser reports it rather than indexing emptiness.
  • You need a record of who read what. Nothing is logged anywhere, which is the privacy property and a problem for chain-of-custody requirements.
  • The output would be relied on without anyone reading the cited passage. Nothing here checks whether a quoted clause is still in force, or whether the governing law is the one your client assumes.
  • You need the tool to reach a conclusion about the documents. It retrieves and quotes; the judgement stays with a person.
Scope of this page: It describes how a retrieval tool behaves on document sets. It is not legal advice, and no configuration of SecureRAG makes a process compliant with any regulation. Whether a given matter may be worked on in a browser under your firm’s rules is a decision for your firm.

Data handling, stated plainly

  • Files never leave the device. Parsing, chunking, embedding and search all run in the tab.
  • No account, no tracking pixels. There is no login and nothing to attribute a document to.
  • Not used for training. There is no service on the other side receiving text.
  • Works offline once cached. The single outbound request is the first GET for model weights, and its payload is the file name.
  • Clearing site data in the browser deletes the index, the chunks and the vectors. There is no copy elsewhere to delete.
Can SecureRAG read scanned contracts?

Only if the PDF carries a text layer. Image-only pages produce no text, and the parser reports the file instead of indexing an empty document.

Is the contract sent anywhere for embedding?

No. Embedding runs in a Web Worker on your machine using a model of about 25 MB for Chinese (bge-small-zh-v1.5), about 23 MB for English (all-MiniLM-L6-v2), or about 120 MB for mixed-language sets (multilingual-e5-small). The one outbound request is the first download of those weights.

How many contracts fit in one library?

Forty files, 25 MB each, 200 MB in total, 20,000 chunks. Contracts are small, so the file count is normally the limit you reach first.

Can two people share one index?

No. The index lives in IndexedDB inside one browser profile. Sharing means exporting answers with citations, or each person importing their own copies of the same files.

Is a generated summary safe to put in a file?

Treat it as a search result, not a checked one. The optional generation tier runs a 0.5B–1.5B model at 4-bit on your device and citations are attached from the retrieved passages, but each sentence still needs to be read against the source before it becomes work product.

If you try one thing: Open the tool, add three files already on your disk, and ask for a clause you know by heart. Click the citation marker and check that it lands where you expect. That minute tells you more than any description of the pipeline.