From a5fd5f58e84ee4571aa74066132b02d926358da0 Mon Sep 17 00:00:00 2001 From: chrischristiansen-glitch Date: Sun, 24 May 2026 16:13:24 +0200 Subject: [PATCH] fix: switch RAG corpus to Serverless mode (RagManagedDb) in us-central1 --- agents/rag/setup_corpus.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/agents/rag/setup_corpus.py b/agents/rag/setup_corpus.py index 6b6861e..29386fa 100644 --- a/agents/rag/setup_corpus.py +++ b/agents/rag/setup_corpus.py @@ -3,9 +3,8 @@ setup_corpus.py — Create a Vertex AI RAG Engine corpus and import documents. Project: propane-will-491900-m5 -IMPORTANT: RAG Engine in us-central1 requires allowlist access. -Contact: vertex-ai-rag-engine-support@google.com -Alternative: Use us-east1 or us-east4 for immediate access. +Serverless mode (RagManagedDb) — no allowlist required. +Region: us-central1 """ import os @@ -13,7 +12,7 @@ import vertexai from vertexai import rag PROJECT_ID = "propane-will-491900-m5" -LOCATION = os.environ.get("RAG_LOCATION", "us-east1") # change to us-central1 after allowlist +LOCATION = os.environ.get("RAG_LOCATION", "us-central1") CORPUS_DISPLAY_NAME = os.environ.get("RAG_CORPUS_NAME", "oavauco-knowledge-base") GCS_SOURCE = os.environ.get( "RAG_GCS_SOURCE", @@ -31,9 +30,12 @@ def main(): corpus = c break else: - print(f"Creating RAG corpus '{CORPUS_DISPLAY_NAME}' in {LOCATION}...") + print(f"Creating RAG corpus '{CORPUS_DISPLAY_NAME}' in {LOCATION} (Serverless)...") corpus = rag.create_corpus( display_name=CORPUS_DISPLAY_NAME, + backend_config=rag.RagVectorDbConfig( + rag_managed_db=rag.RagManagedDb() # Serverless — no Spanner + ), ) print(f"Corpus created: {corpus.name}")