Skip to main content
The update stage connects four interfaces: Source, Extractor, GraphStore and Resolver. An Embedder and a Decider serve indexing and search. Each interface is a Protocol, so a test can pass a fake. The pages for each package list every class and function. This page shows the contracts.

Pipeline interfaces

For the Extractor, changed is the fingerprints of the passages to work on, and every other passage is left alone. context_only means the text did not change, so the extractor re-chooses contexts without re-extracting.

The embedder contract

  • One vector per text, in order.
  • Every vector has dimensions values and unit length, so cosine is a dot product. A text with no content may embed to the zero vector.
  • kind is "document" for stored text (concepts and contexts) and "query" for a search question. Models with separate query and document prompts use it, and the others ignore it.
  • embedding.check_vectors verifies a batch against this contract.

The update stage

Update runs daily, and also at each document’s next validity boundary. It does three things:
  1. It compares Source.manifest() with GraphStore.versions(), part by part.
  2. For each new or changed unit, it reads the document and decides what to run on and what to replace:
    • New unit: every passage, and the whole unit is replaced.
    • File or passages changed: the new or changed passages, replacing those plus any passages that disappeared.
    • Metadata only: the passages whose pinned choice was made under other metadata, for context only, replacing those.
    It then validates and applies the result. A contribution whose replaces does not match is an extractor bug and stops the update.
  3. For each unit that is no longer valid, it calls drop_unit. Every created, merged, moved, deprecated or deleted concept gets an entry in log.md.

The resolver

The resolver confirms evidence in three steps:
  1. Hash the faithfully normalized passage at start.
  2. If that fails, slide across the passage looking for the fingerprint, and record the new start.
  3. If the fingerprint is found nowhere, mark the evidence stale.
Faithful normalization means Unicode NFC and runs of whitespace collapsed. Case, diacritics, punctuation, digits and symbols are kept. The lossy normalization used to match user words is never used here. The resolver has its own connection pool and fails open on timeout. It is never asked about a document the reader has not cleared.

The query

The reader decides access_filter, and ladyGraph applies it without judging it. Concepts are filtered too, not only passages, because concept text is written from the sources. Callers use the Python library directly.

What implements each interface

core

The records and the interfaces.

retrieval

Searcher and SearchConfig.