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 Unity Catalog Functions as Tools

ADK with Unity Catalog Functions as Tools

Author: Venkata Sudhakar

Databricks Unity Catalog is a unified governance layer for data and AI assets. Beyond tables and views, Unity Catalog lets you register Python and SQL functions that can be discovered, versioned, and access-controlled like any other data asset. The databricks-langchain SDK exposes these functions as callable tools that ADK agents can use directly.

For ShopMax India, the data engineering team registers reusable business logic functions in Unity Catalog - top product rankings, customer lifetime value calculations, and stock alert checks. ADK agents consume these functions as tools without reimplementing the logic, and Unity Catalog tracks every invocation for audit and lineage purposes.

The below example shows how to register a Python function in Unity Catalog and wrap it as an ADK tool for ShopMax India agents.


It gives the following output,

Function registered: shopmax.analytics.top_products_by_city
Owner: data-engineering-team
Catalog: shopmax | Schema: analytics
Grants: EXECUTE granted to analysts, adk-agents service principal
Lineage tracking: enabled

The below example shows how to load Unity Catalog functions as ADK tools using the UCFunctionToolkit and run an agent session that calls them for ShopMax India queries.


It gives the following output,

Loaded 3 Unity Catalog tools
Calling: shopmax.analytics.top_products_by_city(city_name="Hyderabad", top_n=5, days_back=60)

Top 5 products in Hyderabad (last 60 days):
1. Samsung 55" QLED TV    - Rs 22,10,000 (49 units)
2. iPhone 15 Pro 256GB    - Rs 18,75,000 (50 units)
3. LG 1.5T Inverter AC    - Rs  9,36,000 (156 units)
4. Sony WH-1000XM5        - Rs  6,27,750 (139 units)
5. iPad Air M2 256GB      - Rs  5,98,000 (34 units)

Lineage recorded: adk-agents -> shopmax.analytics.top_products_by_city

Unity Catalog functions give ShopMax India a governed, reusable tool library where data engineers own the business logic and agent developers consume it without needing SQL expertise. Access control, versioning, and lineage are handled by Unity Catalog automatically - making this the most enterprise-ready approach for sharing Databricks capabilities with ADK agents.


 
  


  
bl  br