AI

4 Mins Read

Building Your Own Intelligent AI Agents with Vertex AI Agent Builder

Voiced by Amazon Polly

Are you looking to automate tasks, enhance customer interaction or simply explore the power of conversational AI? Google Cloud’s Vertex AI Agent Builder provides a self-paced guide for quickly designing, building and deploying effective AI Agents.

This blog summarises the key steps and features of creating and grounding your first AI Agent- a helpful ‘Travel Agent’.

Customized Cloud Solutions to Drive your Business Success

  • Cloud Migration
  • Devops
  • AIML & IoT
Know More

Before You Dive In: Prerequisites and Preparation

The process of building an agent is designed to be accessible. First, you will need a curious mind, a working computer, reliable WiFi and a Google Cloud project with attached billing.

You should have a basic understanding of Generative AI on Google Cloud and core AI Agent Concepts. You can work on any cloud platform with basic knowledge of Generative AI. If you have these prerequisites, you are ready to learn:

  • How to create a simple AI Agent using Vertex AI Agent Builder.
  • How to ground the agent by attaching a datastore.
  • How to optionally integrate the AI Agent into your website.

Designing Your AI Agent: Establishing a Clear Vision

Before starting development, establishing a clear vision for your agent is essential. This helps define its scope and function. Ask yourself these key questions:

Table showing Travel Buddy AI’s goals, functions, limits, and travel-friendly personality.

Building and Configuring Your Agent

The creation of an AI Agent using Vertex AI Agent Builder is remarkably streamlined.

  1. Creation: Start by navigating to Vertex AI Agent Builder, activating the API and selecting a Conversational Agent to create a new app. This process involves enabling the Conversational Agents API.
  2. Naming and Location: Choose a Display Name (e.g., Travel Agent) and select global (Global serving, data-at-rest in US) as the Region.
  3. Defining Instructions (The Playbook): Define a Playbook Name (e.g., Info Agent), set a Goal (e.g., Help customers answer travel-related queries) and define specific Instructions (e.g., Greet the users, then ask how you can help them today).
  4. Testing: You can toggle the Simulator icon, select your agent, choose an underlying generative AI model (such as gemini-1.5-flash) and test your agent by providing input.
Screenshot of the Vertex AI Agent Builder interface showing the “Create agent” setup window with configuration options.

The Vertex AI Agent Builder interface for creating a new AI agent with customizable settings.

Grounding Your Agent with Datastores

A common limitation of large language models is that they may be unable to answer specific or complicated queries. For example, the Travel Agent might ask about reaching a fictional location like Wakanda and simply receive a factual denial.

To enhance usefulness, you can provide more information through Datastores. A datastore is an additional knowledge base for the agent to refer to when it cannot answer questions based on its built-in knowledge.

Implementing Grounding

  1. Create the Datastore Tool: You create a tool definition (e.g., Tool name: Alternative Location; Type: Data store; Description: Use this tool if the user’s request contains a location that doesn’t exist).
  2. Add Data: You create the actual datastore, for example, by pointing to a file in Cloud Storage (e.g., ai-workshops/agents/data/wakanda.txt), which contains suggested alternative travel locations (like Oribi Gorge or Iguazu Falls).
  3. Grounding Configuration: To prevent the agent from “hallucinations” (making things up), you can set the grounding configuration to Very Low, which applies tighter restrictions on the agent.
  4. Update Instructions: It is crucial that you explicitly include the new tool in the agent’s instructions. For the Travel Buddy, you would add the line: – Use ${TOOL: Alternative Location} if the user’s request contains a location that does not exist.
Screenshot of the Vertex AI Agent Builder playbook editor showing goal, instructions and conditional actions setup.

Playbook editor in Vertex AI Agent Builder for defining agent goals and logic.

Once grounded, the agent will move beyond simply stating “I can’t provide information” and instead suggest similar, existing places, potentially leading users to book a trip.

Vertex AI Agent Builder interface showing the process of adding a datastore tool.

Adding a datastore tool in Vertex AI Agent Builder to ground the agent with external knowledge.

Taking Your AI Agent Live

Having developed and grounded your AI agent, the next step is addressing how to embed it within your website for real-time interaction.

Agents can be exposed by either exporting or directly publishing them.

  • Publishing the Agent: Click the Overflow menu and select Publish agent.
    Note: Enabling the unauthenticated API is done for demonstration purposes only and is not recommended for production environments.
Preview of a travel AI agent responding to user queries about Jaipur in Vertex AI Agent Builder.

Testing the Travel Agent in Vertex AI Agent Builder with real-time conversational responses.

  • Integration Snippet: Upon publishing, you receive a small CSS code snippet.
  • Creating the Web Application: You can use the Cloud Editor environment and leverage Gemini Code Assist to accelerate development. Gemini Code Assist can generate a sample web application, such as a Python Flask app, which integrates the agent’s published code snippet.
  • Deployment: Once the sample application is created and tested locally (it runs on port 5000 in the cloud shell), you can prepare it for deployment. For deployment to a scalable service like Cloud Run, Gemini Code Assist can help containerize the application.
  • This requires creating a requirements.txt file and a Dockerfile before building the Docker image and deploying it using the gcloud run deploy command.

Once these steps are completed, your application with its integrated AI agent will be live and accessible to end users. You can continue to explore customization options or add more grounding data to make your agent even more resourceful.

AI Agents Final Overview

A versatile Travel Agent has been successfully created using Google Cloud’s Vertex AI Agent Builder. This process highlighted the power of grounding with Datastores to ensure accuracy and prevent model “hallucinations”. This achievement sets the stage for future customizations and capability expansions.

Get your new hires billable within 1-60 days. Experience our Capability Development Framework today.

  • Cloud Training
  • Customized Training
  • Experiential Learning
Read More

About CloudThat

CloudThat is an award-winning company and the first in India to offer cloud training and consulting services worldwide. As a Microsoft Solutions Partner, AWS Advanced Tier Training Partner, and Google Cloud Platform Partner, CloudThat has empowered over 850,000 professionals through 600+ cloud certifications winning global recognition for its training excellence including 20 MCT Trainers in Microsoft’s Global Top 100 and an impressive 12 awards in the last 8 years. CloudThat specializes in Cloud Migration, Data Platforms, DevOps, IoT, and cutting-edge technologies like Gen AI & AI/ML. It has delivered over 500 consulting projects for 250+ organizations in 30+ countries as it continues to empower professionals and enterprises to thrive in the digital-first world.

WRITTEN BY Laxmi Sharma

Laxmi Sharma is a Subject Matter Expert at CloudThat, specializing in Google Cloud Platform. With 12+ years of experience in Cloud Domain. She has trained over 3000+ professionals/students to upskill in Cloud domain. Known for simplifying complex concepts and hands-on teaching, she brings deep technical knowledge and practical application into every learning experience. Laxmi's passion for learning & explaining new things to others reflects in her unique approach to learning and development.

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!