Documentation · 4 of 6

How it works

This page explains what happens to your documents when you add them to Watchdog: what ordinary software does on its own, what an AI model reads and writes, and why it is built this way. It assumes no programming background. If an editor, a lawyer or a source asks how a fact in your notes was produced, you should be able to answer in plain terms.

#Three stages

Every document goes through three stages, in order. Add documents runs all three for you; Activity → Maintenance has a card for each, so you can run them one at a time.

Stage What happens Who does it
Pre-processing Convert the file into readable text, and list the names and figures on each page Software and small models on your computer: no cost, nothing sent anywhere
Processing Read the text and note the facts A cloud AI model, one document at a time
Post-processing Cross-check, merge and write up the investigation Ordinary software and a cloud AI model, across every document you have

#Pre-processing: turning a document into text

Before anything can be read, it has to become text a computer can search. This stage runs entirely on your computer, and costs nothing.

If a PDF already has selectable text, Watchdog reads it directly. If it does not (a scanned court filing, a photographed ledger, a fax), Watchdog runs optical character recognition, or OCR: the same idea as a scanner turning a photo of a page into text you can copy, just automated. It decides page by page, so a 200-page filing with two scanned exhibits gets OCR on those two pages only. The tool doing this is Docling, an open-source document reader that also recognizes tables and page layout, so a financial statement's rows and columns come through as structured text rather than a jumble. OCR reads each scanned page at the resolution of the scan or screenshot on it, so small print keeps every pixel it has. Watchdog keeps where each line of OCR'd text sits on the page, so the app can highlight a word on the scan itself; the scan is never altered.

Watchdog also works out what language each document is in, from the text of each page: the file's own text, or for a scan, a first reading in English. It uses py3langid, a small language detector that runs on your computer and recognizes about 100 languages from patterns of letters, so French read with English settings is still recognizably French. A page with too little text to judge, such as a stamp, a signature or a page of figures, counts as whatever most of the document is in, so a bilingual stamp or heading never makes a document count as mixed. Then:

  • Mostly English: nothing more happens.
  • Mostly one other language: its scanned pages are read again in that language (plus English, for names and headings), with no question.
  • Mixed, for example some pages English and some French: when its scanned pages include some in the other language, Watchdog asks before anything is sent whether to read those pages again in their language. This should be rare.

A sidecar file can name the language instead, and then nothing is detected. The document's details say which language it is in and which pages were read in it. How much reading again helps depends on the OCR engine. On a Mac, in our tests, Apple Vision read French, German and Russian scans the same whatever language it was given, but read Chinese only when told to. Tesseract reads a language only with that language's data installed, about 4 MB each; Watchdog never downloads it, and a document's details say when it was missing. RapidOCR, used on Windows and Linux, reads most languages written in the Latin alphabet, as well as Chinese and Japanese, with one model and needs nothing more; for other scripts it would need a separate download, which Watchdog does not make, and the details say so.

An audio or video recording is transcribed instead, by Whisper, an open-source speech-recognition model from OpenAI, running on your computer through faster-whisper: the recording is not uploaded anywhere. Speech recognition is good but not faithful. It cannot tell who is speaking, and it mishears names and numbers it has not met before, so the next stage is told it is reading a machine transcript.

A model reading quickly can skim past a figure in a footnote or a table row. So pre-processing also makes a checklist for the next stage. Ordinary code finds the dollar figures, other numbers, percentages, dates and court file numbers on each page by their shape, and a small model on your computer, GLiNER, finds the names of people, organizations and places. This is done once per document and kept with it. On a long document it can take several minutes, so reading the document again, or retrying it after a failure, does not pay that time twice. If GLiNER cannot run, the checklist is made without names and the document is still added.

Pre-processing also fingerprints every document, so a file you (or a colleague) already added is set aside rather than processed twice, and a looser check flags documents that are similar but not identical, such as a redlined revision of a contract.

#Processing: reading like a reporter

This is where an AI model reads each document and takes notes, the way a reporter marks up a printout with a highlighter, except that every note is structured and tied to a page.

First, the model works out what kind of document it is: a bankruptcy filing, a municipal contract, a land transfer, a court affidavit. Each type has its own record skill, a set of instructions for what matters in that kind of record, and the model reads the document with the right one.

Then it reads the whole document and writes down what matters. For each material fact (a dollar figure, a date, an allegation, a change of ownership) it records the fact, the page it came from and, when the exact wording matters, a short quotation. It also lists every person, company and place named. This is deliberately close to how a journalist reads primary sources: not summarizing in the abstract, but pulling out the concrete, checkable claims.

Dates. The model writes a fact's date as the document printed it, in whatever language. Ordinary code then turns it into a calendar date using dateparser, which knows the month names of every language it supports ("12 septembre 2019", "3 maggio 2020", "15 березня 2021", "2021年3月15日"). It is careful in three ways. It places a date only when the year is printed, so "March" or "le 3" is never assumed to mean this year. It keeps only the precision the wording gives, so "mai 2020" goes on the timeline as May 2020, not a made-up day. And it never guesses the order of a date written in figures: 03/04/2021 could be 3 April or 4 March. It reads the order from the document instead, when the document shows it: a printed format such as "DD/MM/YYYY", or another date in it that can be read only one way, such as 25/04/2021. A date settled that way is marked date inferred on the timeline. When the document shows no order, or shows both, the date goes on the timeline at 2021 until the step described under post-processing settles it. Relative dates ("the following Tuesday") are never read by code.

The model is also handed the checklist pre-processing made of the names and figures on each page it is reading, as a backup: it is not asked to notice a number in a table on page 52, only whether the number it is shown matters. No model on your computer runs before or during this reading; the only local models used in this stage are the search models described under Search, which index the document once its facts are written. (A document read by an earlier version of Watchdog, before the checklist was kept, has it made at this point instead.)

The model is asked to mark any fact it inferred (reasoned to, rather than read) and Watchdog shows that mark beside the fact. The mark is only the model's own hint, so always follow a fact back to its source before you rely on it. Checking facts explains how.

#How a passage is found

The model usually records only a page number for a fact. So that you can see the evidence beside the claim, Watchdog then looks for the sentence on that page that best supports it. This is ordinary code, not AI: it breaks the page into sentences, picks out the fact's figures, dates and distinctive words, gives the rarer ones more weight, and keeps the sentence (or pair of sentences) that shares the most. If the model's quotation was confirmed in the source, that is used instead. When nothing on the page is close enough, the app says "No matching passage found" rather than guess. A matched passage shows where to look; it does not confirm the fact.

#Post-processing: cross-checking and writing up

The real value of an investigation is in what connects across documents. That happens once every document in the batch has been read.

Much of it is plain bookkeeping by ordinary software: gathering every fact about a person or company onto one note, and sorting events into a timeline. The facts on an entity's note are always the documents' own facts, each with its page, never a model's retelling of them.

How Watchdog decides two names are the same. A name alone is weak evidence, because two different people can share one. So Watchdog asks what else the two records have in common, and acts on how sure that makes it:

  • When both carry the same registration, licence, court file or parcel number, or a person's full name comes with the same role, employer or street address, or two records of a company, public body or place carry the same proper name, ordinary software merges them. While it reads a document, the AI model notes whether each organization's or place's name is its own name ("Government of Northland", "General Holdings Corp.", however ordinary the words) or a description standing in for one ("the Board", "the City"). The same proper name means one thing within an investigation unless the two records carry different registration numbers or you have marked them not the same; a description never merges on its name alone. A place known by one word ("Kingston") or by a street with no number ("Main Street") is not merged on its name either, since more than one town can have it; the AI model compares the two records' facts instead. Documents added before this note existed are judged by whether the name looks specific enough ("Northgate Civil Works Ltd.", not "the City"). A street address counts as the same when only its writing differs ("1200 Example Ave NW" and "1200 Example Avenue Northwest, Port Calder"), never when the unit, civic number, street or postal code does.
  • When two people share a full name and nothing else, or a name is a description standing in for one, an AI model reads both records' facts side by side and merges them only if it is confident.
  • When one name is an initialled or shortened form of the other ("J. Smith" and "John Smith"), nothing merges them automatically: you decide, on the Merges tab in Review.

A short name can turn up in dozens of documents, each time recorded on its own, because the name alone cannot say whether they mean one thing. The model reads all the records with that name together, up to 30 at a time, and says which of them are the same and which it cannot tell apart; those it cannot tell apart wait for you in Review. A larger set is read in parts, then the results of the parts are read together. Anything a run could not get to is compared again on the next run, and the run's output says how many.

Every merge is written to a log you can read, and a pair you mark "not the same" is never merged automatically afterwards.

The parts that need judgement go to an AI model. They are of two kinds. Housekeeping calls match, check and tidy: everything in the list below up to settling dates. Writing calls produce prose you read: the summaries and the briefing. The finishing step uses one model for both unless you choose a different one for either kind in Settings (see the Settings reference).

  • Recognizing the same entity under different names. "Calder Valley University" and "CVU" are the same institution, but only a model can say two different-looking names refer to the same one. It is deliberately cautious, since a wrong merge would quietly conflate two different people.
  • Flagging contradictions. If one document says a company was dissolved in March and another says it filed papers in June, the discrepancy is flagged on the entity, with both sources: not resolved, not hidden. The model compares each new document's facts with the facts already recorded, and the sentences they rest on, never a summary. Older facts are not compared with each other on every run, which keeps each run's cost tied to what it adds; Re-check contradictions does that on demand.
  • Grouping relationship wordings. One document calls a person "lawyer for" a group, another "counsel for" it. Software first treats wordings as the same when they differ only in capitals, punctuation, an article or a plain plural, and never treats a change of word as trivial. A model then decides which of the remaining wordings name exactly the same relationship, and is told to keep apart anything that differs in rank, side, scope or time (a partner and a senior partner, counsel for and counsel against, a director and a former director). The documents' own wordings stay visible beside the one shown.
  • Filing facts under the entity a document meant. Each fact is labelled with the entities it is about, by the short labels (ids) the document's own entities were given. Sometimes the model uses a label it never gave to any entity, such as an abbreviation for a company it recorded under its full name. Software points a label that is only a near miss (different spacing, a shorter or longer form) at the entity meant as soon as the document is read. The rest go to a model, first thing in the finishing stage, with a few of the facts that carry the label and the document's entities; it answers which entity the label means, or none. Code checks that the answer is one of the document's own entities. The fact is then filed under that entity, on its page and its timeline, marked link inferred. A label nothing matches is dropped as before: the fact stays in the document's record but is filed under no entity. The run's processing log says how many labels named no entity, and how many were dropped.
  • Matching relationship targets named only by a label. The model that reads a document names the other side of a relationship by a short label (an id), and sometimes uses one it never gave to any entity: "northgate" for Northgate Civil Works Ltd., or a label with a stray space. Before anything is saved, software first matches a label that differs from an entity's name, alias or id only in capitals, spacing or punctuation, looking in the same document first and then in the rest of the investigation. The labels left over go to a model with the relationship, the entity that names it, the document's entities and a few similarly named entities from elsewhere; it answers which of them the label means, or none, and is told to answer none when unsure. Code checks that the answer is one of the entities it was shown, not the entity naming it, and of a fitting type (a person is never matched to a company). A relationship the model matched is marked inferred beside its target. A label nothing matches stays a lead for you to check.
  • Grouping where requests can be got. Review groups document requests by the office, registry or company the model said holds them, so one request letter can cover a group. Software groups names that differ only in capitals, punctuation or what follows a comma; it cannot tell that a registry's official name, a description of it and a service that resells its records are one place. When a run adds a request naming a place in a way not seen before, a model is shown every distinct name, including the existing groups, and gives each a short label, the same label for names of the same place. It is told to keep apart different places, such as two courts or a ministry and an agency under it. Code checks each label and groups only names that received the same one, never two that you showed apart. The requests themselves are not changed.
  • Settling the dates code could not. Before anything is saved, the dates code could not read (a period such as "April to June 2024", a quarter, a date in words, a relative date, or one written in figures that can be read two ways) go to a model with the fact and the document's own date. It answers a date, a start and an end, or nothing. Code checks every answer: it must be a real calendar date, fall within the years the document printed, and, for a date in figures, be one of its two readings. A date the model settled is marked date inferred on the timeline, with the printed wording beside it. When the step does not run or finds no answer, a date written in figures keeps its year and the rest stay off the timeline; the fact itself is always kept.
  • Writing summaries. Once an entity has come up in two or more documents, a model writes a short summary of what is known about it, citing the facts its sentences rest on. It works from the facts, not from its own earlier summary, so a mistake is not carried forward. Facts you have disputed are labelled, and the summary is told not to present them as established. The summary sits above the facts and never replaces them.
  • Writing the briefing. At the end of every run, a model writes a short memo on what came in, what is new, what connects to entities you were already tracking, and what is worth following up, citing the facts it rests on.

Checking citations is code, not a model. Each citation names a fact by its id; code turns it into a link, drops it from a summary or briefing if it names no stored fact, and labels it if you have disputed the fact. Sentences without a citation are allowed, because a summary connects and frames facts; the cited facts remain the record.

Starting a conversation with Claude is bookkeeping too: ordinary software builds a short account of the whole investigation from its records and gives it to Claude first.

Two more small models run on your computer and support Search. The embedding model (bge-small-en-v1.5 by default, run through fastembed) turns every passage and note into a numeric fingerprint of its meaning, which is what lets a search for "offshore trust" find a passage about a "shell arrangement". The reranker (bge-reranker-base) re-orders what search turns up, putting the most relevant results on top. Neither reads anything into what a document means; both just help you find things.

#Record skills

A record skill is a plain Markdown file that encodes what an experienced investigative journalist knows about one type of document: which fields are always there, which patterns are anomalous, what the terminology means, and what investigators typically miss. It is the difference between a first-year reporter reading a bankruptcy filing and a twenty-year veteran, who notices the related-party transfer buried in the creditor list.

Watchdog ships with skills for 33 document types. A quick classification step, on a small, inexpensive model, reads each document's opening pages and picks the closest skill. A document that matches none is read with general records, a framework for any unfamiliar record. Settings → Record skills lets you read every skill in full.

You can skip classification by pinning a skill: for one run with Record skill in the Add documents options, permanently with Default skill under Processing, or for one document with a sidecar file.

Skills are jurisdiction-agnostic by default: universal principles come first, with specific jurisdictions (Canada, US, UK, Australia, EU) treated as examples, not defaults.

#Financial and corporate

Skill Covers
corporate-filings Registrations, director filings, shareholder registers, beneficial ownership
financial-statements Audited statements, annual reports (10-K/10-Q), MD&A, auditor opinions, related-party disclosures
regulatory-filings Securities disclosures, insider trading reports, SEDAR+/EDGAR filings
bankruptcy Bankruptcy filings, creditor lists, trustee reports, restructuring proceedings
insurance-filings Regulatory returns, actuarial reports, reinsurance treaties, market conduct reviews
tax-documents Charity information returns (T3010, Form 990), nonprofit filings, trust returns
Skill Covers
court-documents Civil claims, affidavits, judgments, orders, injunctions
criminal-proceedings Charging documents, bail decisions, trial decisions, sentencing, forfeiture orders
administrative-tribunals Quasi-judicial bodies: housing and services human rights, competition, privacy, utility regulation
labour-arbitration Grievance awards, labour board decisions, unfair labour practices, collective agreements
immigration-refugee Asylum decisions, detention reviews, deportation orders, judicial reviews
healthcare-licensing Discipline decisions, fitness to practise, facility inspections (medicine, nursing, pharmacy)
professional-licensing Discipline decisions for lawyers, accountants, engineers, financial advisers, real estate agents
legislation Statutes, regulations, orders-in-council, bills, policy directives

#Government and public records

Skill Covers
government-contracts The full procurement lifecycle: RFPs, bids, sole-source justifications, awards, amendments, vendor performance
audit-reports Auditor general reports, performance audits, inspector general reports
government-reports Royal commissions, public inquiries, committee reports, white papers, consultations
foi-responses FOI/ATI response packages, exemption indexes, redaction logs
legislature-transcripts Hansard, committee transcripts, question period, congressional hearings
lobbying-records Lobbyist registrations, communication reports, revolving door disclosures
election-filings Campaign finance returns, donor lists, third-party advertising disclosures
municipal-records Council minutes, zoning decisions, conflict-of-interest declarations
police-records Occurrence reports, use-of-force records, public complaint decisions, coroner's inquests
corrections-records Parole board decisions, probation orders, prison inspection reports, correctional oversight
environmental-filings Pollutant release inventories, environmental assessments, compliance orders

#Property

Skill Covers
real-estate Title transfers, mortgages, liens, assessments, land registry and title systems — common law and civil law; caveats, PPSA/RDPRM charges
vehicle-registrations Motor vehicle and vessel registrations, title transfers, liens, fleet records

#Specialized

Skill Covers
academic-research Grant applications, ethics decisions, conflict-of-interest disclosures, retraction notices
aircraft-logs Aircraft registrations, ADS-B flight tracks, safety investigation reports
dns-whois WHOIS records, DNS data, IP allocation, SSL certificate transparency logs
news-clippings News articles, press releases, wire stories, corrections, retractions
audio-video YouTube transcripts, podcast transcripts, earnings calls, press conference recordings
websites-html Any HTML file or downloaded website page — both its presentation content and its underlying markup (tracking IDs, hidden elements, outbound links)

#Reading and pinning skills

#Your own skills

You can add your own skills as plain Markdown files, no code required. Settings → Record skills shows the folder they go in, with Show in folder to open it. A skill of your own overrides a built-in one of the same name, so you can adapt one to your beat by copying and editing it. Start from the template, and lead with patterns that apply anywhere, treating specific jurisdictions as examples. To contribute a skill to the project, see the authoring guide.

#What leaves your computer

Pre-processing (transcription included), search and the small local models never leave your computer and never cost anything; the only network use is downloading a model the first time it is needed. What goes to the AI provider you chose is the extracted text of each document during processing, with your investigation's brief, context.md, and during post-processing the facts, names and short quoted excerpts it works across, never the original file. That is why Watchdog must only be used on documents that are public or presumptively public.


Where next: Models and cost for which model runs each stage and what it costs, or Using Watchdog for the day-to-day work. The precise technical reference is ARCHITECTURE.md in the project's repository, and an illustrated walkthrough follows one document from dropped file to result.

Edit this page on GitHub