You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today documents.ingest(...) returns one terminal Document (status ready or failed). There is no public hook to observe what stage the pipeline is in (parsing → cleaning → splitting → embedding → indexing).
For comparison, Dify's dataset API exposes 8 states (waiting / parsing / cleaning / splitting / indexing / completed / error / paused) with per-stage timestamps (parsing_completed_at, cleaning_completed_at, splitting_completed_at, ...) and segment counters (completed_segments / total_segments). This lets a UI render a real progress bar instead of a spinner.
Why this matters for production
Long ingests (large PDFs, slow embedding providers) look frozen to the operator with no signal.
Consumers (e.g. llm-agent) currently store only pending → ready | failed in their durable registry because that is all xrag exposes — see docs/rag/architecture.md §3 in the consumer repo.
Without per-stage timestamps it is impossible to know whether a given ingest is slow at parse, embed, or upsert. That is the first question on every prod incident.
Proposed shape
Two non-mutually-exclusive options:
Option A — callback (additive, no async-generator return-type change)
Context
Today
documents.ingest(...)returns one terminalDocument(statusreadyorfailed). There is no public hook to observe what stage the pipeline is in (parsing → cleaning → splitting → embedding → indexing).For comparison, Dify's dataset API exposes 8 states (
waiting / parsing / cleaning / splitting / indexing / completed / error / paused) with per-stage timestamps (parsing_completed_at,cleaning_completed_at,splitting_completed_at, ...) and segment counters (completed_segments / total_segments). This lets a UI render a real progress bar instead of a spinner.Why this matters for production
llm-agent) currently store onlypending → ready | failedin their durable registry because that is all xrag exposes — seedocs/rag/architecture.md §3in the consumer repo.Proposed shape
Two non-mutually-exclusive options:
Option A — callback (additive, no async-generator return-type change)
where
Option B — async iterator variant for callers who prefer pull semantics:
Either works; A is the smaller change.
Acceptance
startedandcompleted(and optionallyprogressupdates for embed/index where unit counts are known).failedbefore the finalXragErroris raised.