One question from the browser to the answer, across the SPA, app, Postgres, the rt workers, Qdrant, and the LLM
The web request ends at step 3. Everything after that is asynchronous: the doc_tasks row in Postgres is the only channel between the app process and the rt process, and its status column is the state machine the browser polls. The vector store shown is Qdrant; ChromaDB and pgvector follow the same path.
Numbered arrows are messages in time order, top to bottom. Solid arrows are calls, dashed arrows are returns or polled reads. A black pill on the Postgres lane is the doc_tasks.status value written at that step. Shaded bands group the steps into the four phases.
Task status machine
Status
Name
Written by
Meaning
0
QD_INIT
app
Row inserted; question and the group's VDB and LLM config snapshots stored
1
QD_INIT_FETCHED
rt main loop
Picked up; options validated
2
QD_VDB_PENDING
rt main loop
Queued to a VDB worker process
3
QD_VDB_FETCHED
VDB worker
Retrieved chunks saved in context_json
4
QD_LLM_PENDING
rt main loop
LLM thread started
5
QD_LLM_WRITING
LLM worker
Streaming; partial answer visible to the SPA
6
QD_LLM_FETCHED
LLM worker
Complete; answer and timings final
-1 / -3 / -6
QD_INIT_ERROR / QD_VDB_ERROR / QD_LLM_ERROR
stage that failed
Terminal; status_text and exc_text carry the reason
What the browser sees
The QueryDocuments page submits once, then polls the task by uuid on a timeout loop. Each poll returns the status, a status text, a percent derived from status divided by six, the answer so far, and once complete the retrieved documents from context_json rendered as sources. Polling stops when the status is 6 or negative.
Retrieval parameters in play
The group's VDB row carries the embedding model name, the Qdrant collection, a retrieval parameter set, and optional retrieval filters. The parameter set selects the LangChain retriever mode, one of similarity, mmr, or similarity with a score threshold, with k, fetch_k, lambda_mult, and score_threshold. The filters become a Qdrant payload filter so the search is restricted to matching metadata before similarity is computed.