<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ayush kumar mishra</title>
    <description>The latest articles on DEV Community by Ayush kumar mishra (@ayush_1152).</description>
    <link>https://dev.to/ayush_1152</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4101123%2Ffc669b65-9a2c-43da-af26-1ce11c07ce8b.png</url>
      <title>DEV Community: Ayush kumar mishra</title>
      <link>https://dev.to/ayush_1152</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ayush_1152"/>
    <language>en</language>
    <item>
      <title>Building an Autonomous Multi-Tool AI Agent on Google Cloud with Vertex AI</title>
      <dc:creator>Ayush kumar mishra</dc:creator>
      <pubDate>Sun, 30 Aug 2026 08:06:23 +0000</pubDate>
      <link>https://dev.to/ayush_1152/building-an-autonomous-multi-tool-ai-agent-on-google-cloud-with-vertex-ai-43e</link>
      <guid>https://dev.to/ayush_1152/building-an-autonomous-multi-tool-ai-agent-on-google-cloud-with-vertex-ai-43e</guid>
      <description>&lt;p&gt;Generative AI applications are rapidly moving beyond single-turn conversational chatbots toward &lt;strong&gt;Autonomous Multi-Tool AI Agents&lt;/strong&gt;. Instead of just generating static text, modern agents evaluate user prompts, make routing decisions, select specialised external tools, and fetch dynamic real-time data before returning a grounded response.&lt;/p&gt;

&lt;p&gt;In this article, we will break down the end-to-end architecture and implementation of an autonomous agent built using &lt;strong&gt;Vertex AI&lt;/strong&gt;, Python, and Google Cloud infrastructure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## High-Level System Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The solution uses a three-tier agentic architecture designed for low latency, modularity, and strict session isolation:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;User Interaction Layer&lt;/strong&gt;: A frontend built with Streamlit and deployed on &lt;strong&gt;Cloud Run&lt;/strong&gt;, managing contextual chat turns via st.session_state`.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Orchestration Layer&lt;/strong&gt;: Gemini models hosted on &lt;strong&gt;Vertex AI&lt;/strong&gt; acting as the reasoning engine to determine tool execution plans.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool Execution Layer&lt;/strong&gt;: Connectors to Firestore vector stores, BigQuery datasets, and external REST APIs to provide real-time grounding.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  1. Setting Up Google Cloud Environment
&lt;/h2&gt;

&lt;p&gt;To start, configure your Google Cloud project and enable the necessary service APIs in Cloud Shell:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`bash&lt;/p&gt;

&lt;h1&gt;
  
  
  Set project configuration
&lt;/h1&gt;

&lt;p&gt;export PROJECT_ID=$(gcloud config get-value project)&lt;br&gt;
export REGION="us-central1"&lt;/p&gt;

&lt;h1&gt;
  
  
  Enable required Google Cloud APIs
&lt;/h1&gt;

&lt;p&gt;gcloud services enable \&lt;br&gt;
  aiplatform.googleapis.com \&lt;br&gt;
  run.googleapis.com \&lt;br&gt;
  cloudbuild.googleapis.com \&lt;br&gt;
  firestore.googleapis.com&lt;br&gt;
&lt;strong&gt;1. Defining Agent Tools and Schema Declarations&lt;/strong&gt;&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;br&gt;
import vertexai&lt;br&gt;
from vertexai.generative_models import GenerativeModel, FunctionDeclaration, Tool&lt;/p&gt;

&lt;h1&gt;
  
  
  Initialize Vertex AI
&lt;/h1&gt;

&lt;p&gt;vertexai.init(project="YOUR_PROJECT_ID", location="us-central1")&lt;/p&gt;

&lt;h1&gt;
  
  
  Define a tool for inventory lookups
&lt;/h1&gt;

&lt;p&gt;inventory_func = FunctionDeclaration(&lt;br&gt;
    name="query_inventory",&lt;br&gt;
    description="Look up product stock, availability, and unit pricing dynamically.",&lt;br&gt;
    parameters={&lt;br&gt;
        "type": "object",&lt;br&gt;
        "properties": {&lt;br&gt;
            "item_name": {&lt;br&gt;
                "type": "string",&lt;br&gt;
                "description": "The specific item or product name to search"&lt;br&gt;
            },&lt;br&gt;
            "category": {&lt;br&gt;
                "type": "string",&lt;br&gt;
                "description": "Item category, e.g., beverages, snacks, merchandise"&lt;br&gt;
            }&lt;br&gt;
        },&lt;br&gt;
        "required": ["item_name"]&lt;br&gt;
    },&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;agent_tools = Tool(function_declarations=[inventory_func])&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;plaintext&lt;br&gt;
**2. Implementing the Orchestration Logic**&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br&gt;
def query_inventory(item_name: str, category: str = None) -&amp;gt; dict:&lt;br&gt;
    # Simulated database lookup or Firestore Vector retrieval&lt;br&gt;
    return {&lt;br&gt;
        "item": item_name,&lt;br&gt;
        "in_stock": True,&lt;br&gt;
        "quantity": 42,&lt;br&gt;
        "price_usd": 4.50&lt;br&gt;
    }&lt;/p&gt;

&lt;h1&gt;
  
  
  Instantiate the model with tool definitions
&lt;/h1&gt;

&lt;p&gt;model = GenerativeModel(&lt;br&gt;
    model_name="gemini-1.5-flash-001",&lt;br&gt;
    tools=[agent_tools]&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;chat = model.start_chat()&lt;br&gt;
response = chat.send_message("Do we have any Cold Brew in stock?")&lt;/p&gt;

&lt;h1&gt;
  
  
  Parse function calls if triggered
&lt;/h1&gt;

&lt;p&gt;for part in response.candidates[0].content.parts:&lt;br&gt;
    if part.function_call:&lt;br&gt;
        fn_name = part.function_call.name&lt;br&gt;
        fn_args = dict(part.function_call.args)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    if fn_name == "query_inventory":
        tool_result = query_inventory(**fn_args)

        # Return tool output back to the model for final synthesis
        final_response = chat.send_message(
            vertexai.generative_models.Part.from_function_response(
                name=fn_name,
                response={"content": tool_result}
            )
        )
        print(final_response.text)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;plaintext&lt;br&gt;
**3. Packaging and Deploying to Google Cloud Run**&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Dockerfile
&lt;/h1&gt;

&lt;p&gt;FROM python:3.11-slim&lt;br&gt;
WORKDIR /app&lt;br&gt;
COPY requirements.txt .&lt;br&gt;
RUN pip install --no-cache-dir -r requirements.txt&lt;br&gt;
COPY . .&lt;br&gt;
EXPOSE 8080&lt;br&gt;
CMD ["streamlit", "run", "app.py", "--server.port=8080", "--server.address=0.0.0.0"]&lt;br&gt;
&lt;code&gt;&lt;/code&gt;`shell&lt;br&gt;
&lt;strong&gt;Deploy directly using the Google Cloud CLI:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;`&lt;br&gt;
gcloud run deploy genai-agent-service \&lt;br&gt;
  --source . \&lt;br&gt;
  --region us-central1 \&lt;br&gt;
  --allow-unauthenticated&lt;br&gt;
`&lt;/code&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>googlecloud</category>
      <category>vertexai</category>
    </item>
  </channel>
</rss>
