cd /news/ai-agents/building-an-autonomous-multi-tool-ai… · home topics ai-agents article
[ARTICLE · art-115621] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Building an Autonomous Multi-Tool AI Agent on Google Cloud with Vertex AI

A developer detailed the architecture and implementation of an autonomous multi-tool AI agent built on Google Cloud's Vertex AI, using Python and Cloud Run. The agent uses function calling to query inventory data and returns grounded responses, with deployment via Google Cloud Run.

read2 min views6 publishedAug 30, 2026

Generative AI applications are rapidly moving beyond single-turn conversational chatbots toward Autonomous Multi-Tool AI Agents. 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.

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

## High-Level System Architecture

The solution uses a three-tier agentic architecture designed for low latency, modularity, and strict session isolation:

To start, configure your Google Cloud project and enable the necessary service APIs in Cloud Shell:

``bash`

export PROJECT_ID=$(gcloud config get-value project)

export REGION="us-central1"

gcloud services enable \

aiplatform.googleapis.com \

run.googleapis.com \

cloudbuild.googleapis.com \

firestore.googleapis.com

1. Defining Agent Tools and Schema Declarations

`

import vertexai

from vertexai.generative_models import GenerativeModel, FunctionDeclaration, Tool

vertexai.init(project="YOUR_PROJECT_ID", location="us-central1")

inventory_func = FunctionDeclaration(

name="query_inventory",

description="Look up product stock, availability, and unit pricing dynamically.",

parameters={

"type": "object",

"properties": {

"item_name": {

"type": "string",

"description": "The specific item or product name to search"

},

"category": {

"type": "string",

"description": "Item category, e.g., beverages, snacks, merchandise"

}

},

"required": ["item_name"]

},

)

agent_tools = Tool(function_declarations=[inventory_func])

plaintext

2. Implementing the Orchestration Logic

def query_inventory(item_name: str, category: str = None) -> dict:

return {

"item": item_name,

"in_stock": True,

"quantity": 42,

"price_usd": 4.50

}

model = GenerativeModel(

model_name="gemini-1.5-flash-001",

tools=[agent_tools]

)

chat = model.start_chat()

response = chat.send_message("Do we have any Cold Brew in stock?")

for part in response.candidates[0].content.parts:

if part.function_call:

fn_name = part.function_call.name

fn_args = dict(part.function_call.args)

    if fn_name == "query_inventory":
        tool_result = query_inventory(**fn_args)

        final_response = chat.send_message(
            vertexai.generative_models.Part.from_function_response(
                name=fn_name,
                response={"content": tool_result}
            )
        )
        print(final_response.text)

plaintext

3. Packaging and Deploying to Google Cloud Run

FROM python:3.11-slim

WORKDIR /app

COPY requirements.txt .

RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 8080

CMD ["streamlit", "run", "app.py", "--server.port=8080", "--server.address=0.0.0.0"]

``shell`

Deploy directly using the Google Cloud CLI:


gcloud run deploy genai-agent-service \

--source . \

--region us-central1 \

--allow-unauthenticated

`
── more in #ai-agents 4 stories · sorted by recency
── more on @google cloud 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/building-an-autonomo…] indexed:0 read:2min 2026-08-30 ·