Skip to content

Get document loading right.

Compare loaders, trace every step and evaluate what reaches your model.
Terminal window
uv tool install complydoc

OCR and name detection are optional extras. complydoc doctor reports which are installed and what their absence leaves out of a run.

import complydoc as cd
with cd.observe("contracts-ingest"):
documents = PyMuPDF4LLMLoader("contract.pdf").load()
chunks = splitter.split_documents(documents)
vector_store.add_documents(chunks)

Each loader, splitter, embedding call and vector store becomes a step of a trace, written to .complydoc, with each document followed through them and warnings for the failures that raise no error. Open it with complydoc ui.

complydoc ui opens every report and pipeline run in a folder in your browser, served from your machine. A trace shows the calls in a tree with each one’s input and output; a document shows every page with the chunks drawn over its text and each finding in place; two readers of a document show as a diff. See The report viewer.

The report itself is JSON, carrying schema_version, currently 27. Identifiers are masked everywhere in it, including the page text, unless the run used --reveal; --page-images adds a picture of each page, which shows them, kept in a .parts folder beside the report rather than inside it.

The process makes no outbound connections of its own. Before any file is opened, socket.socket.connect, connect_ex, socket.create_connection and socket.getaddrinfo are replaced with functions that raise. AF_UNIX sockets are permitted. Each report records whether the guard was active. Model prices are vendored as data files.

A pipeline observed with cd.observe may need the network, for an embedding API say: inside the block, its connections go through and each is recorded against the step that made it. Two things a caller can ask for send data out themselves. An instruction classifier backed by a hosted service sends the passages it judges; the report names the hosts in run.content_sent_to, states it as an important limitation, and expect(report).no_network() fails. complydoc assist sends a finished report to a hosted chat model. Both need allow_network=True and neither runs as part of an audit. See Network isolation.

  • Masking is best effort. Categories with a checksum are confirmed; names and organisations come from a statistical model and are missed at some rate.
  • Unmeasured signals are reported as unmeasured and excluded from scores.
  • Table fidelity describes the extractor that ran. Only an extractor that reads table structure detects a table at all, so the measurement is of that reader’s own text.
  • Hidden-content checks cover PDF text layers and the markup of Word, Excel, PowerPoint, HTML, Markdown and email files, not text inside images.

A hosted companion for teams, complydoc Cloud, is planned. Say if your team would use it.