Skip to content

Private retrieval

Partial

Private embeddings are stored, but task context currently selects sources lexically. Dense fusion and reranking remain targets.

Code and tests

Private indexing stores embeddings, but the current task-context path uses lexical retrieval. addPrivateSources in services/product-worker/internal/capabilities/context.go calls ListPrivateContext from internal/database/queries/context.sql; it does not run the reference category-stratified dense/RRF/reranking pipeline.

flowchart LR
  Scope["Tenant, conversation and selected documents"] --> Auth["Check selected-document access"]
  Auth --> Ready["Check generation readiness for pinned profile"]
  Ready --> Query["Lexical private context query"]
  Query --> Bound["Bound text and record locators"]
  Bound --> Context["Sources, dependencies and coverage flags"]

A document ID supplied by a caller does not grant access; the worker checks authorization before adding it to context. Index readiness is checked against the workspace’s selected configuration, so another model’s vectors cannot satisfy it. Context has size limits and reports omissions instead of implying that the whole matter was read. Each selected passage retains its source version and location for evidence checks.

Dense candidate retrieval, category-aware fusion, reranking, neighbor expansion and a coverage receipt remain work to port and evaluate. The legacy budgets and thresholds are not the current worker’s behavior. When porting, put tunable values in a runtime configuration or golden fixture consumed by the tests, with named parity cases; do not create a second specification in prose.

Search configurations explains the implemented profile selection, and Storage & indexes explains publication.