Back to Skills

agent-platform-rag-engine-management

Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google Workspace RAG, or other RAG products like gRAG.

14,158stars1,084forksUpdated 6/27/2026

Security Assessment

Low Risk(85/100)

Detected risks:

Agent-reviewed override(Substring false positive: 'eval(' matched 'types.Retrieval(' (the GenAI RAG SDK constructor). Remaining 'token=' is legitimate RAG auth config. Benign RAG-engine management skill.)
Security Score85/100

About agent-platform-rag-engine-management

Instructions for managing and querying Google Agent Platform RAG Engine corpora and retrieving grounded contexts using the Google GenAI and vertexai Python SDKs. It is used for listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus, and explicitly excludes standard database queries, Google Workspace RAG, and other RAG products. It mandates using the vertexai Python SDK for RAG Engine operations rather than raw REST calls or MCP tools, because the code is meant to run on external clients.

Safety is governed by confirmation tiers. Tier R covers read-only operations (list_corpora, list_files, get_corpus, retrieval_query) that execute immediately with no confirmation. Tier RC covers grounded content generation through client.models.generate_content, which consumes compute resources and requires interactive Yes/No confirmation that explicitly lists key parameters such as target corpus ID, query text, and target model; natural-language paraphrases are insufficient. A same-turn restriction forbids executing the generation in the same turn as presenting the confirmation prompt, so it must stop and wait for explicit approval first.

Before running any snippet, a Phase 0 environment setup authenticates with Google Cloud and configures Application Default Credentials via gcloud auth login and gcloud auth application-default login, creates and activates a dedicated virtual environment, and installs google-cloud-aiplatform and google-genai. A workflow decision tree first gathers Project ID, Region, and Corpus ID, preferring discovery through listing over asking the user, then routes to the requested task. The documented operations include listing and discovering corpora and files with automatic or manual pagination, getting and inspecting a specific corpus, retrieving contexts with rag.retrieval_query using similarity_top_k, and answering the user by defining a RAG Engine tool over the corpus for grounded generation. Bracketed placeholders such as project_id, region, and corpus_id must be replaced with real values before execution. Use it to operate Agent Platform RAG Engine corpora safely from client-side Python.

FAQ

Which SDK must be used for RAG Engine operations?

The vertexai Python SDK, not raw REST calls or MCP tools, because the code is intended to be run by external clients. Grounded generation uses the google-genai client.

When is user confirmation required?

For Tier RC grounded content generation via client.models.generate_content, which requires an interactive Yes/No confirmation listing exact parameters. Read-only Tier R operations run immediately without confirmation.

What is the same-turn restriction?

Generation code must not be executed in the same turn as presenting the confirmation prompt; the skill must stop, wait for explicit Yes approval, and only then execute.

What environment setup is required before running snippets?

Authenticate with gcloud auth login and application-default login, create and activate a dedicated virtual environment, and install google-cloud-aiplatform and google-genai.

How does it find a corpus if I don't know its resource name?

It lists corpora and files to discover resource names and IDs, using automatic or manual pagination, and only asks the user if discovery fails.

Install agent-platform-rag-engine-management

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

google/skills