tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Generative AI > Google Gemini API > Carrier Selection Agent

Carrier Selection Agent

Author: Venkata Sudhakar

ShopMax India ships to every corner of India - metro cities, tier-2 towns, and remote pincodes. Different carriers have different strengths: BlueDart is fast but expensive, Delhivery has the broadest reach, DTDC is cost-effective for heavy items. Choosing the right carrier for each shipment manually is impossible at scale. An automated carrier selection agent that applies business rules to pick the best carrier for every order optimises cost and delivery speed simultaneously.

This tutorial builds a Carrier Selection Agent using ADK and Gemini. The agent takes shipment details - pincode, weight, declared value, and SLA - queries carrier capabilities, and recommends the optimal carrier with justification.

The below example shows carrier selection for ShopMax India outbound shipments.


It gives the following output,

Carrier Selection - ShopMax India
Shipment: 12 kg to Coimbatore (641001) | Zone: tier2
Declared value: Rs 62,000 | SLA: 3 days | COD: No

RECOMMENDED: BlueDart
  Cost    : Rs 780 (12 kg x Rs 65)
  Transit : 2 days (within 3-day SLA)
  Reason  : Only eligible carrier within 3-day SLA for tier2 zone.
            Delhivery (3 days, Rs 540) also meets SLA - use as backup.
            DTDC (4 days, Rs 456) exceeds SLA - eliminated.

ALTERNATIVES:
  Delhivery | Rs 540 | 3 days (meets SLA, Rs 240 cheaper)

Note: If cost is the priority, switch to Delhivery - it meets the
3-day SLA and saves Rs 240 per shipment. At 50 shipments/month
to tier2 destinations that is Rs 12,000 in monthly savings.

Integrate this agent into the ShopMax India order management system as a Cloud Function triggered at order confirmation. Pass the decision to your shipping label generation service to automatically create the waybill. Log all carrier selections in BigQuery to analyse cost trends and SLA performance by carrier over time.


 
  


  
bl  br