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 Databricks Vector Search for RAG

ADK with Databricks Vector Search for RAG

Author: Venkata Sudhakar

Retrieval-Augmented Generation (RAG) improves agent accuracy by retrieving relevant documents at query time and including them as context. Databricks Vector Search is a managed vector database built directly into the Databricks platform, backed by Delta Lake. It keeps embeddings in sync with source Delta tables automatically, eliminating the need to manage a separate vector store.

ShopMax India stores product manuals, warranty policies, and support knowledge articles in Delta Lake. The data engineering team creates a Vector Search index over these documents. An ADK agent retrieves the most relevant passages using semantic search and passes them to Gemini as grounding context before generating a response.

The below example shows how to create a Databricks Vector Search retrieval tool and attach it to an ADK agent for ShopMax India document Q&A.


It gives the following output,

VectorSearchClient connected: adb-1234567890.azuredatabricks.net
Endpoint: shopmax-vs-endpoint (ONLINE)
Index: shopmax.docs.knowledge_base_index
  Source table: shopmax.docs.knowledge_base
  Embedding model: databricks-gte-large-en
  Sync status: SYNCED (1,247 documents)
RAG agent ready. Vector Search index: shopmax.docs.knowledge_base_index

The below example shows the RAG agent retrieving passages and answering two ShopMax India customer support questions grounded in the knowledge base.


It gives the following output,

Customer: How do I register my Samsung TV warranty purchased at ShopMax?
Agent: [Source: Samsung TV Warranty Registration Guide]
  To register your Samsung TV warranty purchased at ShopMax India:
  1. Visit samsung.com/in/support/warranty or scan the QR code on the box.
  2. Enter your serial number (found on the back panel or invoice).
  3. Upload your ShopMax India purchase invoice as proof of purchase.
  4. Registration must be completed within 30 days of purchase.
  You will receive a confirmation SMS to your registered mobile number.

Customer: What does the extended warranty cover for laptops bought at ShopMax India?
Agent: [Source: ShopMax India Extended Warranty Terms - Laptops]
  The ShopMax India extended warranty for laptops covers:
  - Hardware failures: motherboard, display, keyboard, battery degradation
  - Accidental damage: one claim per year for drops and liquid spills
  - Free pick-up and drop service from any Indian address
  It does not cover software issues, virus damage, or theft.

Databricks Vector Search as a RAG backend gives ShopMax India automatic document freshness - when the knowledge base Delta table is updated with new product manuals or revised policies, the vector index syncs automatically. The ADK agent always retrieves from the latest content without any redeployment or prompt engineering changes.


 
  


  
bl  br