tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Generative AI > Google Gemini API > ADK with Vertex AI Matching Engine for Semantic Search

ADK with Vertex AI Matching Engine for Semantic Search

Author: Venkata Sudhakar

Vertex AI Vector Search (formerly Matching Engine) indexes millions of embeddings and returns nearest neighbours in milliseconds. ADK agents can use it as a tool to perform semantic product search, find similar support tickets, or retrieve relevant knowledge base articles. ShopMax India uses it to power a semantic product search agent that understands natural language queries like "affordable noise cancelling headphones for commuting".

The workflow: embed your product catalogue using Gemini Embeddings API, index the vectors in Vertex AI Vector Search, then expose a search tool to your ADK agent. The agent embeds the user query and queries the index to find the most relevant products.

The below example shows how ShopMax India builds a semantic product search tool for their recommendation agent.


Creating the search tool and wiring it to an ADK agent,


It gives the following output,

Embedded: Sony WH-1000XM5 (768 dims)
Embedded: Boat Rockerz 450 (768 dims)
Embedded: Samsung Galaxy Buds2 Pro (768 dims)

Search results for "affordable headphones for commuting":
1. P002 - Boat Rockerz 450 (similarity: 0.924) - Rs 1,299
2. P003 - Samsung Galaxy Buds2 Pro (similarity: 0.871) - Rs 8,999

Best match under Rs 3,000: Boat Rockerz 450 at Rs 1,299.
Great for commuting with 15-hour battery life.

For production at ShopMax India with a catalogue of 50,000 products, use Vertex AI Vector Search streaming updates to add new products to the index without full re-indexing. Set up a Cloud Function triggered on product creation events in Firestore to automatically embed and upsert new items into the index.


 
  


  
bl  br