Adding a source to an existing index is unverifiable: no corpus audit, no staging path, no before/after baseline

Aperta
#679 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
28/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend, databases

Direzione di ricerca

No implementation files or tests are named. First read the existing IRagDataManager, evaluation, shadow-pipeline, and PgVectorStore surfaces referenced in the issue, then discuss which of the sketched directions should be proposed. Done is not defined yet: the issue explicitly invites design decisions about scope and API ownership.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement question

Adding a source to an index that already holds a corpus is currently an unverifiable operation: nothing in the library tells you what the new data did to the old data, before or after it lands.

The question came from a real one — "we ingest from different sources; how do we confirm the ingested data is correct?", then "I already have a big index and want to add a source without wrecking it." The answer today is a list of parts, not a path.

What already exists, and what it does not cover

Piece Covers Does not cover
IRagDataManager.GetDocumentsAsync / GetChunksAsync / GetStatsAsync reading back what was ingested, per document no filtering — by tag, by source, by ingest time; a big corpus comes back whole or one id at a time
EvaluationDatasetBuilder + RagasEvaluationSuite + RagAbTester measuring answer quality, with confidence intervals requires you to assemble the before/after harness yourself
UseShadow<TSecondary> a candidate pipeline against live traffic needs a second fully-built pipeline; nothing helps you construct the staging one
Rag.NET.Diagnostics traces per-query chunk scores by stage one query at a time, after the fact
UseEmbeddingVersioning detecting a model change per document only fires when the model identity string changes
ragnet CLI ingest, query no inspect, no audit, no diff

The three ways a new source damages an existing index

All three are silent today.

  1. Document id collisions. Store is an upsert on (document_id, chunk_index). A new source reusing an existing id without IngestionOptions.Overwrite replaces the first N chunks and leaves every chunk past the new length in place — one document assembled from two sources.
  2. An incompatible embedder. Two models at the same dimension count are structurally interchangeable and semantically incomparable. UseEmbeddingVersioning catches a changed identity string; it cannot catch a deployment repointed at a new model behind an unchanged name, which is the Foundry case documented in #663.
  3. Dilution. The new source is extracted correctly and still degrades retrieval by winning top-k from better chunks. Only measurable, and only against a baseline taken before the ingest.

Gaps this would close

  • No way to list or delete by source. DeleteAsync is per document id, RetrievalOptions.MetadataFilter is equality-only — so a single index cannot answer "what would retrieval return without this source?", and rollback depends on having recorded every id yourself.
  • No staging path. PgVectorStore reads and writes a fixed rag_chunks table, so an isolated trial index means a second connection string and a second ServiceProvider; CreateCollectionAsync makes tables the pipeline never queries.
  • No corpus audit. Chunk-length distribution, empty or near-empty extractions, near-duplicate chunks, per-source counts — the signals that say a PDF OCR'd into soup or an HTML crawl ingested nav chrome — are computable from the sidecar store and computed by nothing.

Not yet a proposal

Sketching only, to give the discussion something to disagree with:

  • an audit surface over IRagDataManager — filter by tag, distributions, duplicate detection, per-source counts — plus ragnet audit over it;
  • a documented stage-and-promote recipe, with whatever the library needs to make a second index cheap to stand up;
  • a before/after harness that wraps EvaluationDatasetBuilder and RagAbTester into one call, since the baseline has to be taken before the change and that is the step people skip.

@StefH — worth your opinion, specifically

  1. Does stage-then-promote belong in the library at all, or is it an application concern the docs should describe and nothing more? I lean toward a recipe plus small primitives, but that may be the wrong instinct.
  2. If IRagDataManager grows a filtered read surface, is that the right home, or does an audit live outside the interface reading the sidecar directly?
  3. Delete-by-metadata-filter across seven stores — plausible to make uniform, or an invitation to seven subtly different semantics? Today delete is per document id everywhere, which is at least consistent.
  4. Anything from your own work that solved the shape "validate a change against production data before it reaches production"? That is the part I would rather borrow than invent.
Lingua principale
C#
Stelle
5
Fork
2
Merge medio
14h 28m
PR unite (30g)
190

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MarcelRoozekrans/Rag.NET

Tutte le issue di MarcelRoozekrans/Rag.NET

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.