RAG Agent — Agent Platform Search
A starter RAG agent that answers questions grounded on documents indexed in Agent Platform Search (Discovery Engine). Documents land in a GCS bucket and are ingested automatically by a GCS Data Connector — no separate ingestion pipeline is required.
Content
RAG Agent — Agent Platform Search
A starter RAG agent that answers questions grounded on documents indexed in Agent Platform Search (Discovery Engine). Documents land in a GCS bucket and are ingested automatically by a GCS Data Connector — no separate ingestion pipeline is required.
Agent Details
| Attribute | Detail | | :-- | :-- | | Interaction Type | Conversational | | Complexity | Intermediate | | Agent Type | Single Agent | | Components | Tools, RAG, Terraform, Evaluation |
How it works
app/agent.py— ADK agent wiring the search tool.app/retrievers.py—create_search_tool()returns aVertexAiSearchToolbound to the data store (or a mock whenINTEGRATION_TEST=TRUE).infra/terraform/— provisions a docs GCS bucket, a GCS Data Connector, and a search engine over the auto-created data store.
Setup
cp .env.example .envand setGOOGLE_CLOUD_PROJECT.- Provision the datastore: edit
infra/terraform/vars/env.tfvars, thenmake setup-infra. - Copy the Terraform outputs into
.env: setDATA_STORE_IDandDATA_STORE_COLLECTIONfromdata_store_id/data_store_collection(the connector auto-generates these; the defaults may not match). - Load documents:
make upload-sample-data(uploads the bundledsample_data/, or copy your own files to the bucket), thenmake ingestto trigger an immediate sync (otherwise the connector waits for its daily refresh).
Run
make install && make playground
Select the app folder, then ask a question such as *"What is the payload and battery life of the Atlas-7 robot?"*
Test
make test runs the integration test. The retriever is mocked (INTEGRATION_TEST=TRUE), but the agent still makes a live Gemini call, so Google Cloud credentials (ADC) and Vertex AI access are required. Without credentials the test is skipped.
CI/CD
These recipes don't bundle a deployment pipeline. Documents are kept fresh by the GCS Data Connector, which re-syncs on its data_connector_refresh_interval (default daily); call make ingest from CI (or locally) to force a sync. To deploy the agent, use the ADK-native path — e.g. uv run adk deploy cloud_run . or adk deploy agent_engine (not the deprecated agent-starter-pack tooling).
Looking for vector search instead?
See [rag-vector-search](../rag-vector-search) for a Vector Search 2.0 variant, or [multiformat-hybrid-rag](../../../contrib/python/multiformat-hybrid-rag) for a production hybrid (semantic + keyword) system.
Source and license
- Source
- Google ADK Samples
- Original
- google/adk-samples/core/python/rag-agent-search
- License
- Apache-2.0