A RAG pipeline has an ingestion path and a query path. During ingestion, it parses documents, splits them into useful chunks, creates embeddings, and stores text, vectors, metadata, and access rules.
During a query, it:
Rewrites or expands the user's question when needed.
Retrieves candidate chunks with vector, keyword, or hybrid search.
Filters and reranks the candidates.
Builds a prompt from the best evidence.
Generates an answer with source references.
The application then validates citations, logs the stages, and collects feedback from real users. Each stage needs separate evaluation so a retrieval miss is not mistaken for a generation failure.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.