Index of every page on this site: llms.txt
All skills
google avatar

/product-search

@ead8d7f
by googlegoogle/adk-recipes11k stars
2,961
Run it yourself

Creates product search agents with semantic search and RAG on Google Cloud (Vector Search on Gemini Enterprise Agent Platform, BigQuery, embeddings). Use when the user wants to "build a product search agent", "create an e-commerce search", "make a shopping assistant", "set up semantic catalog discovery", "ingest products into Vector Search", or "deploy a retail RAG agent". Handles the full pipeline: catalog data ingestion to BigQuery, Gemini Enterprise Agent Platform Vector Search collection setup, ADK agent scaffolding, evaluation, and Cloud Run deployment.

  • 28 files
  • 586.9 KB
  • Updated 2 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/google/adk-recipes/product-search

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesagent-example.md

≈713 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Example Agent Code

The shipping implementation is in scripts/agent.py and scripts/retrievers.py. Read those files directly -- this doc summarizes the shape so you know what to look at when adapting it.

Files

  • scripts/agent.py -- defines root_agent, a single ADK Agent with one tool (retrieve_docs) and a static instruction string focused on product search.
  • scripts/retrievers.py -- defines search_collection, the Vector Search 2.0 query that backs retrieve_docs, plus a search() convenience wrapper used by the Step 9 smoke test.

Shape

User query
    |
root_agent (Gemini, ADK)
    |  instruction = "search the catalog for every query, present results..."
    |
retrieve_docs(query)
    |
search_collection(query, collection_path, top_k=10)
    |
vectorsearch.DataObjectSearchServiceClient.search_data_objects(
    SemanticSearch(search_text=query, search_field="text_embedding",
                   task_type="QUESTION_ANSWERING", top_k=10,
                   output_fields=[product_id, name, price, description,
                                  category, brand, rating, stock])
)
    |
Formatted "Product 1: name, $price, by brand, rated X/5, <desc snippet>" string

Configuration

The agent reads these env vars at runtime:

Variable Default Purpose
GEMINI_MODEL gemini-3.5-flash LLM used by root_agent
GOOGLE_CLOUD_PROJECT from ADC GCP project for Gemini Enterprise Agent Platform
GOOGLE_CLOUD_LOCATION global LLM region
VECTOR_SEARCH_LOCATION us-central1 Vector Search region (used to build the default collection path)
VECTOR_SEARCH_COLLECTION projects/<project>/locations/<region>/collections/retail-skill-products-collection Full collection resource path

VECTOR_SEARCH_COLLECTION must match the regex projects/<p>/locations/<r>/collections/<id> with no whitespace. A newline embedded mid-path (common from multi-line shell pastes) causes the SDK to return a confusing 501 -- scripts/agent.py validates this up front.

Extending

To add a tool (e.g. cart actions, inventory checks, price-history lookups):

  1. Define a function in scripts/agent.py with a docstring describing when to use it -- ADK feeds the docstring to the LLM as the tool description.
  2. Append it to the tools=[...] list on root_agent.
  3. Update the instruction string so the LLM knows when to pick the new tool over retrieve_docs.

To change the LLM, set GEMINI_MODEL -- no code changes needed.

To change the retrieval contract (different fields, different top_k, filtering), edit search_collection in scripts/retrievers.py. Note that VS 2.0 semantic search has no built-in structured filters; any price/stock/category gating must happen in the agent's prompt or in a client-side post-filter.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at ead8d7f. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 2 months ago
metadata
{
  "author": "Google",
  "license": "Apache-2.0",
  "version": "0.2.0"
}

README badge

README badge for google/adk-recipes/product-search