
Retrieval-augmented generation (RAG) gives a model the relevant pieces of your documents at question time. On the Professional Agentic Architect exam, RAG architecture comes down to understanding the stages of the pipeline and fixing each quality problem at the stage where it starts. A change made at retrieval cannot recover text that was missed during import, and a change made at import cannot stop unrelated chunks from being returned for out-of-scope queries.
A RAG pipeline splits its work between import time, when documents are prepared and stored in a corpus, and query time, when contexts are selected for a request. The pipeline runs through five stages in order:
Each common failure mode maps directly to one of these stages. Text that never got extracted from source files is a parsing problem at import. Loosely related chunks returned for questions outside the corpus are a retrieval filter problem. A relevant chunk that gets retrieved but sits too far down the result list is a ranking problem. When troubleshooting a RAG Engine deployment, we trace the symptom back to the stage where it begins, because changes at other stages cannot fix it.
Parsing decides what text enters the corpus in the first place. Anything the parser fails to extract is simply absent, so later stages such as chunking, embedding, and retrieval can only work with what parsing produced.
RAG Engine offers the Document AI layout parser as a parsing option. Google describes the layout parser as the most accurate RAG Engine option for documents that contain images or charts. It combines OCR models with Gemini, so it recovers text in scanned images and keeps the structure of tables intact, both of which default parsing can lose.
Parser choice takes effect at import time. Files that were already imported into a RAG Engine corpus are not parsed again automatically, so moving existing content to the layout parser means deleting those files from the corpus and importing them again with the layout parser enabled.
Chunking settings such as chunk size and overlap also apply at import, and they control how extracted text is split into chunks. The corpus as a whole is what keeps requests small, because only the best chunks reach the model, while sending whole documents inline makes every request grow as the corpus grows.
Retrieval returns the most similar chunks it can find, and similarity is relative. Without a cutoff, the top results come back whether or not any of them is actually close to the query.
In RAG Engine, a threshold in the filter of the retrieval configuration sets that cutoff. Setting filter.vector_distance_threshold returns only contexts whose vector distance is smaller than the threshold, so a query with no close match can return no contexts at all. RAG Engine also offers vector_similarity_threshold as an alternative field that keeps contexts above a similarity score. Only one of vector_distance_threshold or vector_similarity_threshold can be set in a retrieval configuration.
A threshold works alongside top_k, which sets how many contexts retrieval returns. The two control different things: top_k sets quantity, while a threshold sets how close a context must be to count at all.
Retrieval orders chunks by vector similarity. Reranking runs after retrieval and scores each retrieved chunk against the query, moving the most relevant contexts to the top of the list. It changes the order of chunks that retrieval already found, which makes it a different tool from top_k and thresholds, since those decide how many chunks come back and which ones qualify.
RAG Engine configures reranking in the ranking field of the retrieval configuration, and Google offers two kinds of reranker:
rank_service entry that names a ranker model such as semantic-ranker-default@latest. Using the ranking API requires the Discovery Engine API to be enabled.For workloads with tight latency requirements, that gap matters, because reranking adds its time to every request that uses it.
For the Professional Agentic Architect exam, the main architectural habit for RAG Engine is aligning each failure with the exact stage that controls it. Missing text from scanned images, tables, or charts requires deleting and re-importing files with the Document AI layout parser. Unrelated results on out-of-scope queries require a vector_distance_threshold or vector_similarity_threshold in the retrieval filter. Relevant chunks that are retrieved but ranked too low require reranking in the ranking field, choosing the standalone semantic reranker when latency must stay low.
Our Professional Agentic Architect practice exams test retrieval-augmented generation alongside document parsing and retrieval configuration in RAG Engine, with detailed explanations that drill these distinctions.