Skip to content

Vault OCR scan, search and sidecars

State: open/building · Kind: module · Audience: system

  • Extracts text from a vault’s images and PDFs, caches it in one index file, and ranks search hits over it.
  • Optionally writes the text back as idempotent .ocr.md sidecar notes.

The crate scans a vault’s attachments with an injected OCR engine (macOS Vision or tesseract), saves results to a combined scan cache and search index at the vault’s OCR state dir (vault_state_dir(<id>, "ocr")/index.json), and skips files that have not changed. It tokenizes, scores and snippets queries against that index, and writes sidecar notes next to each asset without rewriting unchanged ones. The engine is a seam, so the whole pipeline runs against a fake engine in tests. It is a library behind the OcrPort host surface; it has no binary of its own.

  • run_scan: walk, OCR, save, sidecars and report, with progress and a cache keyed on file size and mtime
  • search_index and search_response: tokenize, score, snippet and rank over the index
  • write_sidecar and compose_sidecar: idempotent .ocr.md write-back
  • OcrIndex store: bit-exact mtime round-trip shared with the node arm
  • config read from _system/ocr.md, validated by determined-contracts
  • engine seam with Vision and tesseract adapters, plus a public fake-engine test harness
  • solutions/determined/crates/determined-ocr/src/port.rs (RustOcr implements determined_core::ports::OcrPort)
  • solutions/determined/crates/determined-ocr/src/engine/
  • solutions/determined/crates/determined-ocr/
  • solutions/determined/crates/determined-ocr/src/scan.rs#run_scan
  • solutions/determined/crates/determined-ocr/src/search.rs#search_index
  • solutions/determined/crates/determined-ocr/src/sidecar.rs#write_sidecar
  • solutions/determined/crates/determined-ocr/src/store.rs#OcrIndex

← Back to Capabilities