I’m unable to import RAG into my cloud run docker managed environment. I’m using vertexai version 1.110.0 and none of these work…
from vertexai.generative_models import GenerativeModel, Tool, RagRetrievel
from vertexai.generative_models import GenerativeModel, Tool, Retrievel
from vertexai.generative_models.grounding import RagSource, Retrieval
Gemini (2.5 pro) and I iterated to get to a realization that RAG not longer exists as an explicit component of Vertex AI. Gemini summarizes it will here…
The modern, correct pattern for building a RAG application on Google Cloud involves using two different services and their corresponding client libraries:
-
Retrieval (The “R” in RAG): You use the Vertex AI Search client library (google-cloud-discoveryengine) to connect to your data store (your RAG corpus) and find the most relevant documents for a user’s query.
-
Generation (The “G” in RAG): You take the documents retrieved from the search step and pass them, along with the original query, to the Vertex AI Generative Models library (google-cloud-aiplatform) to generate the final answer.