Skip to content

Ingest documents (unstructured)

Unstructured documents (PDF, DOCX, PPTX, email, calendars, audio) are ingested into a per-tenant Lance dataset so the engine’s RETRIEVE(...) form can serve them. Documents do not use Meltano/Singer (that path is tabular-only) — the unstructured-runner is a separate runner that reuses the same connector model, S3 conventions and in-cell Dagster (unstructured_sync_job).

extract source → text extraction (pdfminer / python-docx / … / whisper.cpp)
→ optional PII masking → chunk
→ s3://tenant-<id>/landing-docs/<connId>/*.jsonl (text + metadata, NO vectors)
load landing JSONL → embed → atomic per-doc upsert → Lance
→ vector + scalar + full-text indexes → completion callback

Splitting the expensive extraction from the cheap embed/load means an embedding-model or ACL change re-runs only load against the landing checkpoint — you don’t re-transcribe an audio archive to change embedders.

Bytes come from pluggable source providers: local/S3/Azure/GCS object stores, Google Drive, Gmail, Microsoft 365 mail and calendars. Non-sensitive settings go to a ConfigMap and credentials to a Secret (fail-closed); the Dagster op mounts both into the Job. The external-side setup for the SaaS sources is under Configure your sources.

The default image handles plain-text formats, text-based PDF, DOCX, PPTX, XLSX, OpenDocument and .eml/.msg mail. Unsupported formats (legacy .doc/.ppt) are skipped cleanly, and a per-document error never aborts the batch. The image ships no models, so two families need operator-mounted assets:

  • Audio and video are transcribed only when a speech-to-text engine is mounted (whisper.cpp, optionally Parakeet for opted-in languages); otherwise an audio document fails closed with asr_not_configured.
  • Images and scanned PDF pages are read only when the OCR assets are mounted; otherwise images are skipped and scanned pages stay without text.

See Configure redaction versions.

The runner reads its collections (UnstructuredFacets) from the same two sources as the engine: the optional bootstrap manifest and the published store the engine writes on POST /osl/objects. A collection published through the API is therefore what the next sync ingests into — no ConfigMap has to be edited. GET /osl/facet-defaults returns the cell’s embedding contract and a complete, valid facet template, so a first collection can be created without authoring the contract by hand.

Mail connectors land each attachment as its own document. Each landed part carries two structural keys when the facet declares them as metadata_fields: parent_doc_id (the doc_id of the root message; null on the root) and part_kind (body, attachment, inline, embedded, other). Parts inherit the root message’s ACL and region fields at ingest — a part is never readable by a principal who cannot read its root. A forwarded message is expanded once into embedded parts that name the outer root. This is the connector side of RFC 0009 Draft; root-grain counting in the engine is not part of this release.

Release images contain no model weights or model caches and never fetch a model at build or start-up. The embedder that vectorizes passages and queries is a binding the operator supplies, and it must be identical for the query service and every job that writes embeddings:

Provider / runtime Use
hash / hash The chart default — deterministic, model-free plumbing for quickstarts and governance demos. No semantic ranking; never use it for production data.
local / sentence-transformers An operator-hosted model: you pre-load a PVC or CSI volume and mount the model directory read-only at embedder.modelPath.
external / openai-compatible An operator-hosted endpoint: embedder.baseUrl, an explicit revision, an existing Kubernetes Secret for the API key, and narrowly scoped egress.
  • PII masking at extract is a per-cell choice — documentPii.masking in the tenant-mgmt-api chart, off by default. With it on, the regex detectors replace emails, phones, IBANs, cards and Spanish DNI/NIE with placeholders before landing. With it off, text and metadata land as extracted (so case numbers and payment references stay readable); the detectors still run and raise each chunk’s sensitivity to confidential, so policy tier caps and ACLs keep governing who reads it. Switching the value re-materializes every document on the next sync.
  • Named redaction versions always mask: the runner persists one separately-embedded Lance table per declared version, plus a redacted copy of each document. Versioned ingestion requires a facet acl_field and a non-empty default ACL — extract and load refuse to write if either is missing.
  • A profile or detector change re-materializes affected documents; if any write fails, the runner removes the document from every materialization (base first) rather than leaving an older, less-redacted generation readable.
  • Deletions at the source are applied. Every sync of a file store lists the whole source; a document no longer listed (and, for mail, a part a message no longer produces) is removed from the base table and every redaction-version table at the next load, with its copies and media. The removal is recorded on the audit trail first, and nothing is removed without that record; a listing that would remove too much is held for an operator. See Documents deleted at the source.

Once loaded, passages are served only through the governed RETRIEVE(...) form of POST /osl/query — ACL’d, redacted server-side, with citations preserved — and counted through osl.documents.<facet>.