This page shows you how to use the Vertex AI SDK to run Vertex AI RAG Engine tasks.
You can also follow along using this notebook Intro to Vertex AI RAG Engine.
Required roles
Grant roles to your user account. Run the following command once for each of the following
IAM roles:
roles/aiplatform.user
gcloud projects add-iam-policy-binding PROJECT_ID --member="user:USER_IDENTIFIER" --role=ROLE
- Replace
PROJECT_ID
with your project ID. -
Replace
USER_IDENTIFIER
with the identifier for your user account. For example,user:myemail@example.com
. - Replace
ROLE
with each individual role.
Prepare your Google Cloud console
To use Vertex AI RAG Engine, do the following:
Run this command in the Google Cloud console to set up your project.
gcloud config set {project}
Run this command to authorize your login.
gcloud auth application-default login
Run Vertex AI RAG Engine
Copy and paste this sample code into the Google Cloud console to run Vertex AI RAG Engine.
Vertex AI SDK for Python
To learn how to install or update the Vertex AI SDK for Python, see Install the Vertex AI SDK for Python. For more information, see the Vertex AI SDK for Python API reference documentation.
What's next
- To learn more about the RAG API, see Vertex AI RAG Engine API.
- To learn more about the responses from RAG, see Retrieval and Generation Output of Vertex AI RAG Engine.
- To learn about the Vertex AI RAG Engine, see the
Vertex AI RAG Engine overview.