<?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: John Bulla</title>
    <description>The latest articles on DEV Community by John Bulla (@johnbulla).</description>
    <link>https://dev.to/johnbulla</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%2F666134%2Fc19791a4-86a8-48f5-8ff6-b31d0aa6b1a7.png</url>
      <title>DEV Community: John Bulla</title>
      <link>https://dev.to/johnbulla</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/johnbulla"/>
    <language>en</language>
    <item>
      <title>How to deploy an AI agent using Google ADK in Agent Runtime and register it in Gemini Enterprise</title>
      <dc:creator>John Bulla</dc:creator>
      <pubDate>Wed, 18 Nov 2026 20:33:20 +0000</pubDate>
      <link>https://dev.to/gde/how-to-deploy-an-ai-agent-using-google-adk-in-agent-runtime-and-register-it-in-gemini-enterprise-20c8</link>
      <guid>https://dev.to/gde/how-to-deploy-an-ai-agent-using-google-adk-in-agent-runtime-and-register-it-in-gemini-enterprise-20c8</guid>
      <description>&lt;div class="ltag__user ltag__user__id__666134"&gt;
    &lt;a href="/johnbulla" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=150,height=150,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F666134%2Fc19791a4-86a8-48f5-8ff6-b31d0aa6b1a7.png" alt="johnbulla image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/johnbulla"&gt;John Bulla&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/johnbulla"&gt;💼 Sr. Cloud Solutions Architect - Cloud, Data &amp;amp; AI | Pre-Sales Architect | Cloud Evangelist 
🏆 Google Developer Expert | AWS Community Builder | Alibaba Cloud MVP | Ex-Microsoft MVP&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;✋ &lt;strong&gt;Note:&lt;/strong&gt; This article was originally published on my blog &lt;a href="https://wiki-cloud.co/en/2026/11/how-deploy-ai-agent-google-adk-agent-runtime-gemini-ent" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The development of artificial intelligence agents is changing how organizations access information, automate tasks, and improve their business processes. However, building an agent is only the first step. To make the most of its potential, we need an environment where it can run continuously, serve different users, and support important requirements such as security, scalability, and monitoring.&lt;/p&gt;

&lt;p&gt;In this context, deploying AI agents to the cloud allows us to move from a solution developed locally to an enterprise application capable of supporting an organization's needs.&lt;/p&gt;

&lt;p&gt;In the &lt;a href="https://wiki-cloud.co/en/2026/11/build-ai-agent-with-google-adk/" rel="noopener noreferrer"&gt;previous article&lt;/a&gt;, we built a &lt;strong&gt;Corporate Policies Assistant&lt;/strong&gt; using &lt;strong&gt;Google ADK, Gemini, Google Drive, and Streamlit&lt;/strong&gt;. We learned how to query corporate documents using an in-memory lexical RAG system and generate natural-language answers with references to their original sources.&lt;/p&gt;

&lt;p&gt;Now we'll take the next step: deploy our agent to &lt;strong&gt;Google Cloud Agent Runtime&lt;/strong&gt;, a managed service that allows us to run it in the cloud without relying on our local computer, and then integrate it with &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; so users can access the assistant through an enterprise platform.&lt;/p&gt;

&lt;p&gt;We won't rebuild the application or the tools developed previously. Instead, we'll focus on preparing the agent for deployment, validating its operation in the cloud, and publishing it in Gemini Enterprise.&lt;/p&gt;

&lt;p&gt;For this hands-on exercise, we'll continue using Windows, PowerShell, Python 3.12, and the same &lt;a href="https://github.com/johnbulla/google-adk-gemini-corporate-policies-agent" rel="noopener noreferrer"&gt;project repository&lt;/a&gt;. Both Spanish and English versions of the project are available in the repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Solution objectives and architecture&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The goal of this exercise is to continue developing our Corporate Policies Assistant by reusing the agent built with Google ADK, deploying it to &lt;strong&gt;Google Cloud Agent Runtime&lt;/strong&gt;, and then integrating it with &lt;strong&gt;Gemini Enterprise&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To achieve this, we'll package the agent as an installable Python distribution so that its logic and dependencies can run in a managed cloud environment. Google Drive will remain our document repository, while Gemini, through Vertex AI, will interpret queries and generate responses.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo3wdqpihp7hccr9zm648.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo3wdqpihp7hccr9zm648.png" alt="Target architecture of the Corporate Policies Assistant" width="799" height="253"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figure 1 – Target architecture of the Corporate Policies Assistant.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In the previous article, we tested the assistant locally in three ways: &lt;strong&gt;Streamlit&lt;/strong&gt;, through a custom web interface; &lt;strong&gt;ADK Web&lt;/strong&gt;, which allowed us to interact with the agent and observe how its tools were executed; and &lt;strong&gt;ADK CLI&lt;/strong&gt;, which we used to submit queries directly from the command line.&lt;/p&gt;

&lt;p&gt;These tests helped us validate the integration between the different components and confirm that the agent could retrieve information from corporate policies through RAG, generate natural-language answers, and provide references to the documents it consulted.&lt;/p&gt;

&lt;p&gt;In this second part, we'll evolve the architecture without changing its core functionality. Google Cloud Agent Runtime will host the agent in a managed environment that supports availability, scalability, and monitoring. Gemini Enterprise will add a new access layer for business users, allowing them to interact with the assistant without using development tools directly.&lt;/p&gt;

&lt;p&gt;In this way, we'll preserve the solution built previously while making it available to more users across the organization.&lt;/p&gt;

&lt;p&gt;Google ADK will continue to coordinate the conversation and execute the policy search tool, while our RAG system will retrieve relevant information from documents stored in Google Drive. Gemini will use that content as context to produce grounded responses. This integration takes us from an agent validated on a local computer to a solution accessible through Gemini Enterprise.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Architecture note:&lt;/strong&gt; Connecting Streamlit to the remote agent is presented as a possible future enhancement. The Streamlit integration developed in the previous article ran the agent locally.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Implementation phases&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To deploy our Corporate Policies Assistant to Google Cloud and integrate it with Gemini Enterprise, we'll follow seven stages. As shown below, we'll first prepare the environment and package the agent, then deploy it to Agent Runtime, validate it with remote tests, and finally publish it in Gemini Enterprise for authorized users within the organization.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnjln2n60tx7g2u06uvkn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnjln2n60tx7g2u06uvkn.png" alt="Agent implementation and deployment phases" width="800" height="185"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figure 2 – Agent implementation and deployment phases.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Prerequisites&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before continuing, we'll assume that the local application is already responding correctly, that the policy documents are stored in an authorized Google Drive folder, and that the project's virtual environment has the dependencies listed in &lt;code&gt;requirements.txt&lt;/code&gt; installed.&lt;/p&gt;

&lt;p&gt;For deployment, we'll need a Google Cloud project with billing enabled, Google Cloud CLI, permissions to create Agent Runtime resources, a service account for runtime execution, and a Cloud Storage bucket for temporary artifacts. The user performing the deployment must also have permission to use the service account.&lt;/p&gt;
&lt;h3&gt;
  
  
  Variable configuration
&lt;/h3&gt;

&lt;p&gt;Before configuring the Google Cloud resources, we'll define a few PowerShell variables to use throughout the deployment. These variables identify our project, region, storage bucket, service account, and Google Cloud user. This makes the commands easier to run without repeatedly entering the same values.&lt;/p&gt;

&lt;p&gt;Simply replace the placeholders with the values for your Google Cloud environment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Google Cloud project&lt;/span&gt;
&lt;span class="nv"&gt;$PROJECT_ID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"YOUR_PROJECT_ID"&lt;/span&gt;

&lt;span class="c1"&gt;# Deployment region&lt;/span&gt;
&lt;span class="nv"&gt;$REGION&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"europe-west1"&lt;/span&gt;

&lt;span class="c1"&gt;# Cloud Storage bucket&lt;/span&gt;
&lt;span class="nv"&gt;$BUCKET_NAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"YOUR_STAGING_BUCKET_NAME"&lt;/span&gt;

&lt;span class="c1"&gt;# Agent service account&lt;/span&gt;
&lt;span class="nv"&gt;$SA_NAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"YOUR_SERVICE_ACCOUNT_NAME"&lt;/span&gt;
&lt;span class="nv"&gt;$SA_EMAIL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"$SA_NAME@$PROJECT_ID.iam.gserviceaccount.com"&lt;/span&gt;

&lt;span class="c1"&gt;# Staging bucket URI&lt;/span&gt;
&lt;span class="nv"&gt;$STAGING_BUCKET&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"gs://$BUCKET_NAME"&lt;/span&gt;

&lt;span class="c1"&gt;# Google Cloud user&lt;/span&gt;
&lt;span class="nv"&gt;$USER_EMAIL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"YOUR_USER@YOUR_DOMAIN.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Select the GCP project and configure ADC
&lt;/h3&gt;

&lt;p&gt;Before deploying our agent, we need to configure access to the Google Cloud project we'll be using. Open a PowerShell terminal in Visual Studio Code and run the following commands to verify the Google Cloud CLI installation, sign in, and select the project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;
&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;auth&lt;/span&gt; &lt;span class="n"&gt;login&lt;/span&gt;
&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;project&lt;/span&gt; &lt;span class="nv"&gt;$PROJECT_ID&lt;/span&gt;
&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;auth&lt;/span&gt; &lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="n"&gt;login&lt;/span&gt;
&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;auth&lt;/span&gt; &lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;quota&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt; &lt;span class="nv"&gt;$PROJECT_ID&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We'll use &lt;strong&gt;Application Default Credentials (ADC)&lt;/strong&gt;, a Google Cloud authentication mechanism that allows Python applications and libraries to obtain credentials automatically when accessing Google services.&lt;/p&gt;

&lt;p&gt;The two sign-in commands serve different purposes: &lt;code&gt;gcloud auth login&lt;/code&gt; authenticates the Google Cloud CLI, while &lt;code&gt;gcloud auth application-default login&lt;/code&gt; configures the ADC credentials used by our deployment script. Finally, setting the quota project associates API usage with the selected project and helps avoid warnings about user credentials without an associated quota project, provided we have the necessary permissions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enable APIs
&lt;/h3&gt;

&lt;p&gt;Once access to the project is configured, we'll enable the APIs needed to deploy and run the agent on Agent Runtime and integrate it with Gemini Enterprise. These APIs provide access to the AI, storage, authentication, and enterprise resources used by our solution.&lt;/p&gt;

&lt;p&gt;Run the following command from PowerShell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;services&lt;/span&gt; &lt;span class="n"&gt;enable&lt;/span&gt; &lt;span class="sb"&gt;`
  aiplatform.googleapis.com `&lt;/span&gt;
  &lt;span class="n"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;googleapis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt; &lt;span class="sb"&gt;`
  cloudresourcemanager.googleapis.com `&lt;/span&gt;
  &lt;span class="n"&gt;iam&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;googleapis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt; &lt;span class="sb"&gt;`
  iamcredentials.googleapis.com `&lt;/span&gt;
  &lt;span class="n"&gt;drive&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;googleapis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt; &lt;span class="sb"&gt;`
  discoveryengine.googleapis.com `&lt;/span&gt;
  &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;googleapis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt; &lt;span class="sb"&gt;`
  --project=$PROJECT_ID
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command enables the services required for Vertex AI and Agent Runtime, storing deployment artifacts in Cloud Storage, managing identities and permissions with IAM, reading documents from Google Drive, and integrating our agent with Gemini Enterprise. We also enable Cloud Logging so we can review execution logs.&lt;/p&gt;

&lt;p&gt;Keep in mind that enabling APIs does not automatically grant access permissions. We'll configure those separately using the appropriate IAM roles.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create the staging bucket in Cloud Storage
&lt;/h3&gt;

&lt;p&gt;Next, we'll create a Google Cloud Storage bucket to serve as temporary storage during the deployment to Agent Runtime. It will hold the Python packages and artifacts needed to prepare and deploy our agent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;storage&lt;/span&gt; &lt;span class="n"&gt;buckets&lt;/span&gt; &lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="nv"&gt;$STAGING_BUCKET&lt;/span&gt; &lt;span class="sb"&gt;`
  --project=$PROJECT_ID `&lt;/span&gt;
  &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$REGION&lt;/span&gt; &lt;span class="sb"&gt;`
  --uniform-bucket-level-access
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we'll use &lt;code&gt;europe-west1&lt;/code&gt; and enable uniform bucket-level access, which allows access permissions to be managed through IAM. Replace the example bucket name with a globally unique name and the project placeholder with your actual project ID.&lt;/p&gt;

&lt;p&gt;If the bucket already exists, there's no need to create it again. We only need to confirm that we have the permissions required to use it during deployment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create and configure the service account
&lt;/h3&gt;

&lt;p&gt;With storage ready, we'll create a &lt;strong&gt;service account&lt;/strong&gt; for our Corporate Policies Assistant to use when it runs on Google Cloud Agent Runtime. This gives the agent its own identity for accessing authorized Google Cloud services without relying on the developer's personal credentials.&lt;/p&gt;

&lt;h4&gt;
  
  
  Create the service account
&lt;/h4&gt;

&lt;p&gt;Run the following PowerShell command using the variables defined earlier:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;iam&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;accounts&lt;/span&gt; &lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="nv"&gt;$SA_NAME&lt;/span&gt; &lt;span class="sb"&gt;`
  --display-name="Corporate Policies Agent Runtime" `&lt;/span&gt;
  &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$PROJECT_ID&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates the service account used by the deployed agent. Its email address follows this pattern: &lt;code&gt;YOUR_SERVICE_ACCOUNT_NAME@YOUR_PROJECT_ID.iam.gserviceaccount.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Next, we'll grant the &lt;code&gt;roles/aiplatform.user&lt;/code&gt; role so the agent can use the Vertex AI services required to interact with Gemini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;projects&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;iam&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;policy&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;binding&lt;/span&gt; &lt;span class="nv"&gt;$PROJECT_ID&lt;/span&gt; &lt;span class="sb"&gt;`
  --member="serviceAccount:$SA_EMAIL" `&lt;/span&gt;
  &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"roles/aiplatform.user"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We use this role in the demo to simplify execution. For production environments, we should evaluate more specific permissions and follow the principle of least privilege.&lt;/p&gt;

&lt;h4&gt;
  
  
  Configure Google Drive access
&lt;/h4&gt;

&lt;p&gt;Besides interacting with Gemini, our agent needs to read the documents stored in Google Drive. To enable this, share the corporate policies folder with the service account's email address and grant &lt;strong&gt;Viewer&lt;/strong&gt; access, provided that your Google Workspace policies allow it.&lt;/p&gt;

&lt;p&gt;Remember that Google Drive permissions are managed separately from Google Cloud IAM roles. Assigning &lt;code&gt;roles/aiplatform.user&lt;/code&gt; does not automatically grant access to documents.&lt;/p&gt;

&lt;p&gt;In the previous article, we used a JSON credentials file to run the agent locally. This time, we'll use the identity attached to Agent Runtime and Application Default Credentials (ADC), avoiding private keys in the deployment package.&lt;/p&gt;

&lt;p&gt;This gives our agent a dedicated identity for accessing authorized services and running more securely in Google Cloud.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure IAM permissions for the Google Cloud user
&lt;/h3&gt;

&lt;p&gt;After configuring the service account, we need to ensure that our Google Cloud user has permission to deploy the agent and run tests from PowerShell.&lt;/p&gt;

&lt;p&gt;It's important to distinguish these identities: the service account is used when the agent runs, while our user prepares the deployment, creates the Agent Runtime resource, and verifies that it works.&lt;/p&gt;

&lt;p&gt;For this lab, we'll use the following roles:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;IAM role&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;roles/aiplatform.user&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Allows the user to access Vertex AI and Agent Runtime services, interact with Gemini models, and send queries to deployed agents.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;roles/aiplatform.sessionUser&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Allows the user to create and manage conversation sessions with agents deployed on Agent Runtime.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Run these commands from PowerShell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;projects&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;iam&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;policy&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;binding&lt;/span&gt; &lt;span class="nv"&gt;$PROJECT_ID&lt;/span&gt; &lt;span class="sb"&gt;`
  --member="user:$USER_EMAIL" `&lt;/span&gt;
  &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"roles/aiplatform.user"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;projects&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;iam&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;policy&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;binding&lt;/span&gt; &lt;span class="nv"&gt;$PROJECT_ID&lt;/span&gt; &lt;span class="sb"&gt;`
  --member="user:$USER_EMAIL" `&lt;/span&gt;
  &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"roles/aiplatform.sessionUser"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Project structure and deployment-specific files&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before moving on to deployment in Google Cloud Agent Runtime, let's briefly review the project structure and identify the files we'll need for this stage. Since we already developed the agent and its main components in the previous article, we don't need to change its architecture or rebuild its functionality.&lt;/p&gt;

&lt;p&gt;We'll focus on the files responsible for creating the Python package, deploying the agent, and checking that it works once it's running in the cloud.&lt;/p&gt;

&lt;p&gt;To make the process easier to follow, here's a simplified view of the repository highlighting the deployment and test files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;google-adk-gemini-corporate-policies-agent/
├── requirements.txt
├── sources_en/
│   ├── .env
│   ├── corporate_agent/          # Previously developed agent code
│   ├── pyproject.toml            # Wheel package metadata
│   ├── deployment/
│   │   ├── deploy_agent.py
│   │   └── runtime_resource.txt  # Created after deployment
│   └── test/
│       └── test_runtime.py
└── sources_es/                   # Equivalent Spanish version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sources_en/pyproject.toml&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Defines the installable &lt;code&gt;corporate-policies-agent&lt;/code&gt; package and specifies that &lt;code&gt;corporate_agent&lt;/code&gt; must be included.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sources_en/deployment/deploy_agent.py&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Validates the environment, builds the wheel, deploys &lt;code&gt;AdkApp&lt;/code&gt;, and saves the remote resource path.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sources_en/deployment/runtime_resource.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Output file containing the full path of the created resource.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sources_es/test/test_runtime.py&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Retrieves the remote resource reference, connects to Agent Runtime, and sends test queries.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;requirements.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Contains the project's dependencies; the script also specifies those required by the runtime.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Environment variables specific to this stage&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;With our project ready, the next step is to review the environment variables used to deploy the agent to Google Cloud Agent Runtime and verify that it works. These settings identify the project and region where the agent will run, the resources it needs, and how it will authenticate to Google Cloud services.&lt;/p&gt;

&lt;p&gt;Since we configured the variables for local development in the previous article, we'll focus only on those related to cloud deployment and testing.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GOOGLE_CLOUD_PROJECT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Identifies the Google Cloud project where we'll deploy our agent.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AGENT_RUNTIME_LOCATION&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Defines the Google Cloud region where the agent will run. In this demo, we'll use &lt;code&gt;europe-west1&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AGENT_RUNTIME_STAGING_BUCKET&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies the Cloud Storage bucket used to temporarily store deployment files. Its format is &lt;code&gt;gs://YOUR_STAGING_BUCKET&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AGENT_RUNTIME_SERVICE_ACCOUNT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Contains the email address of the service account the agent will use to access authorized Google Cloud resources.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GOOGLE_GENAI_USE_VERTEXAI&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Indicates that the agent will connect to Gemini through Vertex AI. We'll set it to &lt;code&gt;TRUE&lt;/code&gt; in Agent Runtime.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GEMINI_MODEL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies the Gemini model used to process queries and generate answers. Our project uses &lt;code&gt;gemini-3.5-flash-lite&lt;/code&gt; as its default, provided the model is available to the project.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GEMINI_VERTEX_LOCATION&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies the location used for Gemini model inference. In this example, we'll use &lt;code&gt;global&lt;/code&gt;, which can differ from the Agent Runtime deployment region.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DRIVE_AUTH_MODE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Controls how the agent authenticates to Google Drive. We'll use &lt;code&gt;adc&lt;/code&gt; to rely on the runtime's identity without including a JSON credentials file.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AGENT_RUNTIME_RESOURCE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Optionally specifies the deployed agent resource for remote tests. If omitted, &lt;code&gt;test_runtime.py&lt;/code&gt; can also read it from &lt;code&gt;deployment/runtime_resource.txt&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We'll also retain &lt;code&gt;GOOGLE_DRIVE_FOLDER_ID&lt;/code&gt; and &lt;code&gt;RAG_REFRESH_INTERVAL_SECONDS&lt;/code&gt;, which were introduced in the previous article. The first identifies the Google Drive folder containing our corporate policies, while the second sets the refresh interval for the agent's RAG index.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Packaging the agent with pyproject.toml&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before deploying our Corporate Policies Assistant to Google Cloud Agent Runtime, we need to prepare its code so it can be installed and run in the cloud. To do that, we'll use a &lt;strong&gt;wheel package (&lt;code&gt;.whl&lt;/code&gt;)&lt;/strong&gt;, a Python distribution format that bundles an application's code and metadata into an installable file.&lt;/p&gt;

&lt;p&gt;Wheel packages make it easier to distribute and install Python applications because they contain the files the target environment needs to recognize and import their modules. In our project, this mechanism will let us deploy the &lt;code&gt;corporate_agent&lt;/code&gt; code to Agent Runtime and ensure its components can be imported correctly during execution.&lt;/p&gt;

&lt;p&gt;To build the wheel, we'll use &lt;code&gt;pyproject.toml&lt;/code&gt;, located in both the &lt;code&gt;sources_en/&lt;/code&gt; and &lt;code&gt;sources_es/&lt;/code&gt; directories. This file contains the configuration needed to build and distribute our agent as a Python package.&lt;/p&gt;

&lt;p&gt;It defines &lt;code&gt;setuptools&lt;/code&gt; as the build tool, sets the package name to &lt;code&gt;corporate-policies-agent&lt;/code&gt;, and specifies that the &lt;code&gt;corporate_agent&lt;/code&gt; module must be included, along with its main files such as &lt;code&gt;__init__.py&lt;/code&gt;, &lt;code&gt;agent.py&lt;/code&gt;, and &lt;code&gt;drive_rag.py&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This allows Python to recognize and install our agent in the remote environment without manually copying files or changing the imports implemented earlier.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prepare the packaging tools
&lt;/h3&gt;

&lt;p&gt;Before deployment, let's make sure our virtual environment has the tools required to build the wheel package.&lt;/p&gt;

&lt;p&gt;From the Visual Studio Code PowerShell terminal, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;cd&lt;/span&gt; &lt;span class="no"&gt;C&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;\&lt;span class="nc"&gt;Projects&lt;/span&gt;\&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;adk&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;gemini&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;corporate&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;policies&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;venv&lt;/span&gt;\&lt;span class="nc"&gt;Scripts&lt;/span&gt;\&lt;span class="nc"&gt;Activate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ps1&lt;/span&gt;
&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;upgrade&lt;/span&gt; &lt;span class="n"&gt;setuptools&lt;/span&gt; &lt;span class="n"&gt;wheel&lt;/span&gt;
&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands activate the virtual environment, install or update the packaging tools, and check for dependency conflicts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Generate the wheel during deployment
&lt;/h3&gt;

&lt;p&gt;We won't need to build the wheel manually, because &lt;code&gt;deployment/deploy_agent.py&lt;/code&gt; already handles this task, as we'll see in the next section.&lt;/p&gt;

&lt;p&gt;When executed, the script temporarily builds the &lt;code&gt;.whl&lt;/code&gt; file, verifies that it includes the agent's main files, and adds it to the dependencies installed in Agent Runtime.&lt;/p&gt;

&lt;p&gt;This also helps ensure compatibility between our Windows development environment and the Linux environment used by Agent Runtime, avoiding absolute local paths that won't exist in the cloud.&lt;/p&gt;

&lt;p&gt;With this approach, our agent's code will be ready for installation in Agent Runtime while retaining its original structure and without having to rebuild the components developed in the previous article.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Deploying to Google Cloud Agent Runtime&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Now that we've prepared the Google Cloud resources and configured the agent's packaging process, we're ready to deploy it to Agent Runtime. We'll use &lt;code&gt;deploy_agent.py&lt;/code&gt; to perform the necessary checks, prepare the code and its dependencies, and create the agent in Google Cloud's managed environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Structure and operation of deploy_agent.py
&lt;/h3&gt;

&lt;p&gt;This file is located at &lt;code&gt;sources_en/deployment/deploy_agent.py&lt;/code&gt; (English version) or &lt;code&gt;sources_es/deployment/deploy_agent.py&lt;/code&gt; (Spanish version). It is organized into nine main blocks, summarized below.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Block&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;1. Imports and project environment variables&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Imports the libraries required for deployment and loads configuration variables from &lt;code&gt;.env&lt;/code&gt;. It also identifies reserved variables managed automatically by Agent Runtime that should not be passed into the remote agent configuration.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;2. Configuration loading and validation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Checks that all required information is available, including the project ID, staging bucket, service account, and Google Drive folder. These checks help catch incomplete settings before creating cloud resources.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;3. Authentication environment preparation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;prepare_deployment_environment()&lt;/code&gt; configures the use of Vertex AI and prepares ADC authentication. It also prevents accidental use of an API key or local JSON credentials.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4. Credentials and Cloud Storage access checks&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;verify_deployment_credentials()&lt;/code&gt; verifies that valid ADC credentials are available and confirms access to the staging bucket.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;5. Remote agent environment variables&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;build_runtime_env()&lt;/code&gt; prepares the Gemini model settings, ADC authentication, Google Drive document location, and RAG index refresh interval.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;6. Wheel package generation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;build_agent_wheel()&lt;/code&gt; builds the installable agent package, verifies that the main files are included, and prepares its paths for the remote environment.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;7. Agent Runtime resource creation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;AdkApp&lt;/code&gt; prepares the ADK agent, and &lt;code&gt;client.agent_engines.create()&lt;/code&gt; creates the managed resource with its dependencies, wheel, bucket, service account, and environment variables.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;8. Deployed resource identifier recording&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The script retrieves the full resource identifier and saves it to &lt;code&gt;deployment/runtime_resource.txt&lt;/code&gt; for testing and later registration in Gemini Enterprise.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;9. Deployment entry point&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Runs &lt;code&gt;main()&lt;/code&gt; when the file is invoked as a Python module and coordinates the preceding stages.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Run the agent deployment
&lt;/h3&gt;

&lt;p&gt;Now that we understand what &lt;code&gt;deploy_agent.py&lt;/code&gt; does, we can run the deployment. Open the PowerShell terminal in Visual Studio Code, navigate to the repository root, and make sure the virtual environment is active.&lt;/p&gt;

&lt;p&gt;For the English version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;PYTHONPATH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"$PWD\sources_en"&lt;/span&gt;
&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;sources_en&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deployment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deploy_agent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the Spanish version, use the corresponding package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;PYTHONPATH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"$PWD\sources_es"&lt;/span&gt;
&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;sources_es&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deployment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deploy_agent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command starts the deployment using the configuration prepared earlier. During execution, the script verifies credentials, checks access to the Cloud Storage bucket, builds the wheel package, and sends the required components to Google Cloud Agent Runtime.&lt;/p&gt;

&lt;p&gt;If everything succeeds, we'll see a message confirming that the agent was created, along with an identifier similar to the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Resource created:
projects/YOUR_PROJECT_NUMBER/locations/europe-west1/reasoningEngines/RESOURCE_ID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This identifier refers to the resource created in Agent Runtime and is saved in &lt;code&gt;deployment/runtime_resource.txt&lt;/code&gt;, so we won't need to copy it manually for the following tests.&lt;/p&gt;

&lt;p&gt;Keep in mind that deployment may incur Google Cloud charges and that a successful deployment doesn't necessarily mean the agent can answer queries. That's why we'll test it remotely before integrating it with Gemini Enterprise.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnlvkcgfvpklk7fu51q3v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnlvkcgfvpklk7fu51q3v.png" alt="Agent deployment in Agent Runtime" width="800" height="221"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figure 3 – Agent deployment in Agent Runtime.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Validating the agent with test_runtime.py&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;After deploying our Corporate Policies Assistant, we need to verify that it runs correctly in Google Cloud and can still access the documents stored in Google Drive.&lt;/p&gt;

&lt;p&gt;We'll use &lt;code&gt;sources_en/test/test_runtime.py&lt;/code&gt; (English version) or &lt;code&gt;sources_es/test/test_runtime.py&lt;/code&gt; (Spanish version) to connect to the deployed agent and submit questions from the PowerShell terminal.&lt;/p&gt;

&lt;p&gt;Unlike the tests in the previous article, these queries won't run against our local agent. They'll be sent to the resource we created in Google Cloud Agent Runtime.&lt;/p&gt;
&lt;h3&gt;
  
  
  Run the remote agent tests
&lt;/h3&gt;

&lt;p&gt;From the repository root, with the virtual environment active, run the English version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;sources_en&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;test_runtime&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the Spanish version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;sources_es&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;test_runtime&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script automatically retrieves the deployed agent's identifier and connects to Agent Runtime. If the connection is successful, the output will look similar to this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Proyecto: YOUR_PROJECT_ID
Región: europe-west1
Agente: projects/YOUR_PROJECT_NUMBER/locations/europe-west1/reasoningEngines/RESOURCE_ID
Conexión con Agent Runtime establecida.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script will then submit several test queries, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hi, can you introduce yourself and explain what you do?&lt;/li&gt;
&lt;li&gt;What is the corporate vacation policy?&lt;/li&gt;
&lt;li&gt;How many vacation days do employees receive?&lt;/li&gt;
&lt;li&gt;What is the company's remote work policy?&lt;/li&gt;
&lt;li&gt;Which corporate policies can you help me with?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;During these tests, we need to confirm that the agent responds correctly, uses &lt;code&gt;search_corporate_policies&lt;/code&gt; when it needs to retrieve information, and generates answers grounded in the documents available in Google Drive.&lt;/p&gt;

&lt;p&gt;It's also important to inspect the events returned by Agent Runtime. A successful connection does not necessarily mean that the Gemini model request completed successfully.&lt;/p&gt;

&lt;p&gt;Once we've completed the tests and confirmed that the agent works correctly in the cloud, we'll be ready to integrate it with Gemini Enterprise and make it available to authorized users.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Registering the agent in Gemini Enterprise&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Once we've deployed our Corporate Policies Assistant and confirmed that it works in Google Cloud Agent Runtime, the next step is to integrate it with Gemini Enterprise. This platform allows users across the organization to interact with our agent through a conversational interface, without having to use development tools such as Streamlit, ADK Web, or the command line.&lt;/p&gt;

&lt;p&gt;We'll create an application in Gemini Enterprise and register the agent already deployed to Google Cloud, reusing its logic, tools, and connection to the documents stored in Google Drive.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create an application in Gemini Enterprise
&lt;/h3&gt;

&lt;p&gt;First, we'll create a new application in Gemini Enterprise that will serve as the entry point for our Corporate Policies Assistant.&lt;/p&gt;

&lt;p&gt;From the Google Cloud Console, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; and select your Google Cloud project.&lt;/li&gt;
&lt;li&gt;In the navigation menu, go to &lt;strong&gt;Apps&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create app&lt;/strong&gt; to begin setup.&lt;/li&gt;
&lt;li&gt;Enter an application name, such as &lt;code&gt;Corporate Policies Assistant&lt;/code&gt;, and complete the required fields.&lt;/li&gt;
&lt;li&gt;Choose the application location and any options available for your Gemini Enterprise edition. In this example, we'll select &lt;code&gt;global&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Review the settings and finish by clicking &lt;strong&gt;Create&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;During application creation, make sure your project has the permissions and licenses required to use Gemini Enterprise. Also note that the application's location can differ from the region where Agent Runtime is deployed, as long as the configuration is supported.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmp27xuvepiksjo8ue8o2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmp27xuvepiksjo8ue8o2.png" alt="Creating an application in Gemini Enterprise" width="800" height="206"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figure 4 – Creating an application in Gemini Enterprise.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Once created, the enterprise application will be ready for us to add the agent developed with Google ADK.&lt;/p&gt;

&lt;h3&gt;
  
  
  Register the custom agent
&lt;/h3&gt;

&lt;p&gt;With the application created, we'll register the Corporate Policies Assistant we previously deployed to Google Cloud Agent Runtime.&lt;/p&gt;

&lt;p&gt;Open the settings for our &lt;code&gt;Corporate Policies Assistant&lt;/code&gt; application in Gemini Enterprise and follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the &lt;strong&gt;Agents&lt;/strong&gt; section.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Custom agent via Agent Runtime&lt;/strong&gt; to register our custom agent.&lt;/li&gt;
&lt;li&gt;In the first step, which covers authorizations, we'll keep the default configuration for this demo.&lt;/li&gt;
&lt;li&gt;In the configuration step, fill in the agent details.&lt;/li&gt;
&lt;li&gt;Enter the name, description, and deployed resource identifier using the following example values:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Example value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Name&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Corporate Policies Assistant&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;An agent that consults internal policies—covering Human Resources, Finance, Legal, Security, and other areas—based on authorized documents stored in Google Drive.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Resource path&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;projects/PROJECT_NUMBER/locations/europe-west1/reasoningEngines/RESOURCE_ID&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Review the settings and confirm the agent registration.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The description helps identify the agent's purpose and the types of questions it can answer. The resource path establishes the connection to the agent running in Agent Runtime. It's the same identifier we obtained during deployment and saved in &lt;code&gt;deployment/runtime_resource.txt&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2ai8yp6y8qexgd1yrq5s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2ai8yp6y8qexgd1yrq5s.png" alt="Agent registered in Gemini Enterprise" width="800" height="276"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figure 5 – Registering the agent in Gemini Enterprise.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Once the agent is registered, we'll configure its availability so authorized users or groups can access it through Gemini Enterprise.&lt;/p&gt;

&lt;p&gt;We also need to confirm that the application has permission to invoke the agent. If Gemini Enterprise and Agent Runtime are in different Google Cloud projects, we must configure cross-project access permissions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Validate the agent in Gemini Enterprise
&lt;/h3&gt;

&lt;p&gt;After registration, we can open our Gemini Enterprise application and interact with the Corporate Policies Assistant through its conversational interface.&lt;/p&gt;

&lt;p&gt;To verify that the integration works correctly, we'll repeat some of the questions used during our PowerShell tests, such as asking about vacation days, remote work conditions, or reimbursement procedures.&lt;/p&gt;

&lt;p&gt;During these tests, we should check that the agent provides coherent answers, retrieves information from documents stored in Google Drive, and includes source references when available.&lt;/p&gt;

&lt;p&gt;We should also confirm that authorized users can access the agent and that its answers reflect the available corporate policies.&lt;/p&gt;

&lt;p&gt;In our implementation, the agent accesses Google Drive using a service account. This means &lt;strong&gt;employees' individual document permissions are not automatically applied&lt;/strong&gt;. If we later need to use confidential or department-restricted information, we'll need additional authorization and access-control mechanisms.&lt;/p&gt;

&lt;p&gt;With these checks complete, we'll have integrated our Corporate Policies Assistant with Gemini Enterprise, allowing users to access the Google ADK agent from an enterprise platform while it continues to run in a managed Google Cloud Agent Runtime environment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fwiki-cloud.co%2Fwp-content%2Fuploads%2F2026%2F11%2Farticle_image_deploy_ai_agent_google_adk_agent_runtime_gemini_ent_06.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fwiki-cloud.co%2Fwp-content%2Fuploads%2F2026%2F11%2Farticle_image_deploy_ai_agent_google_adk_agent_runtime_gemini_ent_06.gif" alt="Corporate Policies Assistant demo in Gemini Enterprise" width="560" height="445"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figure 6 – Corporate Policies Assistant in action in Gemini Enterprise.&lt;/em&gt;&lt;br&gt;
&lt;a href="https://wiki-cloud.co/wp-content/uploads/2026/11/article_image_deploy_ai_agent_google_adk_agent_runtime_gemini_ent_06.gif" rel="noopener noreferrer"&gt;View animated GIF&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Security, observability, and operations&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Once our agent is deployed in Google Cloud Agent Runtime, we need to consider how to keep it secure and reliable. This means following the principle of least privilege, keeping sensitive credentials out of deployment artifacts, and controlling who can access the agent and corporate information.&lt;/p&gt;

&lt;p&gt;Agent Runtime also provides observability capabilities that help us monitor execution and identify problems. During this demo, we can review Google Cloud logs and metrics to examine response times, query volume, execution errors, Gemini usage, and authentication issues.&lt;/p&gt;

&lt;p&gt;We should also remember that our RAG index is stored in memory and refreshed on demand, so changes made to Google Drive might not become available immediately across all runtime instances.&lt;/p&gt;

&lt;p&gt;If we decide to move this solution into production, we should strengthen security controls, review document access permissions, and evaluate persistent storage, monitoring, and scaling strategies that fit the organization's requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusions&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Throughout this second part, we've taken an important step forward with our Corporate Policies Assistant, moving from an application developed and tested locally to a solution deployed on Google Cloud Agent Runtime and integrated with Gemini Enterprise.&lt;/p&gt;

&lt;p&gt;We reused the agent built earlier with Google ADK, Gemini, and Google Drive, showing that we can move its existing components into a managed cloud environment without rebuilding the entire solution.&lt;/p&gt;

&lt;p&gt;This hands-on exercise also showed why proper packaging, authentication, permissions, and post-deployment validation matter. The tests helped us identify and resolve potential issues related to dependencies, access to Google Cloud services, and Gemini model availability—all essential for a reliable integration.&lt;/p&gt;

&lt;p&gt;Deploying AI agents to the cloud creates new opportunities for organizations by making solutions developed by technical teams available to more users through platforms such as Gemini Enterprise. To realize that potential, however, we also need to consider security, scalability, observability, and agent governance.&lt;/p&gt;

&lt;p&gt;With this implementation, we've established a practical foundation for evolving our assistant into a more robust enterprise solution capable of integrating information, tools, and business processes securely and efficiently.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Resources&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To explore the concepts and procedures covered in this hands-on exercise, here are some additional resources. You'll find the demo's source code, the previous article in this series, and official Google Cloud documentation for learning more about deploying, configuring, and integrating AI agents with Agent Runtime and Gemini Enterprise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Demo project:&lt;/strong&gt; &lt;a href="https://github.com/johnbulla/google-adk-gemini-corporate-policies-agent" rel="noopener noreferrer"&gt;Google ADK + Gemini Corporate Policies Agent&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Previous article:&lt;/strong&gt; &lt;a href="https://wiki-cloud.co/es/2026/11/build-ai-agent-with-google-adk/" rel="noopener noreferrer"&gt;How to Build an AI Agent with Google ADK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent Runtime quickstart with Google ADK:&lt;/strong&gt; &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/runtime/quickstart-adk" rel="noopener noreferrer"&gt;Official documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deploy an agent to Agent Runtime:&lt;/strong&gt; &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/runtime/deploy-an-agent" rel="noopener noreferrer"&gt;Official documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Register ADK agents in Gemini Enterprise:&lt;/strong&gt; &lt;a href="https://docs.cloud.google.com/gemini/enterprise/docs/register-and-manage-an-adk-agent" rel="noopener noreferrer"&gt;Official documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model versions and lifecycle:&lt;/strong&gt; &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/model-versions" rel="noopener noreferrer"&gt;Official documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deployment troubleshooting:&lt;/strong&gt; &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/troubleshooting/agent-deployment" rel="noopener noreferrer"&gt;Official documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-project access:&lt;/strong&gt; &lt;a href="https://docs.cloud.google.com/gemini/enterprise/docs/configure-cross-project-adk-agents" rel="noopener noreferrer"&gt;Official documentation&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope you find this guide useful!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow us:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉&lt;a href="http://wiki-cloud.co/" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt; | 👉&lt;a href="https://www.linkedin.com/in/johnbulla" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; | 👉&lt;a href="https://x.com/johnbulla" rel="noopener noreferrer"&gt;X&lt;/a&gt; | 👉&lt;a href="https://github.com/johnbulla" rel="noopener noreferrer"&gt;Github&lt;/a&gt; | 👉&lt;a href="https://www.youtube.com/user/johnbulla" rel="noopener noreferrer"&gt;Youtube&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>gemini</category>
      <category>googlecloud</category>
    </item>
    <item>
      <title>Cómo desplegar un agente de IA con Google ADK en Agent Runtime y registrarlo en Gemini Enterprise</title>
      <dc:creator>John Bulla</dc:creator>
      <pubDate>Wed, 18 Nov 2026 20:04:22 +0000</pubDate>
      <link>https://dev.to/johnbulla/como-desplegar-un-agente-de-ia-con-google-adk-en-agent-runtime-y-registrarlo-en-gemini-enterprise-1j9m</link>
      <guid>https://dev.to/johnbulla/como-desplegar-un-agente-de-ia-con-google-adk-en-agent-runtime-y-registrarlo-en-gemini-enterprise-1j9m</guid>
      <description>&lt;div class="ltag__user ltag__user__id__666134"&gt;
    &lt;a href="/johnbulla" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=150,height=150,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F666134%2Fc19791a4-86a8-48f5-8ff6-b31d0aa6b1a7.png" alt="johnbulla image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/johnbulla"&gt;John Bulla&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/johnbulla"&gt;💼 Sr. Cloud Solutions Architect - Cloud, Data &amp;amp; AI | Pre-Sales Architect | Cloud Evangelist 
🏆 Google Developer Expert | AWS Community Builder | Alibaba Cloud MVP | Ex-Microsoft MVP&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;✋ &lt;strong&gt;Nota:&lt;/strong&gt; Este artículo se publicó originalmente en mi blog &lt;a href="https://wiki-cloud.co/es/2026/11/how-deploy-ai-agent-google-adk-agent-runtime-gemini-ent" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introducción&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;El desarrollo de agentes de inteligencia artificial está transformando la manera en que las organizaciones acceden a la información, automatizan tareas y optimizan sus procesos de negocio. Sin embargo, construir un agente es solo el primer paso. Para aprovechar realmente su potencial, es necesario llevarlo a un entorno que permita ejecutarlo de manera continua, facilitar su acceso a diferentes usuarios y administrar aspectos como la seguridad, la escalabilidad y la supervisión.&lt;/p&gt;

&lt;p&gt;En este contexto, desplegar agentes de IA en la nube permite evolucionar desde una solución desarrollada en un entorno local hacia una aplicación empresarial preparada para responder a las necesidades de la organización.&lt;/p&gt;

&lt;p&gt;En el &lt;a href="https://wiki-cloud.co/es/2026/11/build-ai-agent-with-google-adk/" rel="noopener noreferrer"&gt;artículo anterior&lt;/a&gt; construimos un &lt;strong&gt;Asistente de Políticas Corporativas&lt;/strong&gt; utilizando &lt;strong&gt;Google ADK, Gemini, Google Drive y Streamlit&lt;/strong&gt;. Aprendimos a consultar documentos corporativos mediante un sistema RAG léxico en memoria y a generar respuestas en lenguaje natural acompañadas de referencias a sus fuentes originales.&lt;/p&gt;

&lt;p&gt;Ahora daremos el siguiente paso: desplegar nuestro agente en &lt;strong&gt;Google Cloud Agent Runtime&lt;/strong&gt;, un servicio administrado que nos permitirá ejecutarlo en la nube sin depender de nuestro equipo local, y posteriormente integrarlo con &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; para que los usuarios puedan acceder al asistente desde una plataforma empresarial.&lt;/p&gt;

&lt;p&gt;No volveremos a desarrollar la aplicación ni las herramientas que implementamos anteriormente; en esta ocasión nos centraremos en preparar el agente para su despliegue, validar su funcionamiento en la nube y publicarlo en Gemini Enterprise.&lt;/p&gt;

&lt;p&gt;Para este laboratorio, continuaremos utilizando Windows, PowerShell, Python 3.12 y el mismo &lt;a href="https://github.com/johnbulla/google-adk-gemini-corporate-policies-agent" rel="noopener noreferrer"&gt;repositorio del proyecto&lt;/a&gt;. El proyecto cuenta con versiones en español e inglés, disponibles en el mismo repositorio.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Objetivo y arquitectura de la solución&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;El objetivo de este ejercicio es dar continuidad al desarrollo de nuestro Asistente de Políticas Corporativas, reutilizando el agente construido con Google ADK para desplegarlo en &lt;strong&gt;Google Cloud Agent Runtime&lt;/strong&gt; y posteriormente integrarlo con &lt;strong&gt;Gemini Enterprise&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Para ello, prepararemos el agente como un paquete instalable de Python que permita trasladar su lógica y dependencias a un entorno administrado en la nube, manteniendo Google Drive como repositorio documental y Gemini, a través de Vertex AI, como modelo encargado de interpretar las consultas y generar las respuestas.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F145yts5oojg1xowt3xma.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F145yts5oojg1xowt3xma.png" alt="Arquitectura objetivo del asistente de políticas corporativas" width="800" height="215"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figura 1 – Arquitectura objetivo del asistente de políticas corporativas.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;En el artículo anterior comprobamos el funcionamiento del asistente desde nuestro entorno local utilizando tres alternativas: &lt;strong&gt;Streamlit&lt;/strong&gt;, mediante una interfaz web personalizada; &lt;strong&gt;ADK Web&lt;/strong&gt;, que nos permitió interactuar con el agente y observar la ejecución de sus herramientas; y &lt;strong&gt;ADK CLI&lt;/strong&gt;, desde donde realizamos consultas directamente a través de la consola de comandos.&lt;/p&gt;

&lt;p&gt;Estas pruebas nos permitieron validar la integración entre los diferentes componentes y comprobar que el agente podía recuperar información de las políticas corporativas mediante el sistema RAG, generar respuestas en lenguaje natural y proporcionar referencias a los documentos consultados.&lt;/p&gt;

&lt;p&gt;En esta segunda parte evolucionaremos la arquitectura sin modificar su funcionalidad principal. La diferencia estará en que Google Cloud Agent Runtime asumirá la ejecución del agente, proporcionando un entorno administrado que facilita su disponibilidad, escalabilidad y supervisión. Por su parte, Gemini Enterprise incorporará una nueva capa de acceso para los usuarios empresariales, desde la cual podrán interactuar con el asistente sin necesidad de utilizar directamente las herramientas de desarrollo.&lt;/p&gt;

&lt;p&gt;De esta manera, conservaremos la solución implementada anteriormente y ampliaremos sus posibilidades de utilización dentro de una organización.&lt;/p&gt;

&lt;p&gt;La arquitectura propuesta mantiene a Google ADK como componente encargado de coordinar la conversación y ejecutar la herramienta de búsqueda de políticas, mientras que el sistema RAG continúa recuperando información de los documentos almacenados en Google Drive. Gemini utilizará estos contenidos como contexto para generar respuestas fundamentadas. Con esta integración, podremos pasar de un agente validado en nuestro equipo a una solución accesible desde Gemini Enterprise.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Nota de arquitectura:&lt;/strong&gt; La conexión de Streamlit con el agente remoto se presenta como una posibilidad de evolución. La integración de Streamlit desarrollada en el artículo anterior ejecutaba el agente localmente.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Fases de implementación&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Para desplegar nuestro Asistente de Políticas Corporativas en Google Cloud y posteriormente integrarlo con Gemini Enterprise, seguiremos un proceso dividido en siete etapas. Como se muestra en la siguiente figura, comenzaremos preparando el entorno y empaquetando el agente, para después desplegarlo en Agent Runtime, validar su funcionamiento mediante pruebas remotas y finalmente publicarlo en Gemini Enterprise, donde estará disponible para los usuarios autorizados de la organización.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fisl0baaewu2l1sdn1w6r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fisl0baaewu2l1sdn1w6r.png" alt="Fases de implementación y despliegue del agente" width="800" height="176"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figura 2 – Fases de implementación y despliegue del agente.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Requisitos previos&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Antes de continuar, asumiremos que la aplicación local ya responde correctamente, que los documentos de políticas se encuentran en una carpeta autorizada de Google Drive y que el entorno virtual del proyecto tiene instaladas las dependencias incluidas en &lt;code&gt;requirements.txt&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Para realizar el despliegue necesitaremos un proyecto de Google Cloud con facturación habilitada, Google Cloud CLI, permisos para crear recursos de Agent Runtime, una cuenta de servicio de ejecución y un bucket de Cloud Storage para los artefactos temporales. El usuario que realiza el despliegue también necesita permisos para utilizar la cuenta de servicio.&lt;/p&gt;
&lt;h3&gt;
  
  
  Configuración de variables
&lt;/h3&gt;

&lt;p&gt;Antes de continuar con la configuración de los recursos en Google Cloud, definiremos algunas variables en PowerShell que utilizaremos durante el despliegue de nuestro agente. Estas variables nos permitirán identificar el proyecto, la región, el bucket de almacenamiento, la cuenta de servicio y el usuario con el que trabajaremos. De esta manera, podremos ejecutar los siguientes comandos de forma más sencilla, sin necesidad de escribir repetidamente los mismos valores.&lt;/p&gt;

&lt;p&gt;Solo tendremos que reemplazar los datos de ejemplo por los correspondientes a nuestro entorno de Google Cloud.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Proyecto de Google Cloud&lt;/span&gt;
&lt;span class="nv"&gt;$PROJECT_ID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"YOUR_PROJECT_ID"&lt;/span&gt;

&lt;span class="c1"&gt;# Región de despliegue&lt;/span&gt;
&lt;span class="nv"&gt;$REGION&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"europe-west1"&lt;/span&gt;

&lt;span class="c1"&gt;# Bucket de Cloud Storage&lt;/span&gt;
&lt;span class="nv"&gt;$BUCKET_NAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"YOUR_STAGING_BUCKET_NAME"&lt;/span&gt;

&lt;span class="c1"&gt;# Cuenta de servicio del agente&lt;/span&gt;
&lt;span class="nv"&gt;$SA_NAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"YOUR_SERVICE_ACCOUNT_NAME"&lt;/span&gt;
&lt;span class="nv"&gt;$SA_EMAIL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"$SA_NAME@$PROJECT_ID.iam.gserviceaccount.com"&lt;/span&gt;

&lt;span class="c1"&gt;# Ruta del bucket para staging&lt;/span&gt;
&lt;span class="nv"&gt;$STAGING_BUCKET&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"gs://$BUCKET_NAME"&lt;/span&gt;

&lt;span class="c1"&gt;# Usuario de Google Cloud&lt;/span&gt;
&lt;span class="nv"&gt;$USER_EMAIL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"YOUR_USER@YOUR_DOMAIN.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Seleccionar el proyecto en GCP y configurar ADC
&lt;/h3&gt;

&lt;p&gt;Antes de comenzar con el despliegue de nuestro agente, debemos configurar el acceso al proyecto de Google Cloud que utilizaremos. Para ello, abrimos una terminal de PowerShell en Visual Studio Code y ejecutamos los siguientes comandos para verificar la instalación de Google Cloud CLI, iniciar sesión y establecer el proyecto de trabajo.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;
&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;auth&lt;/span&gt; &lt;span class="n"&gt;login&lt;/span&gt;
&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;project&lt;/span&gt; &lt;span class="nv"&gt;$PROJECT_ID&lt;/span&gt;
&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;auth&lt;/span&gt; &lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="n"&gt;login&lt;/span&gt;
&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;auth&lt;/span&gt; &lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;quota&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt; &lt;span class="nv"&gt;$PROJECT_ID&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Durante este proceso utilizaremos &lt;strong&gt;Application Default Credentials (ADC)&lt;/strong&gt;, un mecanismo de autenticación de Google Cloud que permite a las aplicaciones y bibliotecas de Python obtener credenciales automáticamente para acceder a sus servicios.&lt;/p&gt;

&lt;p&gt;Es importante distinguir los dos inicios de sesión: &lt;code&gt;gcloud auth login&lt;/code&gt; autentica Google Cloud CLI, mientras que &lt;code&gt;gcloud auth application-default login&lt;/code&gt; configura las credenciales ADC que utilizará nuestro script de despliegue. Finalmente, establecer el proyecto de cuota permite asociar el consumo de las APIs al proyecto seleccionado y evitar advertencias relacionadas con credenciales de usuario sin un proyecto de cuota, siempre que dispongamos de los permisos necesarios.&lt;/p&gt;

&lt;h3&gt;
  
  
  Habilitar APIs
&lt;/h3&gt;

&lt;p&gt;Una vez configurado el acceso a nuestro proyecto de Google Cloud, el siguiente paso será habilitar las APIs necesarias para desplegar y ejecutar el agente en Agent Runtime, así como para integrarlo posteriormente con Gemini Enterprise. Estas APIs permitirán utilizar los servicios de inteligencia artificial, almacenamiento, autenticación y acceso a los recursos empresariales que forman parte de nuestra solución.&lt;/p&gt;

&lt;p&gt;Desde PowerShell, ejecutamos:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;services&lt;/span&gt; &lt;span class="n"&gt;enable&lt;/span&gt; &lt;span class="sb"&gt;`
  aiplatform.googleapis.com `&lt;/span&gt;
  &lt;span class="n"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;googleapis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt; &lt;span class="sb"&gt;`
  cloudresourcemanager.googleapis.com `&lt;/span&gt;
  &lt;span class="n"&gt;iam&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;googleapis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt; &lt;span class="sb"&gt;`
  iamcredentials.googleapis.com `&lt;/span&gt;
  &lt;span class="n"&gt;drive&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;googleapis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt; &lt;span class="sb"&gt;`
  discoveryengine.googleapis.com `&lt;/span&gt;
  &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;googleapis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt; &lt;span class="sb"&gt;`
  --project=$PROJECT_ID
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Con este comando habilitamos los servicios necesarios para utilizar Vertex AI y Agent Runtime, gestionar los artefactos de despliegue en Cloud Storage, administrar las identidades y permisos mediante IAM, consultar documentos de Google Drive e integrar nuestro agente con Gemini Enterprise. También habilitamos Cloud Logging para facilitar la revisión de los registros de ejecución.&lt;/p&gt;

&lt;p&gt;Es importante tener en cuenta que habilitar estas APIs no concede automáticamente permisos de acceso. Estos deberán configurarse posteriormente mediante los roles IAM correspondientes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Crear el bucket de staging en Cloud Storage
&lt;/h3&gt;

&lt;p&gt;El siguiente paso será crear un bucket en Google Cloud Storage, que utilizaremos como espacio de almacenamiento temporal durante el despliegue de nuestro agente en Agent Runtime. Este recurso permitirá almacenar los paquetes de Python y los artefactos necesarios para preparar y desplegar nuestro agente en Google Cloud.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;storage&lt;/span&gt; &lt;span class="n"&gt;buckets&lt;/span&gt; &lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="nv"&gt;$STAGING_BUCKET&lt;/span&gt; &lt;span class="sb"&gt;`
  --project=$PROJECT_ID `&lt;/span&gt;
  &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$REGION&lt;/span&gt; &lt;span class="sb"&gt;`
  --uniform-bucket-level-access
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;En este ejemplo utilizaremos la región &lt;code&gt;europe-west1&lt;/code&gt; y habilitaremos el acceso uniforme al bucket, que permite administrar los permisos de acceso mediante IAM. Debemos reemplazar el nombre de ejemplo del bucket por un nombre único y el identificador del proyecto por el real.&lt;/p&gt;

&lt;p&gt;Si el bucket ya existe, no será necesario crearlo nuevamente. Únicamente debemos comprobar que tenemos los permisos necesarios para utilizarlo durante el despliegue.&lt;/p&gt;

&lt;h3&gt;
  
  
  Crear y configurar la cuenta de servicio
&lt;/h3&gt;

&lt;p&gt;Una vez preparado el almacenamiento, crearemos una &lt;strong&gt;cuenta de servicio (Service Account)&lt;/strong&gt; que utilizará nuestro Asistente de Políticas Corporativas cuando se ejecute en Google Cloud Agent Runtime. Esta cuenta proporcionará una identidad propia al agente para acceder a los servicios autorizados de Google Cloud, sin depender de las credenciales personales del desarrollador.&lt;/p&gt;

&lt;h4&gt;
  
  
  Crear la cuenta de servicio
&lt;/h4&gt;

&lt;p&gt;Desde PowerShell, ejecutamos el siguiente comando utilizando las variables que configuramos anteriormente:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;iam&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;accounts&lt;/span&gt; &lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="nv"&gt;$SA_NAME&lt;/span&gt; &lt;span class="sb"&gt;`
  --display-name="Corporate Policies Agent Runtime" `&lt;/span&gt;
  &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$PROJECT_ID&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este comando creará la cuenta de servicio que utilizaremos durante la ejecución del agente. Su dirección de correo electrónico tendrá el siguiente formato: &lt;code&gt;YOUR_SERVICE_ACCOUNT_NAME@YOUR_PROJECT_ID.iam.gserviceaccount.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Una vez creada la cuenta de servicio, asignaremos el rol &lt;code&gt;roles/aiplatform.user&lt;/code&gt;, que permitirá al agente utilizar los servicios de Vertex AI necesarios para interactuar con Gemini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;projects&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;iam&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;policy&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;binding&lt;/span&gt; &lt;span class="nv"&gt;$PROJECT_ID&lt;/span&gt; &lt;span class="sb"&gt;`
  --member="serviceAccount:$SA_EMAIL" `&lt;/span&gt;
  &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"roles/aiplatform.user"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este rol se utiliza en nuestra demostración para facilitar la ejecución del agente. En entornos productivos conviene evaluar permisos más específicos, siguiendo el principio de mínimo privilegio.&lt;/p&gt;

&lt;h4&gt;
  
  
  Configurar el acceso a Google Drive
&lt;/h4&gt;

&lt;p&gt;Además de interactuar con Gemini, nuestro agente necesita consultar los documentos almacenados en Google Drive. Para ello, debemos compartir la carpeta que contiene las políticas corporativas con el correo electrónico de la cuenta de servicio y asignarle el permiso de &lt;strong&gt;Lector (Viewer)&lt;/strong&gt;, siempre que las políticas de Google Workspace permitan este tipo de acceso.&lt;/p&gt;

&lt;p&gt;Debemos recordar que los permisos de Google Drive se administran de forma independiente de los roles IAM de Google Cloud. Por tanto, asignar &lt;code&gt;roles/aiplatform.user&lt;/code&gt; no concede automáticamente acceso a los documentos.&lt;/p&gt;

&lt;p&gt;En el artículo anterior utilizamos un archivo JSON de credenciales para ejecutar el agente localmente. En esta nueva implementación aprovecharemos la identidad asociada a Agent Runtime y Application Default Credentials (ADC), evitando incluir claves privadas dentro del paquete de despliegue.&lt;/p&gt;

&lt;p&gt;De esta manera, nuestro agente contará con una identidad dedicada para acceder a los servicios autorizados y ejecutarse de forma más segura en Google Cloud.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configurar los permisos IAM del usuario de Google Cloud
&lt;/h3&gt;

&lt;p&gt;Después de configurar la cuenta de servicio, debemos verificar que nuestro usuario de Google Cloud tenga los permisos necesarios para desplegar el agente y realizar las pruebas desde PowerShell.&lt;/p&gt;

&lt;p&gt;Es importante diferenciar ambas identidades: mientras la cuenta de servicio se utilizará durante la ejecución del agente, nuestro usuario será el encargado de preparar el despliegue, crear el recurso en Agent Runtime y comprobar su funcionamiento.&lt;/p&gt;

&lt;p&gt;Para este laboratorio, utilizaremos los siguientes roles:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Rol IAM&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;roles/aiplatform.user&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Permite al usuario acceder a los servicios de Vertex AI y Agent Runtime, interactuar con los modelos Gemini y realizar consultas a los agentes desplegados.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;roles/aiplatform.sessionUser&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Permite al usuario crear y administrar sesiones de conversación con los agentes desplegados en Agent Runtime.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Desde PowerShell, ejecutamos:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;projects&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;iam&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;policy&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;binding&lt;/span&gt; &lt;span class="nv"&gt;$PROJECT_ID&lt;/span&gt; &lt;span class="sb"&gt;`
  --member="user:$USER_EMAIL" `&lt;/span&gt;
  &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"roles/aiplatform.user"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;projects&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;iam&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;policy&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;binding&lt;/span&gt; &lt;span class="nv"&gt;$PROJECT_ID&lt;/span&gt; &lt;span class="sb"&gt;`
  --member="user:$USER_EMAIL" `&lt;/span&gt;
  &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"roles/aiplatform.sessionUser"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Estructura del proyecto y archivos específicos del despliegue&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Antes de continuar con el despliegue en Google Cloud Agent Runtime, revisaremos brevemente la estructura de nuestro proyecto para identificar los archivos que utilizaremos en esta nueva etapa. Como el agente y sus componentes principales ya fueron desarrollados en el artículo anterior, no será necesario modificar su arquitectura ni volver a implementar sus funcionalidades.&lt;/p&gt;

&lt;p&gt;Nos centraremos en los archivos responsables de preparar el paquete de Python, desplegar el agente y comprobar su funcionamiento una vez que esté ejecutándose en la nube.&lt;/p&gt;

&lt;p&gt;Para facilitar la comprensión del proceso, a continuación, mostramos una versión simplificada de la estructura del repositorio, destacando los archivos relacionados con el despliegue y las pruebas.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;google-adk-gemini-corporate-policies-agent/
├── requirements.txt
├── sources_en/
│   ├── .env
│   ├── corporate_agent/          # Código del agente ya desarrollado
│   ├── pyproject.toml            # Metadatos del paquete wheel
│   ├── deployment/
│   │   ├── deploy_agent.py
│   │   └── runtime_resource.txt  # Se crea después del despliegue
│   └── test/
│       └── test_runtime.py
└── sources_es/                   # Versión equivalente en español
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Archivo&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sources_en/pyproject.toml&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Define el paquete instalable &lt;code&gt;corporate-policies-agent&lt;/code&gt; y declara que debe incluir &lt;code&gt;corporate_agent&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sources_en/deployment/deploy_agent.py&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Valida el entorno, crea el wheel, despliega &lt;code&gt;AdkApp&lt;/code&gt; y guarda la ruta del recurso remoto.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sources_en/deployment/runtime_resource.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Archivo de salida con la ruta completa del recurso creado.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sources_es/test/test_runtime.py&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Obtiene la referencia remota, se conecta a Agent Runtime y envía consultas de comprobación.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;requirements.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Conjunto de dependencias del proyecto; el script también establece las necesarias para el runtime.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Variables de entorno específicas de esta etapa&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Una vez preparado nuestro proyecto, el siguiente paso será revisar las variables de entorno que utilizaremos para desplegar el agente en Google Cloud Agent Runtime y comprobar su funcionamiento. Estas configuraciones nos permitirán indicar en qué proyecto y región se ejecutará el agente, qué recursos utilizará y cómo se autenticará para acceder a los servicios de Google Cloud.&lt;/p&gt;

&lt;p&gt;Como en el artículo anterior ya configuramos las variables necesarias para el desarrollo local, en esta ocasión nos centraremos únicamente en aquellas relacionadas con el despliegue y las pruebas en la nube.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GOOGLE_CLOUD_PROJECT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Identifica el proyecto de Google Cloud donde desplegaremos nuestro agente.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AGENT_RUNTIME_LOCATION&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Define la región de Google Cloud donde se ejecutará el agente. Para esta demostración utilizaremos &lt;code&gt;europe-west1&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AGENT_RUNTIME_STAGING_BUCKET&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Indica el bucket de Cloud Storage que utilizaremos para almacenar temporalmente los archivos necesarios durante el despliegue. Su formato es &lt;code&gt;gs://YOUR_STAGING_BUCKET&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AGENT_RUNTIME_SERVICE_ACCOUNT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Contiene el correo electrónico de la cuenta de servicio que utilizará nuestro agente para acceder a los recursos autorizados de Google Cloud.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GOOGLE_GENAI_USE_VERTEXAI&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Permite indicar que nuestro agente utilizará Vertex AI para conectarse con Gemini. Durante la ejecución en Agent Runtime estableceremos su valor en &lt;code&gt;TRUE&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GEMINI_MODEL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Define el modelo Gemini que utilizará nuestro agente para procesar las consultas y generar respuestas. En nuestro proyecto se configura &lt;code&gt;gemini-3.5-flash-lite&lt;/code&gt; como valor predeterminado, siempre que esté disponible para el proyecto.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GEMINI_VERTEX_LOCATION&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Especifica la ubicación desde la que se realizarán las consultas al modelo Gemini. En nuestro ejemplo utilizaremos &lt;code&gt;global&lt;/code&gt;, que puede ser diferente de la región donde está desplegado Agent Runtime.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DRIVE_AUTH_MODE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Define cómo se autenticará el agente para consultar Google Drive. Utilizaremos &lt;code&gt;adc&lt;/code&gt; para aprovechar la identidad del entorno de ejecución, sin necesidad de incorporar un archivo JSON de credenciales.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AGENT_RUNTIME_RESOURCE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Permite indicar el identificador del agente desplegado para realizar las pruebas remotas. Es opcional, ya que &lt;code&gt;test_runtime.py&lt;/code&gt; también puede obtenerlo desde &lt;code&gt;deployment/runtime_resource.txt&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Por otra parte, mantendremos las variables &lt;code&gt;GOOGLE_DRIVE_FOLDER_ID&lt;/code&gt; y &lt;code&gt;RAG_REFRESH_INTERVAL_SECONDS&lt;/code&gt;, que ya configuramos en el artículo anterior. La primera identifica la carpeta de Google Drive donde se encuentran nuestras políticas corporativas, mientras que la segunda establece el intervalo de actualización del índice RAG utilizado por el agente.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Empaquetado del agente mediante pyproject.toml&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Antes de desplegar nuestro Asistente de Políticas Corporativas en Google Cloud Agent Runtime, necesitamos preparar su código para que pueda instalarse y ejecutarse correctamente en la nube. Para ello, utilizaremos un &lt;strong&gt;paquete Wheel (&lt;code&gt;.whl&lt;/code&gt;)&lt;/strong&gt;, un formato de distribución de Python que permite agrupar el código de una aplicación y sus metadatos en un archivo instalable.&lt;/p&gt;

&lt;p&gt;Los paquetes Wheel facilitan la distribución e instalación de aplicaciones Python, ya que contienen los archivos necesarios para que el entorno de destino pueda reconocer y utilizar sus módulos. En nuestro proyecto, este mecanismo nos permitirá trasladar el código de &lt;code&gt;corporate_agent&lt;/code&gt; a Agent Runtime y asegurar que sus componentes puedan importarse correctamente durante la ejecución del agente.&lt;/p&gt;

&lt;p&gt;Para generar el paquete Wheel utilizaremos el archivo &lt;code&gt;pyproject.toml&lt;/code&gt;, ubicado en las carpetas &lt;code&gt;sources_en/&lt;/code&gt; y &lt;code&gt;sources_es/&lt;/code&gt;, que contiene la configuración necesaria para construir y distribuir nuestro agente como un paquete de Python.&lt;/p&gt;

&lt;p&gt;Este archivo define &lt;code&gt;setuptools&lt;/code&gt; como herramienta de construcción, establece el nombre del paquete &lt;code&gt;corporate-policies-agent&lt;/code&gt; e indica que debe incluirse el módulo &lt;code&gt;corporate_agent&lt;/code&gt;, donde se encuentran los archivos principales de nuestra solución, como &lt;code&gt;__init__.py&lt;/code&gt;, &lt;code&gt;agent.py&lt;/code&gt; y &lt;code&gt;drive_rag.py&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;De esta manera, Python podrá reconocer e instalar nuestro agente en el entorno remoto sin necesidad de copiar manualmente sus archivos ni modificar las importaciones que implementamos anteriormente.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preparar las herramientas de empaquetado
&lt;/h3&gt;

&lt;p&gt;Antes de iniciar el despliegue, comprobaremos que nuestro entorno virtual dispone de las herramientas necesarias para construir el paquete Wheel.&lt;/p&gt;

&lt;p&gt;Desde la terminal PowerShell de Visual Studio Code, ejecutamos:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;cd&lt;/span&gt; &lt;span class="no"&gt;C&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;\&lt;span class="nc"&gt;Projects&lt;/span&gt;\&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;adk&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;gemini&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;corporate&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;policies&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;venv&lt;/span&gt;\&lt;span class="nc"&gt;Scripts&lt;/span&gt;\&lt;span class="nc"&gt;Activate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ps1&lt;/span&gt;
&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;upgrade&lt;/span&gt; &lt;span class="n"&gt;setuptools&lt;/span&gt; &lt;span class="n"&gt;wheel&lt;/span&gt;
&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Con estos comandos activamos nuestro entorno virtual, instalamos o actualizamos las herramientas de empaquetado y verificamos que no existan conflictos entre las dependencias instaladas.&lt;/p&gt;

&lt;h3&gt;
  
  
  Generación del paquete Wheel durante el despliegue
&lt;/h3&gt;

&lt;p&gt;En nuestro proyecto no será necesario generar manualmente el archivo Wheel, ya que esta tarea está incorporada en &lt;code&gt;deployment/deploy_agent.py&lt;/code&gt;, que explicaremos en el siguiente apartado.&lt;/p&gt;

&lt;p&gt;Durante su ejecución, el script construye temporalmente el paquete &lt;code&gt;.whl&lt;/code&gt;, comprueba que incluya los archivos principales del agente y lo incorpora a las dependencias que se instalarán en Agent Runtime.&lt;/p&gt;

&lt;p&gt;Este procedimiento también facilita la compatibilidad entre nuestro entorno de desarrollo en Windows y el entorno Linux utilizado por Agent Runtime, evitando depender de rutas absolutas locales que no existirán en la nube.&lt;/p&gt;

&lt;p&gt;Con este mecanismo tendremos el código de nuestro agente preparado para instalarse en Agent Runtime, manteniendo su estructura original y facilitando su despliegue sin necesidad de desarrollar nuevamente los componentes que ya implementamos en el artículo anterior.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Desplegar en Google Cloud Agent Runtime&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Una vez preparados los recursos de Google Cloud y configurado el empaquetado de nuestro agente, estamos listos para desplegarlo en Agent Runtime. Para ello, utilizaremos el archivo &lt;code&gt;deploy_agent.py&lt;/code&gt;, que se encargará de realizar las verificaciones necesarias, preparar el código y sus dependencias, y crear el agente en el entorno administrado de Google Cloud.&lt;/p&gt;

&lt;h3&gt;
  
  
  Estructura y funcionamiento de deploy_agent.py
&lt;/h3&gt;

&lt;p&gt;Este archivo se encuentra en &lt;code&gt;sources_en/deployment/deploy_agent.py&lt;/code&gt; (versión en inglés) o &lt;code&gt;sources_es/deployment/deploy_agent.py&lt;/code&gt; (versión en español) y está organizado en nueve bloques principales que explicaremos a continuación.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Bloque&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;1. Importaciones y variables de entorno del proyecto&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Se importan las bibliotecas necesarias para realizar el despliegue y se cargan las variables de configuración desde el archivo &lt;code&gt;.env&lt;/code&gt;. También se identifican las variables reservadas que Agent Runtime administra automáticamente y que no debemos enviar como parte de la configuración del agente remoto.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;2. Lectura y validación de la configuración&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Comprueba que disponemos de la información necesaria para el despliegue, como el identificador del proyecto, el bucket de staging, la cuenta de servicio y la carpeta de Google Drive. Estas validaciones permiten detectar configuraciones incompletas antes de crear recursos en la nube.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;3. Preparación del entorno de autenticación&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mediante &lt;code&gt;prepare_deployment_environment()&lt;/code&gt;, configuramos el uso de Vertex AI y preparamos el entorno para autenticarnos mediante ADC. También evitamos que se utilice accidentalmente una API Key o credenciales JSON locales.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4. Verificación de credenciales y acceso a Cloud Storage&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;verify_deployment_credentials()&lt;/code&gt; comprueba que contamos con credenciales ADC válidas y verifica el acceso al bucket de staging.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;5. Configuración de las variables del agente remoto&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;build_runtime_env()&lt;/code&gt; prepara los parámetros del modelo Gemini, la autenticación mediante ADC, la ubicación de los documentos de Drive y el intervalo de actualización del índice RAG.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;6. Generación del paquete Wheel&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;build_agent_wheel()&lt;/code&gt; construye el paquete instalable del agente, verifica que incluya los archivos principales y prepara sus rutas para el entorno remoto.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;7. Creación del agente en Agent Runtime&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mediante &lt;code&gt;AdkApp&lt;/code&gt; preparamos el agente ADK y con &lt;code&gt;client.agent_engines.create()&lt;/code&gt; creamos el recurso administrado con dependencias, wheel, bucket, cuenta de servicio y variables de entorno.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;8. Registro del identificador del agente desplegado&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;El script obtiene el identificador completo y lo guarda en &lt;code&gt;deployment/runtime_resource.txt&lt;/code&gt;, necesario para las pruebas y el registro posterior en Gemini Enterprise.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;9. Punto de entrada del despliegue&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Ejecuta &lt;code&gt;main()&lt;/code&gt; cuando iniciamos el archivo como módulo de Python y coordina las fases anteriores.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Ejecutar el despliegue del agente
&lt;/h3&gt;

&lt;p&gt;Una vez comprendido el funcionamiento de &lt;code&gt;deploy_agent.py&lt;/code&gt;, podemos comenzar el despliegue. Para ello, abrimos la terminal PowerShell de Visual Studio Code, nos ubicamos en la carpeta raíz del proyecto y comprobamos que el entorno virtual esté activo.&lt;/p&gt;

&lt;p&gt;Para la versión en inglés:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;PYTHONPATH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"$PWD\sources_en"&lt;/span&gt;
&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;sources_en&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deployment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deploy_agent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Para la versión en español, utilizamos el paquete correspondiente:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;PYTHONPATH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"$PWD\sources_es"&lt;/span&gt;
&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;sources_es&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deployment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deploy_agent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este comando inicia el proceso de despliegue utilizando la configuración preparada anteriormente. Durante su ejecución, el script verificará las credenciales, comprobará el acceso al bucket de Cloud Storage, generará el paquete Wheel y enviará los componentes necesarios a Google Cloud Agent Runtime.&lt;/p&gt;

&lt;p&gt;Si todo funciona correctamente, obtendremos un mensaje que confirma la creación del agente y muestra su identificador con un formato similar al siguiente:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Recurso creado:
projects/YOUR_PROJECT_NUMBER/locations/europe-west1/reasoningEngines/RESOURCE_ID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este identificador corresponde al recurso creado en Agent Runtime y quedará almacenado en &lt;code&gt;deployment/runtime_resource.txt&lt;/code&gt;, por lo que no tendremos que copiarlo manualmente para realizar las pruebas posteriores.&lt;/p&gt;

&lt;p&gt;Es importante tener en cuenta que el despliegue puede generar costos en Google Cloud y que su finalización no garantiza por sí sola que el agente pueda responder correctamente. Por esta razón, antes de integrarlo con Gemini Enterprise, comprobaremos su funcionamiento mediante consultas remotas.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnlvkcgfvpklk7fu51q3v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnlvkcgfvpklk7fu51q3v.png" alt="Despliegue del agente en Agent Runtime" width="800" height="221"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figura 3 – Despliegue del agente en Agent Runtime.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Validar el funcionamiento del agente con test_runtime.py&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Después de desplegar nuestro Asistente de Políticas Corporativas, necesitamos comprobar que puede ejecutarse correctamente en Google Cloud y continuar consultando los documentos almacenados en Google Drive.&lt;/p&gt;

&lt;p&gt;Para realizar estas verificaciones utilizaremos el archivo &lt;code&gt;sources_en/test/test_runtime.py&lt;/code&gt; (versión en inglés) o &lt;code&gt;sources_es/test/test_runtime.py&lt;/code&gt; (versión en español), que permite conectarnos al agente desplegado y enviarle diferentes preguntas desde la terminal de PowerShell.&lt;/p&gt;

&lt;p&gt;A diferencia de las pruebas realizadas en el artículo anterior, ahora las consultas no se ejecutarán directamente sobre el agente local, sino sobre el recurso que hemos creado en Google Cloud Agent Runtime.&lt;/p&gt;
&lt;h3&gt;
  
  
  Ejecutar las pruebas del agente remoto
&lt;/h3&gt;

&lt;p&gt;Desde la carpeta raíz del proyecto, con el entorno virtual activado, ejecutamos para la versión en inglés:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;sources_en&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;test_runtime&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Para la versión en español:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;sources_es&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;test_runtime&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;El script recuperará automáticamente el identificador del agente desplegado y establecerá la conexión con Agent Runtime. Si la conexión se realiza correctamente, veremos una salida similar a la siguiente:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Proyecto: YOUR_PROJECT_ID
Región: europe-west1
Agente: projects/YOUR_PROJECT_NUMBER/locations/europe-west1/reasoningEngines/RESOURCE_ID
Conexión con Agent Runtime establecida.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Posteriormente, el script enviará varias consultas de prueba, como:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hola, ¿puedes presentarte y explicar qué haces?&lt;/li&gt;
&lt;li&gt;¿Cuál es la política corporativa de vacaciones?&lt;/li&gt;
&lt;li&gt;¿Cuántos días de vacaciones tienen los empleados?&lt;/li&gt;
&lt;li&gt;¿Cuál es la política corporativa de trabajo remoto?&lt;/li&gt;
&lt;li&gt;¿Qué políticas corporativas puedes consultar?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Durante estas pruebas debemos comprobar que el agente responde correctamente, utiliza la herramienta &lt;code&gt;search_corporate_policies&lt;/code&gt; cuando necesita consultar información y genera respuestas basadas en los documentos disponibles en Google Drive.&lt;/p&gt;

&lt;p&gt;También es importante revisar los eventos devueltos por Agent Runtime, ya que una conexión establecida no significa necesariamente que la consulta al modelo Gemini se haya completado correctamente.&lt;/p&gt;

&lt;p&gt;Una vez completadas las pruebas y confirmado que nuestro agente funciona correctamente en la nube, tendremos preparada la integración con Gemini Enterprise, donde podremos registrarlo y ponerlo a disposición de los usuarios autorizados de la organización.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Registrar el agente en Gemini Enterprise&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Una vez desplegado nuestro Asistente de Políticas Corporativas y comprobado su funcionamiento en Google Cloud Agent Runtime, el siguiente paso será integrarlo con Gemini Enterprise. Esta plataforma permitirá que los usuarios de la organización interactúen con nuestro agente mediante una interfaz conversacional, sin necesidad de utilizar herramientas de desarrollo como Streamlit, ADK Web o la consola de comandos.&lt;/p&gt;

&lt;p&gt;Para ello, crearemos una aplicación en Gemini Enterprise y registraremos el agente que hemos desplegado previamente en Google Cloud, aprovechando su lógica, herramientas y conexión con los documentos almacenados en Google Drive.&lt;/p&gt;

&lt;h3&gt;
  
  
  Crear una aplicación en Gemini Enterprise
&lt;/h3&gt;

&lt;p&gt;Para comenzar, crearemos una nueva aplicación en Gemini Enterprise que funcionará como punto de acceso a nuestro Asistente de Políticas Corporativas.&lt;/p&gt;

&lt;p&gt;Desde Google Cloud Console, realizamos los siguientes pasos:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Accedemos a &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; y seleccionamos nuestro proyecto de Google Cloud.&lt;/li&gt;
&lt;li&gt;En el menú de navegación, nos dirigimos a &lt;strong&gt;Apps (Aplicaciones)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Hacemos clic en &lt;strong&gt;Create app (Crear aplicación)&lt;/strong&gt; para iniciar la configuración.&lt;/li&gt;
&lt;li&gt;Introducimos el nombre de nuestra aplicación, por ejemplo, &lt;code&gt;Corporate Policies Assistant&lt;/code&gt;, y completamos los campos solicitados.&lt;/li&gt;
&lt;li&gt;Seleccionamos la ubicación de la aplicación y las opciones disponibles según la edición de Gemini Enterprise que estemos utilizando. En este caso, seleccionamos &lt;code&gt;global&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Revisamos la configuración y finalizamos seleccionando &lt;strong&gt;Create (Crear)&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Durante la creación es importante verificar que nuestro proyecto dispone de los permisos y las licencias necesarias para utilizar Gemini Enterprise. También debemos tener en cuenta que la ubicación de esta aplicación puede ser diferente de la región donde desplegamos el agente en Agent Runtime, siempre que ambas configuraciones sean compatibles.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmp27xuvepiksjo8ue8o2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmp27xuvepiksjo8ue8o2.png" alt="Creación de una aplicación en Gemini Enterprise" width="800" height="206"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figura 4 – Creación de una aplicación en Gemini Enterprise.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Una vez creada, tendremos disponible nuestra aplicación empresarial, en la que podremos incorporar el agente que desarrollamos con Google ADK.&lt;/p&gt;

&lt;h3&gt;
  
  
  Registrar el agente personalizado
&lt;/h3&gt;

&lt;p&gt;Con nuestra aplicación creada, el siguiente paso será registrar el Asistente de Políticas Corporativas que desplegamos anteriormente en Google Cloud Agent Runtime.&lt;/p&gt;

&lt;p&gt;Para ello, accedemos a la configuración de nuestra aplicación (&lt;code&gt;Corporate Policies Assistant&lt;/code&gt;) en Gemini Enterprise y seguimos estos pasos:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Abrimos la sección &lt;strong&gt;Agents (Agentes)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Seleccionamos &lt;strong&gt;Custom agent via Agent Runtime&lt;/strong&gt; para registrar nuestro agente personalizado.&lt;/li&gt;
&lt;li&gt;En el primer paso, correspondiente a las autorizaciones, mantenemos la configuración predeterminada para nuestra demostración.&lt;/li&gt;
&lt;li&gt;En el apartado de configuración, completamos los datos del agente.&lt;/li&gt;
&lt;li&gt;Introducimos el nombre, la descripción y el identificador del recurso desplegado, utilizando los siguientes valores como referencia:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Campo&lt;/th&gt;
&lt;th&gt;Valor de ejemplo&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Nombre&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Corporate Policies Assistant&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Descripción&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;An agent that consults internal policies—covering Human Resources, Finance, Legal, Security, and other areas—based on authorized documents stored in Google Drive.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Ruta del recurso&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;projects/PROJECT_NUMBER/locations/europe-west1/reasoningEngines/RESOURCE_ID&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Revisamos la configuración y confirmamos el registro del agente.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;La descripción permite identificar la finalidad del agente y el tipo de consultas que puede atender. Por su parte, la ruta del recurso establece la conexión con el agente desplegado en Agent Runtime. Este identificador es el mismo que obtuvimos durante el despliegue y que quedó almacenado en &lt;code&gt;deployment/runtime_resource.txt&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2ai8yp6y8qexgd1yrq5s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2ai8yp6y8qexgd1yrq5s.png" alt="Agente registrado en Gemini Enterprise" width="800" height="276"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figura 5 – Registro del agente en Gemini Enterprise.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Una vez registrado, configuraremos su disponibilidad para que los usuarios o grupos autorizados puedan utilizarlo desde Gemini Enterprise.&lt;/p&gt;

&lt;p&gt;Es importante comprobar que la aplicación cuenta con los permisos necesarios para invocar el agente. Si Gemini Enterprise y Agent Runtime se encuentran en proyectos diferentes de Google Cloud, también tendremos que configurar los permisos de acceso entre ambos proyectos.&lt;/p&gt;

&lt;h3&gt;
  
  
  Validar el funcionamiento del agente en Gemini Enterprise
&lt;/h3&gt;

&lt;p&gt;Una vez completado el registro, podremos acceder a nuestra aplicación de Gemini Enterprise y comenzar a interactuar con el Asistente de Políticas Corporativas desde su interfaz conversacional.&lt;/p&gt;

&lt;p&gt;Para comprobar que la integración funciona correctamente, realizaremos algunas de las preguntas que utilizamos anteriormente durante las pruebas desde PowerShell, como consultar los días de vacaciones, las condiciones de trabajo remoto o los procedimientos de reembolso.&lt;/p&gt;

&lt;p&gt;Durante estas pruebas debemos verificar que el agente responde de manera coherente, recupera información de los documentos almacenados en Google Drive y proporciona referencias a las fuentes consultadas cuando estas se encuentran disponibles.&lt;/p&gt;

&lt;p&gt;También es importante comprobar que los usuarios autorizados pueden acceder al agente y que la información proporcionada corresponde a las políticas corporativas disponibles.&lt;/p&gt;

&lt;p&gt;Debemos tener en cuenta que, en nuestra implementación, el agente consulta Google Drive utilizando una cuenta de servicio. Por tanto, &lt;strong&gt;los permisos individuales de los empleados sobre los documentos no se aplican automáticamente&lt;/strong&gt;. Si posteriormente queremos utilizar información confidencial o restringida por áreas, será necesario incorporar mecanismos adicionales de autorización y control de acceso.&lt;/p&gt;

&lt;p&gt;Con estas validaciones habremos completado la integración de nuestro Asistente de Políticas Corporativas con Gemini Enterprise, permitiendo que el agente desarrollado con Google ADK pueda utilizarse desde una plataforma empresarial, mientras continúa ejecutándose de forma administrada en Google Cloud Agent Runtime.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fwiki-cloud.co%2Fwp-content%2Fuploads%2F2026%2F11%2Farticle_image_deploy_ai_agent_google_adk_agent_runtime_gemini_ent_06.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fwiki-cloud.co%2Fwp-content%2Fuploads%2F2026%2F11%2Farticle_image_deploy_ai_agent_google_adk_agent_runtime_gemini_ent_06.gif" alt="Demostración del Asistente de Políticas Corporativas en Gemini Enterprise" width="560" height="445"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figura 6 – Agente Asistente de Políticas Corporativas en acción en Gemini Enterprise.&lt;/em&gt;&lt;br&gt;
&lt;a href="https://wiki-cloud.co/wp-content/uploads/2026/11/article_image_deploy_ai_agent_google_adk_agent_runtime_gemini_ent_06.gif" rel="noopener noreferrer"&gt;Ver GIF animado&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Seguridad, observabilidad y operación&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Una vez desplegado nuestro agente en Google Cloud Agent Runtime, es importante considerar algunos aspectos que nos permitan mantener su funcionamiento de manera segura y confiable. Para ello, debemos aplicar el principio de mínimo privilegio, evitar incluir credenciales sensibles en los archivos de despliegue y controlar qué usuarios pueden acceder al agente y a la información corporativa.&lt;/p&gt;

&lt;p&gt;Por otra parte, Agent Runtime ofrece capacidades de observabilidad que permiten supervisar la ejecución del agente e identificar posibles problemas. Durante nuestra demostración, podemos revisar los registros y métricas de Google Cloud para analizar los tiempos de respuesta, el número de consultas, los errores de ejecución, el consumo de Gemini y los problemas de autenticación.&lt;/p&gt;

&lt;p&gt;También debemos tener en cuenta que nuestro índice RAG se mantiene en memoria y se actualiza bajo demanda, por lo que los cambios en Google Drive no necesariamente estarán disponibles de forma inmediata en todas las instancias.&lt;/p&gt;

&lt;p&gt;Finalmente, si decidimos llevar esta solución a un entorno de producción, será recomendable fortalecer los controles de seguridad, revisar los permisos de acceso a los documentos y evaluar mecanismos de almacenamiento persistente, supervisión y escalabilidad que permitan responder a las necesidades de la organización.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusiones&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A lo largo de esta segunda parte, hemos dado un paso importante en la evolución de nuestro Asistente de Políticas Corporativas, pasando de una aplicación desarrollada y probada localmente a una solución desplegada en Google Cloud Agent Runtime e integrada con Gemini Enterprise.&lt;/p&gt;

&lt;p&gt;Para ello, aprovechamos el agente que construimos anteriormente con Google ADK, Gemini y Google Drive, demostrando que podemos reutilizar sus componentes y llevarlos a un entorno administrado en la nube sin necesidad de desarrollar nuevamente toda la solución.&lt;/p&gt;

&lt;p&gt;Durante este laboratorio, también hemos comprendido la importancia de preparar correctamente el empaquetado del agente, configurar los mecanismos de autenticación y permisos, y validar su funcionamiento una vez desplegado. Estas pruebas nos permitieron identificar y resolver posibles problemas relacionados con las dependencias, el acceso a los servicios de Google Cloud y la disponibilidad de los modelos Gemini, aspectos fundamentales para garantizar una integración confiable.&lt;/p&gt;

&lt;p&gt;El despliegue de agentes de IA en la nube abre nuevas posibilidades para las organizaciones, al facilitar que las soluciones desarrolladas por los equipos técnicos puedan ponerse a disposición de diferentes usuarios mediante plataformas como Gemini Enterprise. Sin embargo, para aprovechar todo su potencial, es necesario considerar aspectos como la seguridad, la escalabilidad, la observabilidad y el gobierno de los agentes.&lt;/p&gt;

&lt;p&gt;Con esta implementación, hemos establecido una base práctica para continuar evolucionando nuestro asistente hacia soluciones empresariales más robustas, capaces de integrar información, herramientas y procesos de negocio de manera segura y eficiente.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Recursos&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Para profundizar en los conceptos y procedimientos que hemos abordado durante este ejercicio, comparto los siguientes recursos de referencia. Aquí encontrarás el código fuente de nuestra demostración, el artículo anterior de esta serie y la documentación oficial de Google Cloud, que permitirá profundizar en el despliegue, la configuración y la integración de agentes de inteligencia artificial con Agent Runtime y Gemini Enterprise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Proyecto de la demostración:&lt;/strong&gt; &lt;a href="https://github.com/johnbulla/google-adk-gemini-corporate-policies-agent" rel="noopener noreferrer"&gt;Google ADK + Gemini Corporate Policies Agent&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Artículo anterior:&lt;/strong&gt; &lt;a href="https://wiki-cloud.co/es/2026/11/build-ai-agent-with-google-adk/" rel="noopener noreferrer"&gt;Cómo construir un agente de IA con Google ADK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quickstart Agent Runtime con Google ADK:&lt;/strong&gt; &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/runtime/quickstart-adk" rel="noopener noreferrer"&gt;Documentación oficial&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Desplegar un agente en Agent Runtime:&lt;/strong&gt; &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/runtime/deploy-an-agent" rel="noopener noreferrer"&gt;Documentación oficial&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Registrar agentes ADK en Gemini Enterprise:&lt;/strong&gt; &lt;a href="https://docs.cloud.google.com/gemini/enterprise/docs/register-and-manage-an-adk-agent" rel="noopener noreferrer"&gt;Documentación oficial&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Versiones y ciclo de vida de los modelos:&lt;/strong&gt; &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/model-versions" rel="noopener noreferrer"&gt;Documentación oficial&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Solución de problemas de despliegue:&lt;/strong&gt; &lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/troubleshooting/agent-deployment" rel="noopener noreferrer"&gt;Documentación oficial&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Acceso entre proyectos:&lt;/strong&gt; &lt;a href="https://docs.cloud.google.com/gemini/enterprise/docs/configure-cross-project-adk-agents" rel="noopener noreferrer"&gt;Documentación oficial&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;¡Espero que sea de utilidad!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Síguenos:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉&lt;a href="http://wiki-cloud.co/" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt; | 👉&lt;a href="https://www.linkedin.com/in/johnbulla" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; | 👉&lt;a href="https://x.com/johnbulla" rel="noopener noreferrer"&gt;X&lt;/a&gt; | 👉&lt;a href="https://github.com/johnbulla" rel="noopener noreferrer"&gt;Github&lt;/a&gt; | 👉&lt;a href="https://www.youtube.com/user/johnbulla" rel="noopener noreferrer"&gt;Youtube&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>gemini</category>
      <category>googlecloud</category>
    </item>
    <item>
      <title>Gemini Enterprise: A platform for connecting enterprise agents, data, and applications</title>
      <dc:creator>John Bulla</dc:creator>
      <pubDate>Mon, 16 Nov 2026 21:44:36 +0000</pubDate>
      <link>https://dev.to/gde/gemini-enterprise-a-platform-for-connecting-enterprise-agents-data-and-applications-4g6d</link>
      <guid>https://dev.to/gde/gemini-enterprise-a-platform-for-connecting-enterprise-agents-data-and-applications-4g6d</guid>
      <description>&lt;div class="ltag__user ltag__user__id__666134"&gt;
    &lt;a href="/johnbulla" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=150,height=150,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F666134%2Fc19791a4-86a8-48f5-8ff6-b31d0aa6b1a7.png" alt="johnbulla image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/johnbulla"&gt;John Bulla&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/johnbulla"&gt;💼 Sr. Cloud Solutions Architect - Cloud, Data &amp;amp; AI | Pre-Sales Architect | Cloud Evangelist 
🏆 Google Developer Expert | AWS Community Builder | Alibaba Cloud MVP | Ex-Microsoft MVP&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;✋ &lt;strong&gt;Note:&lt;/strong&gt; This article was originally published on my blog &lt;a href="https://wiki-cloud.co/en/2026/11/gemini-enterprise-platform-enterprise-agents-data-applications" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Artificial intelligence is transforming how organizations access information, interact with their applications, and automate business processes. As generative AI evolves into agentic AI, companies can move beyond generating content and answering questions by adopting intelligent agents capable of reasoning, retrieving corporate information, using tools, and carrying out tasks autonomously or under human supervision.&lt;/p&gt;

&lt;p&gt;In this context, &lt;strong&gt;Google&lt;/strong&gt; offers &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; as a centralized entry point for artificial intelligence within organizations, connecting data, applications, and AI agents in an enterprise environment.&lt;/p&gt;

&lt;p&gt;However, &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; goes beyond providing a corporate chatbot. Its goal is to make specialized agents accessible to business users while enabling technical teams to develop, deploy, and manage AI solutions tailored to business needs.&lt;/p&gt;

&lt;p&gt;In this article, we will explore what &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; is, its main components, its relationship with the &lt;strong&gt;Google Agent Development Kit (ADK)&lt;/strong&gt;, and how to build and deploy artificial intelligence agents so they can be made available to users across an organization.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What Is Gemini Enterprise?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb1b35l1g9zclbqyawu6q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb1b35l1g9zclbqyawu6q.png" alt="Gemini Enterprise" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gemini Enterprise&lt;/strong&gt; is a Google Cloud enterprise AI solution that enables organizations to access information, tools, and AI agents through a unified experience.&lt;/p&gt;

&lt;p&gt;Its goal is to make AI part of everyday business processes rather than an isolated tool, facilitating access to corporate knowledge, task automation, and decision-making.&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;Gemini Enterprise&lt;/strong&gt;, business users can query information distributed across different systems, receive contextualized answers, use specialized agents, and run workflows integrated with enterprise applications.&lt;/p&gt;

&lt;p&gt;For example, a company could implement specialized agents across different departments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Human Resources:&lt;/strong&gt; automating employee onboarding processes, coordinating training activities, and managing internal requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Finance:&lt;/strong&gt; generating financial reports, analyzing budgets, identifying variances, and automating invoicing processes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sales and Marketing:&lt;/strong&gt; analyzing sales opportunities, updating CRM information, segmenting customers, and preparing sales proposals.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IT and Security:&lt;/strong&gt; diagnosing incidents, automating technical support tasks, monitoring infrastructure, and analyzing security events.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Operations and Logistics:&lt;/strong&gt; tracking inventory, optimizing supply chains, coordinating orders, and automating operational processes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main advantage is that these agents can connect to corporate data, tools, and applications through authorized integrations, making it possible to automate processes and perform actions without requiring every department to develop its own AI interface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gemini Enterprise&lt;/strong&gt; supports the management of agents created by &lt;strong&gt;Google&lt;/strong&gt;, internally developed agents, and third-party agents, with centralized access and administration controls.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Gemini Enterprise vs. Gemini Enterprise Agent Platform: What's the Difference?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;One of the most important distinctions to understand is that &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; and &lt;strong&gt;Gemini Enterprise Agent Platform&lt;/strong&gt; are related components, but they serve different purposes.&lt;/p&gt;

&lt;p&gt;In April 2026, Google Cloud introduced &lt;strong&gt;Gemini Enterprise Agent Platform&lt;/strong&gt; as the evolution of &lt;strong&gt;Vertex AI&lt;/strong&gt; into an integrated platform for building, scaling, governing, and optimizing enterprise agents.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Features&lt;/th&gt;
&lt;th&gt;Gemini Enterprise&lt;/th&gt;
&lt;th&gt;Gemini Enterprise Agent Platform&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Access and manage enterprise agents&lt;/td&gt;
&lt;td&gt;Build, deploy, and operate agents&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Primary users&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Employees and administrators&lt;/td&gt;
&lt;td&gt;Developers, architects, and platform teams&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Experience&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Web application and agent gallery&lt;/td&gt;
&lt;td&gt;SDKs, development tools, APIs, and console&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Agent creation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Workflow Builder, no-code/low-code&lt;/td&gt;
&lt;td&gt;ADK, Agent Studio, and APIs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Execution&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Interface for accessing agents&lt;/td&gt;
&lt;td&gt;Agent Runtime and other compatible environments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Governance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;User access and availability&lt;/td&gt;
&lt;td&gt;Identity, policies, observability, and agent registry&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Both platforms can work together. A development team can build an agent with &lt;strong&gt;Google ADK&lt;/strong&gt;, deploy it to &lt;strong&gt;Agent Runtime&lt;/strong&gt;, and then register it in &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; so employees can use it through a corporate interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conceptual Architecture of Gemini Enterprise&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The conceptual architecture of &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; helps explain how users, artificial intelligence agents, and enterprise systems connect within a single solution.&lt;/p&gt;

&lt;p&gt;As shown in the following image, the architecture is organized into four layers, ranging from business users' interaction with the platform to the services used to develop and execute agents, as well as the information sources and applications with which they can integrate.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fekthx8xsk90pjd43i39h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fekthx8xsk90pjd43i39h.png" alt="Conceptual architecture of Gemini Enterprise: users, experience, platform, and integration" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Components of the Conceptual Architecture
&lt;/h3&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Business Users&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;These are users or employees from different departments within the organization, such as Human Resources, Finance, Legal, Technology, and Operations, who use artificial intelligence agents to retrieve information, receive assistance, and perform tasks related to their daily activities.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Gemini Enterprise: Experience and Interaction Layer&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This is the access point through which users can interact with AI agents and query enterprise information using a unified web interface. This layer brings together different tools and features that make agents easier to access and use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Google agents:&lt;/strong&gt; AI agents and capabilities provided by Google to support different tasks and processes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workflow Builder:&lt;/strong&gt; a tool for creating agents and automating workflows through a visual approach, without requiring advanced programming knowledge.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent Gallery:&lt;/strong&gt; a catalog where users can discover and access the agents available within the organization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom agents:&lt;/strong&gt; agents developed by the company or integrated from other platforms to address specific business needs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Gemini Enterprise Agent Platform: Development and Operations Layer&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This layer provides the tools and services technical teams need to develop, deploy, manage, and monitor artificial intelligence agents. Its capabilities are grouped into four main areas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Development:&lt;/strong&gt; tools such as Google ADK and Agent Studio enable teams to build custom agents using code or visual interfaces.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Execution:&lt;/strong&gt; Agent Runtime provides a managed environment for deploying and running agents, supporting scalability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Governance:&lt;/strong&gt; services such as IAM, Agent Registry, and Agent Gateway enable identity management, agent registration, and control over interactions with other systems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observability:&lt;/strong&gt; through logs, traces, and evaluation tools, technical teams can monitor agent operations, analyze behavior, and identify opportunities for improvement.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Data, Applications, and Tools: Enterprise Integration Layer&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This layer represents the data, applications, and services with which agents can interact to retrieve information or perform specific actions. It includes solutions such as &lt;strong&gt;Google Drive&lt;/strong&gt;, &lt;strong&gt;BigQuery&lt;/strong&gt;, &lt;strong&gt;CRM&lt;/strong&gt; systems, enterprise applications, and &lt;strong&gt;APIs&lt;/strong&gt;, as well as external tools that can be integrated through protocols such as the &lt;strong&gt;Model Context Protocol (MCP)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Through these integrations, agents can make use of information available across different systems and participate in business processes, always in accordance with the permissions and controls established by the organization.&lt;/p&gt;

&lt;p&gt;Overall, this architecture illustrates how Gemini Enterprise and Gemini Enterprise Agent Platform complement each other to connect artificial intelligence with the enterprise environment. While Gemini Enterprise provides employees with a unified experience for using agents, Agent Platform delivers the technical capabilities required to develop, run, and manage them.&lt;/p&gt;

&lt;p&gt;Both solutions make it possible to integrate agents with corporate data, applications, and tools, facilitating their adoption in business processes.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Architecture and Components of Gemini Enterprise&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The architecture of Google Gemini Enterprise is organized into two major, complementary components: &lt;strong&gt;Gemini Enterprise App&lt;/strong&gt; and &lt;strong&gt;Gemini Enterprise Agent Platform&lt;/strong&gt;. The former provides users with a unified environment for interacting with artificial intelligence agents, while the latter offers the tools and services required to develop, deploy, manage, and monitor them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx13386xfpjybtp1988qi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx13386xfpjybtp1988qi.png" alt="Architecture and components of Gemini Enterprise App and Gemini Enterprise Agent Platform" width="800" height="493"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Gemini Enterprise App&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This is the interaction layer for an organization's users and administrators. It provides access to AI agents, enterprise information, and productivity tools through a single interface.&lt;/p&gt;

&lt;p&gt;Its main capabilities include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Agents:&lt;/strong&gt; provides access to AI agents and enables the creation of customized solutions using low-code tools or code-based development.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Front end:&lt;/strong&gt; brings together features for interacting with assistants, creating content, and discovering available agents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Knowledge Graph and Context:&lt;/strong&gt; facilitate access to enterprise information and connections to external applications, data, and tools.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mission Control:&lt;/strong&gt; provides administration, security, metrics, and observability capabilities to monitor platform usage.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Gemini Enterprise Agent Platform&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This is the technology platform used to build and operate artificial intelligence agents in enterprise environments. Its capabilities are organized around four pillars:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Build (Development):&lt;/strong&gt; provides frameworks such as Google ADK, visual tools such as Agent Studio, AI models, and integration mechanisms through APIs, connectors, and protocols such as MCP and A2A.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scale (Scalability):&lt;/strong&gt; offers services such as Agent Runtime, Agent Sessions, and Memory Bank to run agents, manage sessions, and retain relevant information across interactions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Govern (Governance):&lt;/strong&gt; includes tools such as Agent Identity, Agent Registry, Agent Gateway, and Model Armor to manage identities, enforce security controls, and administer agents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimize (Optimization):&lt;/strong&gt; brings together evaluation, simulation, and observability capabilities to analyze agent performance and identify opportunities for improvement.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In summary, the Gemini Enterprise architecture consists of two major components: Gemini Enterprise App and Gemini Enterprise Agent Platform. The first provides a unified experience for employees to interact with AI agents, access corporate information, and use enterprise applications. The second brings together the services needed to develop, run, govern, and optimize intelligent agents through four pillars: &lt;strong&gt;Build, Scale, Govern, and Optimize&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Together, these components provide the capabilities needed to implement enterprise artificial intelligence solutions, from initial development through operations, security, and continuous improvement.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Integrating Agents with Enterprise Data&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;One of the main advantages of &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; is its ability to connect artificial intelligence agents with an organization's data, applications, and systems, enabling them to access corporate information and provide more accurate, contextualized responses.&lt;/p&gt;

&lt;p&gt;For example, a company could develop an AI agent that queries documents stored in &lt;strong&gt;Google Drive&lt;/strong&gt;, such as Human Resources, Finance, Security, and Technology policies. Rather than relying solely on the language model's knowledge, the agent could use techniques such as &lt;strong&gt;Retrieval-Augmented Generation (RAG)&lt;/strong&gt; to retrieve relevant information from these sources and generate responses grounded in corporate content.&lt;/p&gt;

&lt;p&gt;To implement these types of solutions, Google Cloud offers search tools, information retrieval services, and connectors that facilitate integration with different data sources. In addition, open protocols such as the &lt;strong&gt;Model Context Protocol (MCP)&lt;/strong&gt; allow agents to interact with external tools and systems, while &lt;strong&gt;Agent2Agent (A2A)&lt;/strong&gt; enables communication and collaboration between different artificial intelligence agents.&lt;/p&gt;

&lt;p&gt;The choice of technologies will depend on each organization's needs, where its data is located, its authentication mechanisms, and its security and access control requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Benefits for Organizations&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Adopting artificial intelligence agents in Gemini Enterprise offers organizations a range of business and technical benefits by making information easier to access, automating processes, and integrating with enterprise systems.&lt;/p&gt;

&lt;p&gt;Its main benefits include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Productivity:&lt;/strong&gt; enables employees to access information, resolve questions, and complete tasks more efficiently, reducing the need to work across multiple applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reusability:&lt;/strong&gt; facilitates the development of specialized agents that can be shared and used across different departments, leveraging existing solutions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration:&lt;/strong&gt; enables AI agents to connect with enterprise data, applications, and services through connectors, APIs, and tools, making it easier to automate processes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability:&lt;/strong&gt; with Agent Runtime, organizations can deploy and run agents on managed infrastructure that adapts to business needs and demand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Centralized governance:&lt;/strong&gt; provides capabilities for managing access to agents, establishing security policies, and monitoring their operation from a centralized environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To realize these benefits, organizations need reliable corporate information, an appropriate integration architecture, and security and access control mechanisms. Continuous monitoring and evaluation of agents are also important for improving their performance and ensuring they meet organizational needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusions&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The evolution of artificial intelligence is changing how organizations access information, use their applications, and automate business processes. In this context, &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; offers a solution that brings AI agents closer to business users, allowing them to access intelligent tools through a unified experience.&lt;/p&gt;

&lt;p&gt;Meanwhile, &lt;strong&gt;Gemini Enterprise Agent Platform&lt;/strong&gt; provides technical teams with the tools and services needed to develop, deploy, manage, and monitor artificial intelligence agents tailored to each organization's needs.&lt;/p&gt;

&lt;p&gt;Both solutions complement each other to facilitate the implementation of enterprise agents. Developers can build customized agents using &lt;strong&gt;Google ADK&lt;/strong&gt;, deploy them to &lt;strong&gt;Agent Runtime&lt;/strong&gt;, and make them available to employees through &lt;strong&gt;Gemini Enterprise&lt;/strong&gt;, integrating them with corporate data, applications, and systems.&lt;/p&gt;

&lt;p&gt;In this way, the true value of AI agents goes beyond answering questions or generating content: it lies in their ability to leverage enterprise knowledge, interact with different systems, and perform tasks that add value to business processes.&lt;/p&gt;

&lt;p&gt;To unlock this potential, organizations should support their adoption of Gemini Enterprise with a strategy that addresses data and application integration, security, governance, observability, and agent lifecycle management. This will help them develop more reliable, scalable artificial intelligence solutions aligned with business objectives.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Resources&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;For a deeper understanding of the concepts and procedures described, see the following Google Cloud resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.google.com/gemini/enterprise/docs/agents-overview" rel="noopener noreferrer"&gt;Gemini Enterprise: agents overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/overview" rel="noopener noreferrer"&gt;Gemini Enterprise Agent Platform: architecture and components&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/adk" rel="noopener noreferrer"&gt;Agent Development Kit (ADK)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/runtime/quickstart-adk" rel="noopener noreferrer"&gt;Tutorial: building and deploying agents with ADK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.google.com/gemini/enterprise/docs/register-and-manage-an-adk-agent" rel="noopener noreferrer"&gt;Registering ADK agents in Gemini Enterprise&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.google.com/gemini/enterprise/docs/workflow-builder" rel="noopener noreferrer"&gt;Workflow Builder: creating no-code and low-code agents&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope you find this useful!!!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow us:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉&lt;a href="http://wiki-cloud.co/" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt; | 👉&lt;a href="https://www.linkedin.com/in/johnbulla" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; | 👉&lt;a href="https://x.com/johnbulla" rel="noopener noreferrer"&gt;X&lt;/a&gt; | 👉&lt;a href="https://github.com/johnbulla" rel="noopener noreferrer"&gt;Github&lt;/a&gt; | 👉&lt;a href="https://www.youtube.com/user/johnbulla" rel="noopener noreferrer"&gt;Youtube&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>gemini</category>
      <category>googlecloud</category>
    </item>
    <item>
      <title>Gemini Enterprise: Plataforma para conectar agentes, datos y aplicaciones empresariales</title>
      <dc:creator>John Bulla</dc:creator>
      <pubDate>Mon, 16 Nov 2026 21:33:12 +0000</pubDate>
      <link>https://dev.to/johnbulla/gemini-enterprise-plataforma-para-conectar-agentes-datos-y-aplicaciones-empresariales-c39</link>
      <guid>https://dev.to/johnbulla/gemini-enterprise-plataforma-para-conectar-agentes-datos-y-aplicaciones-empresariales-c39</guid>
      <description>&lt;div class="ltag__user ltag__user__id__666134"&gt;
    &lt;a href="/johnbulla" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=150,height=150,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F666134%2Fc19791a4-86a8-48f5-8ff6-b31d0aa6b1a7.png" alt="johnbulla image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/johnbulla"&gt;John Bulla&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/johnbulla"&gt;💼 Sr. Cloud Solutions Architect - Cloud, Data &amp;amp; AI | Pre-Sales Architect | Cloud Evangelist 
🏆 Google Developer Expert | AWS Community Builder | Alibaba Cloud MVP | Ex-Microsoft MVP&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;✋ &lt;strong&gt;Nota:&lt;/strong&gt; Este artículo se publicó originalmente en mi blog &lt;a href="https://wiki-cloud.co/es/2026/11/gemini-enterprise-platform-enterprise-agents-data-applications" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introducción&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;La inteligencia artificial está transformando la manera en que las organizaciones acceden a la información, interactúan con sus aplicaciones y automatizan sus procesos de negocio. Con la evolución de la IA generativa hacia la IA agéntica, las empresas pueden ir más allá de generar contenido y responder preguntas, incorporando agentes inteligentes capaces de razonar, consultar información corporativa, utilizar herramientas y ejecutar tareas de manera autónoma o supervisada.&lt;/p&gt;

&lt;p&gt;En este contexto, &lt;strong&gt;Google&lt;/strong&gt; propone &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; como un punto de acceso centralizado a la inteligencia artificial dentro de las organizaciones, permitiendo conectar datos, aplicaciones y agentes de IA en un entorno empresarial.&lt;/p&gt;

&lt;p&gt;Sin embargo, &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; va más allá de ofrecer un chatbot corporativo. Su propuesta consiste en facilitar que los usuarios corporativos puedan utilizar agentes especializados, mientras los equipos técnicos desarrollan, despliegan y administran soluciones de IA adaptadas a las necesidades del negocio.&lt;/p&gt;

&lt;p&gt;En este artículo exploraremos qué es &lt;strong&gt;Gemini Enterprise&lt;/strong&gt;, sus principales componentes, su relación con &lt;strong&gt;Google Agent Development Kit (ADK)&lt;/strong&gt; y cómo crear y desplegar agentes de inteligencia artificial para ponerlos a disposición de los usuarios de una organización.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;¿Qué es Gemini Enterprise?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb1b35l1g9zclbqyawu6q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb1b35l1g9zclbqyawu6q.png" alt="Gemini Enterprise" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gemini Enterprise&lt;/strong&gt; es una solución de inteligencia artificial empresarial de Google Cloud que permite a las organizaciones acceder a información, herramientas y agentes de IA desde una experiencia unificada.&lt;/p&gt;

&lt;p&gt;Su objetivo es que la IA no sea una herramienta aislada, sino que forme parte de los procesos cotidianos de las empresas, facilitando el acceso al conocimiento corporativo, la automatización de tareas y la toma de decisiones.&lt;/p&gt;

&lt;p&gt;Mediante &lt;strong&gt;Gemini Enterprise&lt;/strong&gt;, los usuarios corporativos pueden consultar información distribuida en diferentes sistemas, obtener respuestas contextualizadas, utilizar agentes especializados y ejecutar flujos de trabajo integrados con las aplicaciones empresariales.&lt;/p&gt;

&lt;p&gt;Por ejemplo, una compañía podría implementar agentes especializados en diferentes áreas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Recursos Humanos:&lt;/strong&gt; automatización de procesos de incorporación de empleados (&lt;em&gt;onboarding&lt;/em&gt;), coordinación de actividades de formación y gestión de solicitudes internas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Finanzas:&lt;/strong&gt; generación de informes financieros, análisis de presupuestos, identificación de desviaciones y automatización de procesos de facturación.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ventas y Marketing:&lt;/strong&gt; análisis de oportunidades comerciales, actualización de información en sistemas CRM, segmentación de clientes y elaboración de propuestas comerciales.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IT y Seguridad:&lt;/strong&gt; diagnóstico de incidencias, automatización de tareas de soporte técnico, supervisión de infraestructura y análisis de eventos de seguridad.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Operaciones y Logística:&lt;/strong&gt; seguimiento de inventarios, optimización de cadenas de suministro, coordinación de pedidos y automatización de procesos operativos.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;La principal ventaja es que estos agentes pueden conectarse con los datos, las herramientas y las aplicaciones corporativas mediante integraciones autorizadas, permitiendo automatizar procesos y ejecutar acciones sin necesidad de que cada departamento desarrolle su propia interfaz de inteligencia artificial.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gemini Enterprise&lt;/strong&gt; permite gestionar agentes creados por &lt;strong&gt;Google&lt;/strong&gt;, agentes desarrollados internamente y agentes de terceros, aplicando controles centralizados de acceso y administración.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Gemini Enterprise y Gemini Enterprise Agent Platform: ¿Cuál es la diferencia?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Uno de los aspectos más importantes es comprender que &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; y &lt;strong&gt;Gemini Enterprise Agent Platform&lt;/strong&gt; son componentes relacionados, pero cumplen funciones diferentes.&lt;/p&gt;

&lt;p&gt;En abril de 2026, Google Cloud presentó &lt;strong&gt;Gemini Enterprise Agent Platform&lt;/strong&gt; como la evolución de &lt;strong&gt;Vertex AI&lt;/strong&gt; hacia una plataforma integrada para desarrollar, escalar, gobernar y optimizar agentes empresariales.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Características&lt;/th&gt;
&lt;th&gt;Gemini Enterprise&lt;/th&gt;
&lt;th&gt;Gemini Enterprise Agent Platform&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Propósito&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Consumir y gestionar agentes empresariales&lt;/td&gt;
&lt;td&gt;Construir, desplegar y operar agentes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Usuarios principales&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Empleados y administradores&lt;/td&gt;
&lt;td&gt;Desarrolladores, arquitectos y equipos de plataforma&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Experiencia&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Aplicación web y galería de agentes&lt;/td&gt;
&lt;td&gt;SDK, herramientas de desarrollo, APIs y consola&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Creación de agentes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Workflow Builder, no-code/low-code&lt;/td&gt;
&lt;td&gt;ADK, Agent Studio y APIs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Ejecución&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Interfaz de acceso a los agentes&lt;/td&gt;
&lt;td&gt;Agent Runtime y otros entornos compatibles&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Gobierno&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Acceso y disponibilidad para usuarios&lt;/td&gt;
&lt;td&gt;Identidad, políticas, observabilidad y registro de agentes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Ambas plataformas pueden trabajar de manera conjunta. Un equipo de desarrollo puede construir un agente con &lt;strong&gt;Google ADK&lt;/strong&gt;, desplegarlo en &lt;strong&gt;Agent Runtime&lt;/strong&gt; y posteriormente registrarlo en &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; para que los empleados puedan utilizarlo desde una interfaz corporativa.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Arquitectura conceptual de Gemini Enterprise&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;La arquitectura conceptual de &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; permite comprender cómo se conectan los usuarios, los agentes de inteligencia artificial y los sistemas empresariales dentro de una misma solución.&lt;/p&gt;

&lt;p&gt;Como se observa en la siguiente imagen, la arquitectura se organiza en cuatro capas que representan desde la interacción de los usuarios empresariales con la plataforma hasta los servicios que permiten desarrollar y ejecutar agentes, así como las fuentes de información y aplicaciones con las que pueden integrarse.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb968c0vctcaqdnegcgsz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb968c0vctcaqdnegcgsz.png" alt="Arquitectura conceptual de Gemini Enterprise: usuarios, experiencia, plataforma e integración" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Componentes de la arquitectura conceptual
&lt;/h3&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Usuarios empresariales&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Son los usuarios o empleados de las diferentes áreas de la organización, como Recursos Humanos, Finanzas, Legal, Tecnología y Operaciones, que utilizan los agentes de inteligencia artificial para consultar información, recibir asistencia y realizar tareas relacionadas con sus actividades diarias.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Gemini Enterprise: Capa de experiencia e interacción&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Es el punto de acceso desde el cual los usuarios pueden interactuar con los agentes de IA y consultar información empresarial a través de una interfaz web unificada. Esta capa reúne herramientas y funcionalidades que facilitan el acceso y el uso de los agentes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Agentes de Google:&lt;/strong&gt; agentes y funcionalidades de inteligencia artificial proporcionados por Google para apoyar diferentes tareas y procesos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workflow Builder:&lt;/strong&gt; herramienta que permite crear agentes y automatizar flujos de trabajo mediante un enfoque visual, sin necesidad de contar con conocimientos avanzados de programación.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent Gallery:&lt;/strong&gt; catálogo desde el cual los usuarios pueden descubrir y acceder a los agentes disponibles en la organización.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agentes propios:&lt;/strong&gt; agentes personalizados, desarrollados por la empresa o integrados desde otras plataformas, para responder a necesidades específicas del negocio.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Gemini Enterprise Agent Platform: Capa de desarrollo y operación&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Proporciona las herramientas y servicios que necesitan los equipos técnicos para desarrollar, desplegar, administrar y supervisar agentes de inteligencia artificial. Sus capacidades se agrupan en cuatro áreas principales:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Desarrollo:&lt;/strong&gt; herramientas como Google ADK y Agent Studio permiten construir agentes personalizados mediante código o interfaces visuales.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ejecución:&lt;/strong&gt; Agent Runtime ofrece un entorno administrado para desplegar y ejecutar agentes, facilitando su escalabilidad.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gobierno:&lt;/strong&gt; servicios como IAM, Agent Registry y Agent Gateway permiten gestionar identidades, administrar el registro de agentes y controlar sus interacciones con otros sistemas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observabilidad:&lt;/strong&gt; mediante registros, trazas y herramientas de evaluación, los equipos técnicos pueden supervisar el funcionamiento de los agentes, analizar su comportamiento e identificar oportunidades de mejora.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Datos, aplicaciones y herramientas: Capa de integración empresarial&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Esta capa representa los datos, aplicaciones y servicios con los que los agentes pueden interactuar para consultar información o ejecutar determinadas acciones. Incluye soluciones como &lt;strong&gt;Google Drive&lt;/strong&gt;, &lt;strong&gt;BigQuery&lt;/strong&gt;, sistemas &lt;strong&gt;CRM&lt;/strong&gt;, aplicaciones corporativas y &lt;strong&gt;APIs&lt;/strong&gt;, así como herramientas externas que pueden integrarse mediante protocolos como &lt;strong&gt;Model Context Protocol (MCP)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Gracias a estas integraciones, los agentes pueden aprovechar la información disponible en diferentes sistemas y participar en procesos empresariales, siempre de acuerdo con los permisos y controles establecidos por la organización.&lt;/p&gt;

&lt;p&gt;En conjunto, esta arquitectura muestra cómo Gemini Enterprise y Gemini Enterprise Agent Platform se complementan para conectar la inteligencia artificial con el entorno empresarial. Mientras Gemini Enterprise proporciona a los empleados una experiencia unificada para utilizar agentes, Agent Platform ofrece las capacidades técnicas necesarias para desarrollarlos, ejecutarlos y administrarlos.&lt;/p&gt;

&lt;p&gt;Ambas soluciones permiten integrar agentes con datos, aplicaciones y herramientas corporativas, facilitando su incorporación a los procesos de negocio.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Arquitectura y componentes de Gemini Enterprise&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;La arquitectura de Google Gemini Enterprise se organiza en dos grandes bloques que trabajan de forma complementaria: &lt;strong&gt;Gemini Enterprise App&lt;/strong&gt; y &lt;strong&gt;Gemini Enterprise Agent Platform&lt;/strong&gt;. Mientras el primero proporciona a los usuarios un entorno unificado para interactuar con agentes de inteligencia artificial, el segundo ofrece las herramientas y servicios necesarios para desarrollarlos, desplegarlos, administrarlos y supervisarlos.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx13386xfpjybtp1988qi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx13386xfpjybtp1988qi.png" alt="Arquitectura y componentes de Gemini Enterprise App y Gemini Enterprise Agent Platform" width="800" height="493"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Gemini Enterprise App&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Es la capa de interacción con los usuarios y administradores de la organización. Permite acceder a agentes de IA, consultar información empresarial y utilizar herramientas de productividad desde una misma interfaz.&lt;/p&gt;

&lt;p&gt;Entre sus principales capacidades destacan:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Agents:&lt;/strong&gt; permite acceder a agentes de IA y crear soluciones personalizadas mediante herramientas low-code o desarrollo con código.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Front end:&lt;/strong&gt; reúne funcionalidades para interactuar con asistentes, crear contenido y descubrir agentes disponibles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Knowledge Graph y Context:&lt;/strong&gt; facilitan el acceso a información empresarial y la conexión con aplicaciones, datos y herramientas externas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mission Control:&lt;/strong&gt; proporciona capacidades de administración, seguridad, métricas y observabilidad para supervisar el uso de la plataforma.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Gemini Enterprise Agent Platform&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Es la plataforma tecnológica que permite construir y operar agentes de inteligencia artificial en entornos empresariales. Sus capacidades se agrupan en cuatro pilares:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Build (Desarrollo):&lt;/strong&gt; proporciona frameworks como Google ADK, herramientas visuales como Agent Studio, modelos de IA y mecanismos de integración mediante APIs, conectores y protocolos como MCP y A2A.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scale (Escalabilidad):&lt;/strong&gt; ofrece servicios como Agent Runtime, Agent Sessions y Memory Bank para ejecutar agentes, gestionar sesiones y mantener información relevante entre interacciones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Govern (Gobierno):&lt;/strong&gt; incorpora herramientas como Agent Identity, Agent Registry, Agent Gateway y Model Armor para gestionar identidades, aplicar controles de seguridad y administrar los agentes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimize (Optimización):&lt;/strong&gt; reúne capacidades de evaluación, simulación y observabilidad que permiten analizar el funcionamiento de los agentes e identificar oportunidades de mejora.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;En conclusión, la arquitectura de Gemini Enterprise se compone de dos grandes bloques: Gemini Enterprise App y Gemini Enterprise Agent Platform. El primero proporciona una experiencia unificada para que los empleados puedan interactuar con agentes de IA, acceder a información corporativa y utilizar aplicaciones empresariales. El segundo reúne los servicios que permiten desarrollar, ejecutar, gobernar y optimizar agentes inteligentes mediante cuatro pilares: &lt;strong&gt;Build, Scale, Govern y Optimize&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Esta combinación proporciona las capacidades necesarias para implementar soluciones de inteligencia artificial empresarial, desde el desarrollo inicial hasta su operación, seguridad y mejora continua.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Integración de agentes con datos empresariales&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Una de las principales ventajas de &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; es su capacidad para conectar agentes de inteligencia artificial con los datos, aplicaciones y sistemas de una organización, permitiéndoles acceder a información corporativa y ofrecer respuestas más precisas y contextualizadas.&lt;/p&gt;

&lt;p&gt;Por ejemplo, una empresa podría desarrollar un agente de IA que consulte documentos almacenados en &lt;strong&gt;Google Drive&lt;/strong&gt;, como políticas de Recursos Humanos, Finanzas, Seguridad y Tecnología. En lugar de depender únicamente del conocimiento del modelo de lenguaje, el agente podría utilizar técnicas como &lt;strong&gt;Retrieval-Augmented Generation (RAG)&lt;/strong&gt; para recuperar información relevante de estas fuentes y generar respuestas basadas en el contenido corporativo.&lt;/p&gt;

&lt;p&gt;Para implementar este tipo de soluciones, Google Cloud ofrece herramientas de búsqueda, servicios de recuperación de información y conectores que facilitan la integración con diferentes fuentes de datos. Además, mediante protocolos abiertos como &lt;strong&gt;Model Context Protocol (MCP)&lt;/strong&gt;, los agentes pueden interactuar con herramientas y sistemas externos, mientras que &lt;strong&gt;Agent2Agent (A2A)&lt;/strong&gt; permite la comunicación y colaboración entre diferentes agentes de inteligencia artificial.&lt;/p&gt;

&lt;p&gt;La elección de estas tecnologías dependerá de las necesidades de cada organización, la ubicación de sus datos, los mecanismos de autenticación y los requisitos de seguridad y control de acceso establecidos.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Beneficios para las organizaciones&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;La incorporación de agentes de inteligencia artificial en Gemini Enterprise aporta diversos beneficios a las organizaciones, tanto a nivel de negocio como tecnológico, al facilitar el acceso a la información, la automatización de procesos y la integración con los sistemas empresariales.&lt;/p&gt;

&lt;p&gt;Entre sus principales ventajas destacan:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Productividad:&lt;/strong&gt; permite a los empleados acceder a información, resolver consultas y realizar tareas de manera más ágil, reduciendo la necesidad de trabajar con múltiples aplicaciones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reutilización:&lt;/strong&gt; facilita el desarrollo de agentes especializados que pueden compartirse y utilizarse en diferentes áreas de la organización, aprovechando las soluciones existentes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integración:&lt;/strong&gt; permite conectar agentes de IA con datos, aplicaciones y servicios empresariales mediante conectores, APIs y herramientas, facilitando la automatización de procesos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Escalabilidad:&lt;/strong&gt; mediante Agent Runtime, las organizaciones pueden desplegar y ejecutar agentes en una infraestructura administrada, adaptándose a las necesidades y demandas del negocio.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gobierno centralizado:&lt;/strong&gt; proporciona capacidades para gestionar el acceso a los agentes, establecer políticas de seguridad y supervisar su funcionamiento desde un entorno centralizado.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Para aprovechar estos beneficios, es importante contar con información corporativa confiable, una arquitectura de integración adecuada y mecanismos de seguridad y control de acceso. Asimismo, la supervisión y evaluación continua de los agentes permite mejorar su funcionamiento y garantizar que respondan a las necesidades de la organización.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusiones&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;La evolución de la inteligencia artificial está cambiando la forma en que las organizaciones acceden a la información, utilizan sus aplicaciones y automatizan sus procesos de negocio. En este escenario, &lt;strong&gt;Gemini Enterprise&lt;/strong&gt; ofrece una solución que acerca los agentes de IA a los usuarios empresariales, permitiéndoles acceder a herramientas inteligentes desde una experiencia unificada.&lt;/p&gt;

&lt;p&gt;Por su parte, &lt;strong&gt;Gemini Enterprise Agent Platform&lt;/strong&gt; proporciona a los equipos técnicos las herramientas y servicios necesarios para desarrollar, desplegar, administrar y supervisar agentes de inteligencia artificial adaptados a las necesidades de cada organización.&lt;/p&gt;

&lt;p&gt;Ambas soluciones se complementan para facilitar la implementación de agentes empresariales. Los desarrolladores pueden construir agentes personalizados utilizando &lt;strong&gt;Google ADK&lt;/strong&gt;, desplegarlos en &lt;strong&gt;Agent Runtime&lt;/strong&gt; y ponerlos a disposición de los empleados a través de &lt;strong&gt;Gemini Enterprise&lt;/strong&gt;, integrándolos con los datos, aplicaciones y sistemas corporativos.&lt;/p&gt;

&lt;p&gt;De esta manera, el verdadero valor de los agentes de IA va más allá de responder preguntas o generar contenido: está en su capacidad para aprovechar el conocimiento empresarial, interactuar con diferentes sistemas y ejecutar tareas que aporten valor a los procesos de negocio.&lt;/p&gt;

&lt;p&gt;Para aprovechar todo este potencial, las organizaciones deben acompañar la adopción de Gemini Enterprise con una estrategia que contemple la integración de datos y aplicaciones, la seguridad, el gobierno, la observabilidad y la gestión del ciclo de vida de los agentes. Esto permitirá desarrollar soluciones de inteligencia artificial más confiables, escalables y alineadas con los objetivos del negocio.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Recursos&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Para profundizar en los conceptos y procedimientos descritos, pueden consultarse los siguientes recursos de Google Cloud:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.google.com/gemini/enterprise/docs/agents-overview" rel="noopener noreferrer"&gt;Gemini Enterprise: descripción general de agentes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/overview" rel="noopener noreferrer"&gt;Gemini Enterprise Agent Platform: arquitectura y componentes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/adk" rel="noopener noreferrer"&gt;Agent Development Kit (ADK)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/runtime/quickstart-adk" rel="noopener noreferrer"&gt;Tutorial de desarrollo y despliegue de agentes con ADK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.google.com/gemini/enterprise/docs/register-and-manage-an-adk-agent" rel="noopener noreferrer"&gt;Registro de agentes ADK en Gemini Enterprise&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.google.com/gemini/enterprise/docs/workflow-builder" rel="noopener noreferrer"&gt;Workflow Builder: creación de agentes no-code y low-code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;¡Espero que sea de utilidad!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Síguenos:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉&lt;a href="http://wiki-cloud.co/" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt; | 👉&lt;a href="https://www.linkedin.com/in/johnbulla" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; | 👉&lt;a href="https://x.com/johnbulla" rel="noopener noreferrer"&gt;X&lt;/a&gt; | 👉&lt;a href="https://github.com/johnbulla" rel="noopener noreferrer"&gt;Github&lt;/a&gt; | 👉&lt;a href="https://www.youtube.com/user/johnbulla" rel="noopener noreferrer"&gt;Youtube&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>gemini</category>
      <category>googlecloud</category>
    </item>
    <item>
      <title>How to build an AI Agent with Google ADK</title>
      <dc:creator>John Bulla</dc:creator>
      <pubDate>Sat, 14 Nov 2026 23:15:13 +0000</pubDate>
      <link>https://dev.to/gde/how-to-build-an-ai-agent-with-google-adk-dhk</link>
      <guid>https://dev.to/gde/how-to-build-an-ai-agent-with-google-adk-dhk</guid>
      <description>&lt;div class="ltag__user ltag__user__id__666134"&gt;
    &lt;a href="/johnbulla" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=150,height=150,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F666134%2Fc19791a4-86a8-48f5-8ff6-b31d0aa6b1a7.png" alt="johnbulla image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/johnbulla"&gt;John Bulla&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/johnbulla"&gt;💼 Sr. Cloud Solutions Architect - Cloud, Data &amp;amp; AI | Pre-Sales Architect | Cloud Evangelist 
🏆 Google Developer Expert | AWS Community Builder | Alibaba Cloud MVP | Ex-Microsoft MVP&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;✋ &lt;strong&gt;Note:&lt;/strong&gt; This article was originally published on my blog &lt;a href="https://wiki-cloud.co/en/2026/11/build-ai-agent-with-google-adk/" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Artificial intelligence is entering a new stage of evolution. In recent years, &lt;strong&gt;generative artificial intelligence&lt;/strong&gt; models have transformed how we create content, develop software, and access information. However, organizations need more than answers to a &lt;em&gt;prompt&lt;/em&gt;: they also need applications capable of accessing enterprise systems, using tools, and executing steps to address specific needs. This evolution is driving &lt;strong&gt;agentic artificial intelligence&lt;/strong&gt;, in which a language model is combined with instructions, tools, and information sources to operate within a workflow.&lt;br&gt;
&lt;/p&gt;


&lt;p&gt;In this context, Google developed &lt;strong&gt;Google Agent Development Kit (Google ADK)&lt;/strong&gt;, an open-source &lt;em&gt;framework&lt;/em&gt; for building AI agents through code. It provides components for defining agents and their instructions, integrating models such as Gemini, adding tools and functions, managing sessions, and coordinating workflows that can evolve from a single agent into multi-agent systems. Its value lies not only in generating answers, but also in providing a structure for building extensible, observable, and testable solutions.&lt;/p&gt;

&lt;p&gt;In previous articles, I provided an &lt;a href="https://wiki-cloud.co/es/2026/07/google-adk-intro-ai-agent-development/" rel="noopener noreferrer"&gt;introduction to AI agent development&lt;/a&gt;, discussing the evolution from generative AI to agentic AI, what characterizes an agent, and why Google ADK is useful for developing them. I also introduced the &lt;a href="https://wiki-cloud.co/es/2026/07/google-adk-architecture-essential-components/" rel="noopener noreferrer"&gt;architecture and components of Google ADK&lt;/a&gt;, a complementary read for exploring the design and elements that make up these solutions.&lt;/p&gt;

&lt;p&gt;In this new article, we take the next step: moving from concepts and architecture to the practical implementation of an AI agent with Google ADK.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Solution Objective&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In this guide, we will develop an artificial intelligence agent that acts as a &lt;strong&gt;Corporate Policies Assistant&lt;/strong&gt;, capable of answering questions about internal documents from Human Resources, Finance, Technology, Security, Legal, Procurement, Operations, Sustainability, and other departments.&lt;/p&gt;

&lt;p&gt;Imagine an employee who needs to know how many vacation days they are entitled to, how to request reimbursement, or what their company's recycling policy states. Instead of manually searching through different documents, they can ask questions in natural language and receive clear, contextualized answers. To achieve this, our agent will consult policies stored as documents in &lt;strong&gt;Google Drive&lt;/strong&gt;, retrieve relevant information, and generate answers supported by the original sources.&lt;/p&gt;

&lt;p&gt;To implement this solution, we will use &lt;strong&gt;Google ADK&lt;/strong&gt; as the framework for developing and running the agent; &lt;strong&gt;Gemini&lt;/strong&gt; as the language model; &lt;strong&gt;Google Drive&lt;/strong&gt; as the document repository; and &lt;strong&gt;Streamlit&lt;/strong&gt; to build a chatbot-style web interface in Python. We will also incorporate a &lt;strong&gt;lexical-search-based RAG&lt;/strong&gt; approach, using an in-memory index without requiring a vector database. This will help us understand how the different components interact and how the agent turns a query into a grounded response.&lt;/p&gt;

&lt;p&gt;Throughout the exercise, we will prepare our development environment with &lt;strong&gt;Python and PowerShell&lt;/strong&gt; in &lt;strong&gt;Visual Studio Code&lt;/strong&gt;, configure access to &lt;strong&gt;Google Drive&lt;/strong&gt;, implement search tools, and define our agent with &lt;strong&gt;Google ADK&lt;/strong&gt;. Finally, we will build a frontend web application containing a Streamlit chatbot and run tests to validate responses, their sources, and estimated token consumption.&lt;/p&gt;

&lt;p&gt;This article is the &lt;strong&gt;first part of a hands-on series&lt;/strong&gt;. In the second part, we will deploy the same agent to &lt;strong&gt;Google Cloud Agent Runtime&lt;/strong&gt; and integrate it with &lt;strong&gt;Gemini Enterprise&lt;/strong&gt;, showing how to evolve from a local application to a solution accessible through an enterprise platform.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Solution Architecture&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The following section describes the architecture proposed for this solution and how its workflow operates.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0wj3zeh7pzwqqr80pxkv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0wj3zeh7pzwqqr80pxkv.png" alt=" " width="800" height="605"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our Corporate Policies Assistant architecture combines &lt;strong&gt;Streamlit, Google ADK, Gemini, and Google Drive&lt;/strong&gt;, allowing users to query enterprise documents through a conversational interface and receive answers grounded in actual information.&lt;/p&gt;

&lt;p&gt;The process starts with corporate policy documents stored in &lt;strong&gt;Google Drive&lt;/strong&gt;. When the application starts, it connects to the repository, identifies the available files, and extracts their content. It then splits the text into smaller chunks and builds an &lt;strong&gt;in-memory RAG index&lt;/strong&gt; to make relevant information easier to find. This index remains available while the application runs and can be refreshed manually when documents are added or updated.&lt;/p&gt;

&lt;p&gt;Once the knowledge base is ready, users can ask a question through the web application, which features a &lt;strong&gt;chatbot&lt;/strong&gt; built with &lt;strong&gt;Streamlit&lt;/strong&gt;. The query is sent to the agent developed with &lt;strong&gt;Google ADK&lt;/strong&gt;, which uses the &lt;strong&gt;Gemini&lt;/strong&gt; model to interpret the user's needs and determine whether to use any of its tools.&lt;/p&gt;

&lt;p&gt;When a question concerns corporate policies, the agent runs the &lt;strong&gt;search_corporate_policies&lt;/strong&gt; tool, which searches the RAG index for the chunks that best match the query. Unlike traditional searches across entire documents, this approach retrieves only the sections that may contain the answer.&lt;/p&gt;

&lt;p&gt;The retrieved chunks are returned to the agent as context. Based on this information, &lt;strong&gt;Gemini&lt;/strong&gt; generates a natural-language answer, aiming to rely only on the information found and to provide references to the original Google Drive documents. If there is insufficient information, the agent should say so rather than make up an answer.&lt;/p&gt;

&lt;p&gt;Finally, the response is displayed in &lt;strong&gt;Streamlit&lt;/strong&gt;, where users can continue the conversation, ask follow-up questions, and consult the cited sources. The web application also displays metrics such as estimated token usage and allows users to refresh the index manually when policies are added or modified.&lt;/p&gt;

&lt;p&gt;In this way, we obtain a simple architecture that helps explain how an AI agent works: from preparing and indexing documents to interpreting questions, running tools, and generating grounded answers. We achieve all of this without introducing a vector database in this first implementation.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Prerequisites&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;For this demonstration, we will work on &lt;strong&gt;Windows&lt;/strong&gt;, using &lt;strong&gt;PowerShell&lt;/strong&gt; to run commands and &lt;strong&gt;Visual Studio Code&lt;/strong&gt; as our development environment. We will also need &lt;strong&gt;Python 3.12&lt;/strong&gt; installed to implement the agent with Google ADK and build the Streamlit web application.&lt;/p&gt;

&lt;p&gt;For Google services, we will need access to &lt;strong&gt;Google AI Studio&lt;/strong&gt; to obtain a Gemini API key, with sufficient quota or billing credits to query the model. We will also need a &lt;strong&gt;Google Cloud&lt;/strong&gt; project with the Google Drive API enabled and a folder containing the corporate policies our agent will query.&lt;/p&gt;

&lt;p&gt;To access these documents, we will use a &lt;strong&gt;Google Cloud service account&lt;/strong&gt;, granting it read permissions on the relevant Google Drive folder. In enterprise environments, it is important to review your organization's security policies in advance, particularly those concerning the creation and download of JSON keys. For this lab, we will use this authentication method only in an authorized testing environment.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Verifying the Tools&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Once the tools are installed, we can verify that they are available by running the following commands in PowerShell:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Check the Python version:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;py&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;3.12&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#OUTPUT
Python 3.12.10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Check the Visual Studio Code installation:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#OUTPUT
1.145.2
x64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Check the Google Cloud CLI installation:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#OUTPUT
Google Cloud SDK 592.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The last command requires &lt;strong&gt;&lt;a href="https://docs.cloud.google.com/sdk/docs/install-sdk?hl=es-419" rel="noopener noreferrer"&gt;Google Cloud CLI&lt;/a&gt;&lt;/strong&gt; to be installed. We will mainly use it in the second part of this series, when we deploy our agent to &lt;strong&gt;Google Cloud Agent Runtime&lt;/strong&gt; and integrate it with Gemini Enterprise.&lt;/p&gt;

&lt;p&gt;For this first local implementation with &lt;strong&gt;Google ADK and Streamlit&lt;/strong&gt;, a Gemini API key and a service account authorized to access Google Drive documents will be sufficient.&lt;/p&gt;

&lt;p&gt;With these prerequisites in place, we can create the Python virtual environment and install the dependencies needed to develop our assistant.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Organization and Structure of the Solution's Source Code&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In our example, we will organize the code into separate folders for the agent definition, Google Drive integration, corporate policies, tests, and deployment scripts.&lt;/p&gt;

&lt;p&gt;Before implementing our agent, let's look at how the project is organized. A clear structure helps us separate the responsibilities of each component, simplify maintenance, and reuse code when we move on to deployment in Google Cloud.&lt;/p&gt;

&lt;p&gt;For this demonstration, we organized the source code into a single repository containing two versions of the &lt;strong&gt;Corporate Policies Assistant:&lt;/strong&gt; one in English (&lt;strong&gt;sources_en&lt;/strong&gt;) and one in Spanish (&lt;strong&gt;sources_es&lt;/strong&gt;). Both use the same architecture and features but have their own Python files, agent instructions, corporate policy examples, and environment configuration. This allows us to run and test each version independently.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Project Structure&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;To simplify the explanation, we will show only the internal structure of &lt;strong&gt;sources_en&lt;/strong&gt;, since &lt;strong&gt;sources_es&lt;/strong&gt; uses the same organization with content adapted to Spanish.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;google-adk-gemini-corporate-policies-agent/
│
├── sources_es/ # Versión en español
│ └── ... # Misma estructura que sources_en
│
├── sources_en/ # Versión en inglés
│ ├── .streamlit/
│ │ └── config.toml
│ │
│ ├── corporate_agent/
│ │ ├── __init__.py
│ │ ├── agent.py
│ │ └── drive_rag.py
│ │
│ ├── corporate_policies/
│ │ └── *.txt
│ │
│ ├── credentials/
│ │ └── .gitkeep
│ │
│ ├── deployment/
│ │ ├── __init__.py
│ │ └── deploy_agent.py
│ │
│ ├── prompts/
│ │ └── *.txt
│ │
│ ├── test/
│ │ ├── __init__.py
│ │ ├── test_drive.py
│ │ ├── test_gemini.py
│ │ └── test_runtime.py
│ │
│ ├── __init__.py
│ ├── .env
│ ├── app.py
│ └── pyproject.toml
│
├── .gitignore
├── README.md
├── README_ES.md
└── requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;Component Descriptions&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;The following table briefly describes the roles of the main folders and files in both versions of our solution.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Folder or File&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;sources_en/&lt;/td&gt;
&lt;td&gt;Contains the English version of the agent, including its interface, instructions, and corporate policies.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sources_es/&lt;/td&gt;
&lt;td&gt;Contains the Spanish version of the agent, which we will use as a reference throughout this article.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;.streamlit/&lt;/td&gt;
&lt;td&gt;Contains config.toml, used to customize Streamlit appearance and configuration.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;corporate_agent/&lt;/td&gt;
&lt;td&gt;Contains the main logic of the AI agent developed with Google ADK.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;corporate_agent/agent.py&lt;/td&gt;
&lt;td&gt;Defines the main agent (root_agent), its instructions, the Gemini model, and the policy search tool.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;corporate_agent/drive_rag.py&lt;/td&gt;
&lt;td&gt;Implements the connection to Google Drive, document reading, chunking, indexing, and RAG retrieval.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;corporate_policies/&lt;/td&gt;
&lt;td&gt;Contains corporate policy examples in TXT files, written in the language of each version. Once uploaded to Google Drive, these documents will serve as the knowledge base.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;credentials/&lt;/td&gt;
&lt;td&gt;Folder intended for storing the local credentials needed to access Google Drive.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;deployment/&lt;/td&gt;
&lt;td&gt;Contains the scripts for deploying the agent to Google Cloud Agent Runtime. It will mainly be used in the second part of the series when the agent is integrated with Gemini Enterprise.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;prompts/&lt;/td&gt;
&lt;td&gt;Stores the agent instructions or prompts in the corresponding language.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;test/&lt;/td&gt;
&lt;td&gt;Groups tests that validate Google Drive connectivity, Gemini functionality, and execution of the agent deployed to Agent Runtime.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;__init__.py&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Files used to identify Python packages and organize module imports.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;.env&lt;/td&gt;
&lt;td&gt;Stores application environment variables, such as Gemini, Google Drive, and Agent Runtime settings.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;.gitignore&lt;/td&gt;
&lt;td&gt;Defines files and folders Git should exclude, such as credentials, caches, and virtual environments.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;app.py&lt;/td&gt;
&lt;td&gt;Implements the Streamlit web interface, including the chatbot, sessions, and usage metrics.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pyproject.toml&lt;/td&gt;
&lt;td&gt;Defines project packaging configuration, needed to generate the installable agent package.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;README.md&lt;/td&gt;
&lt;td&gt;Contains general project documentation, prerequisites, installation instructions, and commands in English.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;README_ES.md&lt;/td&gt;
&lt;td&gt;Contains general project documentation, prerequisites, installation instructions, and commands in Spanish.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;requirements.txt&lt;/td&gt;
&lt;td&gt;Lists the Python dependencies needed to set up the development environment and run the solution.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This separation lets us initially work with &lt;strong&gt;Google ADK&lt;/strong&gt; and &lt;strong&gt;Streamlit&lt;/strong&gt; in our local environment while retaining the components needed to later deploy the same agent to &lt;strong&gt;Google Cloud Agent Runtime&lt;/strong&gt; and integrate it with &lt;strong&gt;Gemini Enterprise&lt;/strong&gt;, without building an entirely new solution.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Source Code Available on GitHub&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;The source code for both versions is organized in a single &lt;strong&gt;GitHub&lt;/strong&gt; repository, where you can explore the Python files, download sample corporate policies, and follow the installation and execution instructions.&lt;/p&gt;

&lt;p&gt;You can download the project using GitHub's &lt;strong&gt;Code → Download ZIP&lt;/strong&gt; option or clone it directly with Git:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;git&lt;/span&gt; &lt;span class="n"&gt;clone&lt;/span&gt; &lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;johnbulla&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;adk&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;gemini&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;corporate&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;policies&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After downloading the project, open its folder in Visual Studio Code and select the version you want to run.&lt;/p&gt;

&lt;p&gt;The repository includes two documentation files: README.md, available in English by default, and README_ES.md, with instructions in Spanish.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project repository:&lt;/strong&gt; &lt;a href="https://github.com/johnbulla/google-adk-gemini-corporate-policies-agent" rel="noopener noreferrer"&gt;Corporate Policies Agent — GitHub&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Creating a Virtual Environment in VS Code with PowerShell&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;After installing the required tools and reviewing the project structure, the next step is to prepare our development environment in &lt;strong&gt;Visual Studio Code (VS Code)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We will use a Python &lt;strong&gt;virtual environment&lt;/strong&gt; to install and manage the libraries our application needs independently, without affecting other Python versions or the dependencies of other projects on our machine.&lt;/p&gt;

&lt;p&gt;In this exercise, we will use &lt;strong&gt;Python 3.12&lt;/strong&gt; and run commands from the integrated VS Code terminal using PowerShell.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Create the Python Virtual Environment&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;First, open the root folder of our project in Visual Studio Code and access the terminal from &lt;strong&gt;Terminal → New Terminal&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;From this location, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;venv&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;venv&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command creates a virtual environment called &lt;strong&gt;.venv&lt;/strong&gt; inside the project. The libraries needed to develop our agent will be installed there, preventing conflicts with other Python projects.&lt;/p&gt;

&lt;p&gt;The name &lt;strong&gt;.venv&lt;/strong&gt; is a common convention that makes it easy for Visual Studio Code to recognize the virtual environment.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Enable and Activate the Virtual Environment&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;On Windows, PowerShell may restrict script execution for security reasons. If we encounter this restriction when activating the environment, we can temporarily allow script execution with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;ExecutionPolicy&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Scope&lt;/span&gt; &lt;span class="k"&gt;Process&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;ExecutionPolicy&lt;/span&gt; &lt;span class="nc"&gt;Bypass&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command changes the execution policy only for the current PowerShell session, without permanently modifying the system configuration. Use it only when necessary and permitted by the device's security policies.&lt;/p&gt;

&lt;p&gt;Then activate the virtual environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;venv&lt;/span&gt;\&lt;span class="nc"&gt;Scripts&lt;/span&gt;\&lt;span class="nc"&gt;Activate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ps1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the environment is active, we will see the prefix (.venv) at the beginning of the command prompt, indicating that Python installations and executions will use our virtual environment.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(.venv) PS C:\Projects\Corporate Policies Agent\&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;Update Python Installation Tools&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Before installing dependencies, it is advisable to update the tools Python uses to manage and build packages.&lt;/p&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;upgrade&lt;/span&gt; &lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;setuptools&lt;/span&gt; &lt;span class="n"&gt;wheel&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command updates three tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;pip:&lt;/strong&gt; the package manager used to install Python libraries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;setuptools:&lt;/strong&gt; a tool for configuring and building distributable Python packages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;wheel:&lt;/strong&gt; provides support for creating installable .whl packages, which we will later use to deploy the agent to Google Cloud Agent Runtime.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although pip is sufficient to install many project libraries, setuptools and wheel will be especially useful when we prepare the agent for cloud deployment.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Install Project Dependencies&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Our agent will use several Python libraries to interact with Gemini, Google Drive, Google ADK, and Streamlit. Instead of installing them manually one by one, we will list them in a file called &lt;strong&gt;requirements.txt&lt;/strong&gt;, located at the root of the project.&lt;/p&gt;

&lt;p&gt;This file provides a centralized dependency list and makes it easier for others to reproduce the same development environment.&lt;/p&gt;

&lt;p&gt;To install all libraries, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="n"&gt;requirements&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;txt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command reads requirements.txt and installs the declared dependencies along with any additional libraries they require.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Contents of requirements.txt&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;adk&lt;/span&gt;
&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;genai&lt;/span&gt;
&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;
&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;
&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;oauthlib&lt;/span&gt;
&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;cloud&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;storage&lt;/span&gt;
&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;dotenv&lt;/span&gt;
&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;docx&lt;/span&gt;
&lt;span class="n"&gt;pypdf&lt;/span&gt;
&lt;span class="n"&gt;streamlit&lt;/span&gt;
&lt;span class="n"&gt;pydantic&lt;/span&gt;
&lt;span class="n"&gt;cloudpickle&lt;/span&gt;
&lt;span class="c1"&gt;# Dependencies for the environment running deployment scripts&lt;/span&gt;
&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;cloud&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;aiplatform&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;agent_engines&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;adk&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="mf"&gt;1.112&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below, we briefly explain what each dependency is used for.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dependency&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;google-adk&lt;/td&gt;
&lt;td&gt;The Google framework used to develop our AI agent, define instructions, integrate tools, and manage conversation sessions.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;google-genai&lt;/td&gt;
&lt;td&gt;SDK for interacting with Gemini models, sending queries, and receiving model-generated responses.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;google-api-python-client&lt;/td&gt;
&lt;td&gt;Client for accessing Google APIs. Here, we use it to query and download documents through the Google Drive API.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;google-auth&lt;/td&gt;
&lt;td&gt;Provides the authentication mechanisms required to access Google services with authorized credentials.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;google-auth-oauthlib&lt;/td&gt;
&lt;td&gt;Facilitates OAuth 2.0 flows when an application needs to authenticate with a user account.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;google-cloud-storage&lt;/td&gt;
&lt;td&gt;Enables interaction with Google Cloud Storage. We will mainly use it in the second part to validate the staging bucket used during deployment.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;python-dotenv&lt;/td&gt;
&lt;td&gt;Loads configuration variables defined in .env, such as the Gemini model and Google Drive connection parameters.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;python-docx&lt;/td&gt;
&lt;td&gt;Library for reading and extracting content from Microsoft Word (.docx) documents.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pypdf&lt;/td&gt;
&lt;td&gt;Extracts text from PDF files that contain selectable text.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;streamlit&lt;/td&gt;
&lt;td&gt;Python framework for building the assistant web interface, including the chatbot and usage indicators.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pydantic&lt;/td&gt;
&lt;td&gt;Library for defining, validating, and structuring data using Python models. It is also used by components of Google ADK.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cloudpickle&lt;/td&gt;
&lt;td&gt;Serializes Python objects, which is useful when packaging and deploying agent components to remote environments.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;google-cloud-aiplatform[agent_engines,adk]&amp;gt;=1.112.0&lt;/td&gt;
&lt;td&gt;Installs the Vertex AI SDK with additional dependencies for Agent Runtime and Google ADK. We will use it in the second part to deploy and test the agent on Google Cloud.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;As we can see, some dependencies support local assistant development, while others will be needed later for deployment to Google Cloud.&lt;/p&gt;

&lt;p&gt;Although we use a single requirements.txt file to simplify installation, enterprise projects often separate development, testing, and deployment dependencies. It is also recommended to pin specific versions after validating the solution, to avoid unexpected changes when libraries are updated.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Verify That Dependencies Were Installed Correctly&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;After installation, we can check for dependency conflicts by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything is correct, we should see a message similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;No broken requirements found.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also verify that Google ADK and Streamlit are available:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;show&lt;/span&gt; &lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;adk&lt;/span&gt; &lt;span class="n"&gt;streamlit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command displays information about the installed libraries, such as their versions and locations within the virtual environment.&lt;/p&gt;

&lt;p&gt;Finally, it is advisable to select the virtual environment's interpreter in Visual Studio Code. Press &lt;strong&gt;Ctrl + Shift + P&lt;/strong&gt;, search for &lt;strong&gt;Python: Select Interpreter&lt;/strong&gt;, and select the interpreter inside .venv.&lt;/p&gt;

&lt;p&gt;At this point, our development environment is ready to implement the &lt;strong&gt;Corporate Policies Assistant&lt;/strong&gt; with &lt;strong&gt;Google ADK, Gemini, and Streamlit&lt;/strong&gt;. In the following sections, we will configure the required credentials and establish the Google Drive connection, which will serve as the agent's knowledge source.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Environment Configuration and Application Variables&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;With the virtual environment ready and Python dependencies installed, the next step is to configure the variables the application needs to connect to Google services and define some agent operating parameters.&lt;/p&gt;

&lt;p&gt;We will use a file called &lt;strong&gt;.env&lt;/strong&gt;, located at the project root. This file centralizes information such as access credentials, the Gemini model to use, the location of documents in Google Drive, and the agent's information retrieval settings.&lt;/p&gt;

&lt;p&gt;One of its main advantages is that we can change these settings without modifying the Python code directly. It also lets us keep sensitive information separate from the application logic, simplifying maintenance and configuration across environments.&lt;/p&gt;

&lt;p&gt;Our project will use the previously installed python-dotenv library to load these variables from Python.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security note:&lt;/strong&gt; In this demonstration, we will configure some credentials locally, including the Gemini API key and a service account JSON file, to simplify development and make the exercise easier to follow. However, placing keys, passwords, or secrets directly in source code (&lt;strong&gt;hardcoding&lt;/strong&gt;) or storing them in public repositories is not good practice.&lt;/p&gt;

&lt;p&gt;In enterprise or production environments, we recommend dedicated secrets management solutions, such as &lt;strong&gt;Google Cloud Secret Manager&lt;/strong&gt; or &lt;strong&gt;HashiCorp Vault&lt;/strong&gt;, to store credentials securely, control access, and manage their lifecycle, including generation, rotation, and revocation. Whenever possible, managed identities and temporary credentials are preferable to static keys.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The configuration in this article is intended exclusively for education and demonstration&lt;/strong&gt; and must be adapted to each organization's security policies and requirements before production use.&lt;/p&gt;

&lt;p&gt;As we can see, we have divided the file into four groups to make it easier to understand and manage.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Gemini Configuration&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;In this first section, we define how our agent will connect to Gemini and which model will process the queries.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GOOGLE_API_KEY&lt;/td&gt;
&lt;td&gt;Access key for the Gemini API, generated in Google AI Studio. Replace &lt;strong&gt;YOUR_GEMINI_API_KEY&lt;/strong&gt; with your actual API key.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GOOGLE_GENAI_USE_VERTEXAI&lt;/td&gt;
&lt;td&gt;Indicates whether to use the Gemini API (FALSE) or Vertex AI (TRUE). For this first local implementation, we will keep FALSE.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GEMINI_MODEL&lt;/td&gt;
&lt;td&gt;Defines the Gemini model used by our agent. In this example, we configure &lt;strong&gt;gemini-3.5-flash-lite&lt;/strong&gt;, provided it is available to our project.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GEMINI_VERTEX_LOCATION&lt;/td&gt;
&lt;td&gt;Specifies the inference endpoint location when using Vertex AI. We will keep global, which we will use in the second part.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Google Drive Configuration&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Here, we configure access to Google Drive, where the documents used as our agent's knowledge base will be stored.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;DRIVE_AUTH_MODE&lt;/td&gt;
&lt;td&gt;Defines the authentication mechanism for accessing Google Drive. For the local application, we will use service_account_file, which authenticates through a service account JSON file.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DRIVE_SERVICE_ACCOUNT_FILE&lt;/td&gt;
&lt;td&gt;Specifies the location of the JSON file containing service account credentials. Verify that it exists at &lt;strong&gt;credentials/service-account.json.&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GOOGLE_DRIVE_FOLDER_ID&lt;/td&gt;
&lt;td&gt;Identifier of the Google Drive folder where corporate policies will be stored. Replace &lt;strong&gt;YOUR_DRIVE_FOLDER_ID&lt;/strong&gt; with the actual folder ID.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For example, if our Google Drive folder has a URL like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://drive.google.com/drive/folders/1ABCdefGhijKlmNopQRstUv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The identifier to configure is the last part of the URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GOOGLE_DRIVE_FOLDER_ID=XXXxxxXXXxxxXXXXxxx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We must also ensure that the folder is shared with the application's service account, with the permissions required to access the documents.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Google Cloud Agent Runtime Configuration&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Although we will initially run the agent locally with Streamlit, we will prepare some variables for the second part of this series, when we deploy it to Google Cloud Agent Runtime and integrate it with Gemini Enterprise.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GOOGLE_CLOUD_PROJECT&lt;/td&gt;
&lt;td&gt;Google Cloud project identifier. Replace &lt;strong&gt;YOUR_PROJECT_ID&lt;/strong&gt; with the actual ID of your project.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AGENT_RUNTIME_LOCATION&lt;/td&gt;
&lt;td&gt;Google Cloud region where we will deploy the agent. In this example, we use europe-west1.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AGENT_RUNTIME_STAGING_BUCKET&lt;/td&gt;
&lt;td&gt;Google Cloud Storage bucket used during deployment to temporarily store required files. Replace &lt;strong&gt;YOUR_STAGING_BUCKET&lt;/strong&gt; with the name of the bucket you created.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AGENT_RUNTIME_SERVICE_ACCOUNT&lt;/td&gt;
&lt;td&gt;Service account the agent will use when running on Google Cloud. Replace the sample email address with the account configured for Agent Runtime.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These variables are not required to begin using Streamlit with the Gemini API, but they will let us reuse the same project when we move on to publishing it in Gemini Enterprise.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;RAG Configuration and Processing Limits&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;In this final section, we define parameters that control how document information is retrieved, how much content is processed, and the maximum time allowed to complete queries.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;RAG_TOP_K&lt;/td&gt;
&lt;td&gt;Maximum number of relevant chunks the agent will retrieve per query.&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RAG_MAX_FRAGMENT_CHARS&lt;/td&gt;
&lt;td&gt;Maximum number of characters sent to the model for each retrieved chunk.&lt;/td&gt;
&lt;td&gt;900&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RAG_REFRESH_INTERVAL_SECONDS&lt;/td&gt;
&lt;td&gt;Automatic RAG index refresh interval, in seconds. Used when the agent manages its own cache, as in Agent Runtime.&lt;/td&gt;
&lt;td&gt;300 (5 minutes)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MAX_DRIVE_FILES&lt;/td&gt;
&lt;td&gt;Maximum number of Google Drive files processed during indexing.&lt;/td&gt;
&lt;td&gt;250&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MAX_FILE_BYTES&lt;/td&gt;
&lt;td&gt;Maximum allowed file size in bytes.&lt;/td&gt;
&lt;td&gt;10000000 (10 decimal MB)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MAX_DOCUMENT_CHARS&lt;/td&gt;
&lt;td&gt;Maximum number of characters extracted and processed from each document.&lt;/td&gt;
&lt;td&gt;150000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AGENT_TIMEOUT_SECONDS&lt;/td&gt;
&lt;td&gt;Maximum time allowed to complete a query from the Streamlit application.&lt;/td&gt;
&lt;td&gt;180 seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These values are appropriate starting points for our lab and can be adjusted based on document size, the number of policies, and the expected application behavior.&lt;/p&gt;

&lt;p&gt;For &lt;strong&gt;Streamlit&lt;/strong&gt;, we will keep a button for manually refreshing the document index. For Agent Runtime, we will use the interval defined in &lt;strong&gt;RAG_REFRESH_INTERVAL_SECONDS&lt;/strong&gt;, which is checked when the agent invokes its search tool again.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Estimated Gemini Cost Configuration&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Finally, we will add two optional variables to estimate the financial cost of queries in the Streamlit dashboard.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GEMINI_INPUT_USD_PER_1M&lt;/td&gt;
&lt;td&gt;Reference price in US dollars per million input tokens.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GEMINI_OUTPUT_USD_PER_1M&lt;/td&gt;
&lt;td&gt;Reference price in US dollars per million output tokens.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These values allow us to display estimated model interaction costs, but &lt;strong&gt;they do not represent actual Google billing&lt;/strong&gt;. Prices may change depending on the model, service option, and applicable commercial terms, so we should review official pricing before relying on them.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Creating a Gemini API Key&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To allow our agent to use Gemini models, we need to generate an &lt;strong&gt;API key in Google AI Studio&lt;/strong&gt;. Go to &lt;a href="https://aistudio.google.com/api-keys" rel="noopener noreferrer"&gt;Google AI Studio&lt;/a&gt; and sign in with your Google account.&lt;/p&gt;

&lt;p&gt;Once there, open the &lt;strong&gt;API Keys&lt;/strong&gt; section, select the option to create a new key, and choose the Google Cloud project to associate it with. If you do not yet have an available project, you can create or import one, depending on the options enabled for your account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftj6thm619osb1a8ei57q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftj6thm619osb1a8ei57q.png" alt="API Keys in Google AI Studio" width="800" height="636"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fttmzpu6xmc51wjbcn0jt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fttmzpu6xmc51wjbcn0jt.png" alt="Create Gemini API key" width="504" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After generating the key, copy it and confirm that the project has enough quota or billing capacity to use the selected Gemini model.&lt;/p&gt;

&lt;p&gt;With the API key available, open the &lt;strong&gt;.env&lt;/strong&gt; file at the project root and replace the sample value &lt;strong&gt;YOUR_GEMINI_API_KEY&lt;/strong&gt; in the &lt;strong&gt;GOOGLE_API_KEY&lt;/strong&gt; variable with the key generated in Google AI Studio.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Configuring Google Drive and Service Account Authentication&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To allow our Corporate Policies Assistant to query documents stored in Google Drive, we need to configure an authentication mechanism that gives the application secure access to the files.&lt;/p&gt;

&lt;p&gt;In this exercise, we will use a &lt;strong&gt;Google Cloud service account&lt;/strong&gt;, which represents an identity used by applications and services rather than a conventional user account. This allows the agent to connect to Google Drive and retrieve corporate policies without requiring users to sign in manually every time they ask a question.&lt;/p&gt;

&lt;p&gt;For the demonstration, we will create a dedicated service account, grant it read access to the folder containing the documents, and download its credentials as a JSON file for use by our Python application.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Enable the Google Drive API&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;First, we need to enable the API that allows our application to access the documents stored in Google Drive.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;a href="https://console.cloud.google.com/" rel="noopener noreferrer"&gt;Google Cloud Console&lt;/a&gt; and sign in.&lt;/li&gt;
&lt;li&gt;Select the Google Cloud project you will use for the exercise.&lt;/li&gt;
&lt;li&gt;From the navigation menu, go to &lt;strong&gt;APIs &amp;amp; Services → Library&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Search for &lt;strong&gt;Google Drive API&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the API and click &lt;strong&gt;Enable&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We can also enable it from PowerShell using Google Cloud CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;services&lt;/span&gt; &lt;span class="n"&gt;enable&lt;/span&gt; &lt;span class="n"&gt;drive&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;googleapis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;YOUR_PROJECT_ID&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;strong&gt;YOUR_PROJECT_ID&lt;/strong&gt; with your actual Google Cloud project ID.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Create the Service Account&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Once the API is enabled, we will create the identity our agent will use to access the documents.&lt;/p&gt;

&lt;p&gt;Follow these steps in Google Cloud Console:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;IAM &amp;amp; Admin → Service Accounts&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create Service Account&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enter the following sample values:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Suggested Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Name&lt;/td&gt;
&lt;td&gt;Corporate Policies Drive Reader&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Service account ID&lt;/td&gt;
&lt;td&gt;drive-agent-reader&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Description&lt;/td&gt;
&lt;td&gt;Service account for reading corporate policy documents stored in Google Drive&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The service account email address will follow a format similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;drive-agent-reader@YOUR_PROJECT_ID.iam.gserviceaccount.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Select &lt;strong&gt;Create and Continue&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the project role assignment step, you can continue without granting general IAM permissions.&lt;/li&gt;
&lt;li&gt;Finish by clicking &lt;strong&gt;Done&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this case, we do not need to assign roles such as Editor or Owner because our agent only needs to access documents in a specific Google Drive folder. Access to those files will be managed directly through Drive sharing permissions.&lt;/p&gt;

&lt;p&gt;Google Cloud allows service accounts to be created without initially granting them IAM roles on the project.&lt;/p&gt;

&lt;p&gt;We can also create the account using PowerShell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;iam&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;accounts&lt;/span&gt; &lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="n"&gt;drive&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;reader&lt;/span&gt; &lt;span class="sb"&gt;`
--display-name="Corporate Policies Drive Reader" `&lt;/span&gt;
&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Read corporate policy documents from Google Drive"&lt;/span&gt; &lt;span class="sb"&gt;`
--project=YOUR_PROJECT_ID
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;Configure Google Drive Access Permissions&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;After creating the service account, we must authorize it to access the folder containing the corporate policies.&lt;/p&gt;

&lt;p&gt;In our example, we will have a main Google Drive folder with documents from Human Resources, Finance, Technology, Security, Legal, Procurement, Operations, and Sustainability.&lt;/p&gt;

&lt;p&gt;To grant access:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;a href="https://drive.google.com/" rel="noopener noreferrer"&gt;Google Drive&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Find the main folder containing the corporate policies.&lt;/li&gt;
&lt;li&gt;Right-click it and select &lt;strong&gt;Share&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enter the email address of the service account created earlier.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;Viewer&lt;/strong&gt; permission.&lt;/li&gt;
&lt;li&gt;Confirm the sharing settings.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cuenta:
drive-agent-reader@YOUR_PROJECT_ID.iam.gserviceaccount.com
Permiso:
Lector (Viewer)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp5h5g2v7c6gra3yac0nw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp5h5g2v7c6gra3yac0nw.png" alt="Google Drive permissions for the service account" width="515" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this permission, the service account can read available documents within the folder and its subfolders, provided permissions are inherited correctly and no additional restrictions apply. &lt;strong&gt;Edit access is not required&lt;/strong&gt;, because our agent only reads information to answer questions.&lt;/p&gt;

&lt;p&gt;Google Workspace supports sharing files and folders directly with a service account using its email address, without granting administrative privileges.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Generate the service-account.json Credentials File&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Once the service account has been created and authorized, we need to obtain the credentials our Python application will use to authenticate locally.&lt;/p&gt;

&lt;p&gt;Return to Google Cloud Console and follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;IAM &amp;amp; Admin → Service Accounts&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;drive-agent-reader&lt;/strong&gt; service account.&lt;/li&gt;
&lt;li&gt;Open the &lt;strong&gt;Keys&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add Key → Create New Key&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;JSON&lt;/strong&gt; format.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Google Cloud will automatically download a JSON file containing the service account credentials. Rename the downloaded file to &lt;strong&gt;service-account.json&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This file contains information such as the project ID, the service account email address, and a private key used for authentication. Therefore, it must be treated as a sensitive credential.&lt;/p&gt;

&lt;p&gt;Save it inside our project's &lt;strong&gt;credentials&lt;/strong&gt; folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Corporate Policies Agent/
├── corporate_agent/
├── corporate_policies/
├── credentials/
│ └── service-account.json
├── app.py
├── .env
└── requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;Configure Credentials in the .env File&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;With the JSON file stored in the &lt;strong&gt;credentials&lt;/strong&gt; folder, we will configure the environment variables our application uses to connect to Google Drive.&lt;/p&gt;

&lt;p&gt;Open .env and complete the relevant section:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 2. LOCAL GOOGLE DRIVE AUTHENTICATION
# ============================================================
DRIVE_AUTH_MODE=service_account_file
DRIVE_SERVICE_ACCOUNT_FILE=credentials/service-account.json
GOOGLE_DRIVE_FOLDER_ID=YOUR_DRIVE_FOLDER_ID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;Verify the Google Drive Connection&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Before implementing the agent, it is advisable to check that the credentials work and we can access the documents.&lt;/p&gt;

&lt;p&gt;Our project includes a test file called &lt;strong&gt;test_drive.py&lt;/strong&gt;, located in the test folder, which validates this connection.&lt;/p&gt;

&lt;p&gt;From the Visual Studio Code PowerShell terminal, with the virtual environment activated, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;sources_en&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;test_drive&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This test will allow us to check whether the application can authenticate and access Google Drive. The exact result depends on the checks implemented in the script.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OUTPUT
Google Drive connection successful
📁 Root folder: Corporate Policies
🆔 ID: YOUR_DRIVE_FOLDER_ID
📚 Files found:
-----------------------------------------------------------------
-----------------------------------------------------------------
✅ Total files found: 0
(.venv) PS C:\Projects\Corporate Policies Agent&amp;gt; python -m test.test_drive
✅ Google Drive connection successful
📁 Root folder: Corporate Policies
🆔 ID: YOUR_DRIVE_FOLDER_ID
📚 Files found:
-----------------------------------------------------------------
📄 en_legal_policies.txt
📄 en_it_policies.txt
📄 en_human_resources_policies.txt
📄 en_finance_policies.txt
-----------------------------------------------------------------
✅ Total files found: 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you encounter a 403 Forbidden error, review the service account's permissions on the folder, the API configuration, and project permissions. If you encounter a 404 Not Found error, confirm that the folder ID is correct and the account has access to it.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Security Considerations&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;For this demonstration, we are using a service account JSON file because it simplifies the local environment setup and helps illustrate how authentication between Python and Google Drive works. However, JSON keys are long-lived credentials and are not recommended as the standard authentication mechanism for enterprise applications or production environments.&lt;/p&gt;

&lt;p&gt;In production, managed identities, temporary credentials, and authentication mechanisms that avoid storing private keys in local files are preferable. Google Cloud recommends limiting the use of exportable service account keys and applying appropriate controls throughout their lifecycle.&lt;/p&gt;

&lt;p&gt;With this setup, we will have established the connection between our application and Google Drive, which will act as the knowledge repository for the Corporate Policies Assistant.&lt;/p&gt;

&lt;p&gt;In the following sections, we will use these credentials to implement document reading, chunking, indexing, and the search tool that our agent will invoke through Google ADK.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Implementing the RAG system for document queries&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Now that access to Google Drive is configured, we will implement the component responsible for retrieving the information our agent will use to answer user questions.&lt;/p&gt;

&lt;p&gt;We will use &lt;strong&gt;RAG (Retrieval-Augmented Generation)&lt;/strong&gt;, which supplements Gemini's responses with information retrieved from our corporate documents.&lt;/p&gt;

&lt;p&gt;In this first implementation, we will build an &lt;strong&gt;in-memory lexical RAG&lt;/strong&gt; system without a vector database. The process involves querying Google Drive documents, extracting their content, splitting it into chunks, and building an index to locate the most relevant information for each question.&lt;/p&gt;

&lt;p&gt;All this logic will be implemented in &lt;strong&gt;corporate_agent/drive_rag.py&lt;/strong&gt;, organized into six main sections.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Google Drive Configuration and MIME Types&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 1. CONFIGURACIÓN DE GOOGLE DRIVE Y TIPOS MIME
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the first section, we define the general settings for working with Google Drive, including read-only access (drive.readonly) and the file formats our application can process.&lt;/p&gt;

&lt;p&gt;Supported formats include Google Docs, TXT, Markdown, PDF, and Word (DOCX) files. We also define a list of common words (&lt;em&gt;stopwords&lt;/em&gt;) that will be excluded from searches to improve result relevance.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Text Tokenization and Chunking&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 2. TOKENIZACIÓN Y SEGMENTACIÓN DE TEXTO
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This section prepares document content for subsequent indexing and searching. It contains two functions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;words()&lt;/strong&gt;: converts text into words, normalizes them, and removes common terms that add little value to search.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;split_chunks()&lt;/strong&gt;: splits documents into smaller chunks, retaining some overlap to avoid losing relevant information when dividing the content.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Chunking allows us to retrieve only the sections related to a question rather than sending entire documents to the Gemini model.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Downloading Files and Connecting to Google Drive&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 3. DESCARGA Y CONEXIÓN CON DRIVE
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this section, we implement the Google Drive connection and document downloads:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;get_drive_service()&lt;/strong&gt;: establishes a connection using the credentials configured in .env. It supports both the service account JSON file for the local environment and ADC authentication, which we will use later in Agent Runtime.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;download_bytes()&lt;/strong&gt;: downloads files in chunks and checks that they do not exceed the maximum allowed size.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This centralizes access to Google Drive and lets us control how much information our application can download.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Folder Traversal and Pagination&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 4. RECORRIDO DE CARPETAS Y PAGINACIÓN
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;list_files()&lt;/strong&gt; function locates the documents available in the Google Drive folder configured for our project.&lt;/p&gt;

&lt;p&gt;It also traverses subfolders, uses pagination to retrieve results, and selects only supported formats while respecting the file limit set in MAX_DRIVE_FILES.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Extracting Text by File Format&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 5. EXTRACCIÓN DE TEXTO POR FORMATO
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the documents have been identified, we need to extract their content in a format we can process.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;extract_text()&lt;/strong&gt; function handles this task based on the file type: it exports Google Docs as text, uses pypdf for PDFs, python-docx for Word documents, and directly decodes TXT and Markdown files.&lt;/p&gt;

&lt;p&gt;It is important to note that, in this version, scanned PDFs containing only images cannot be processed correctly, because we would need to add an OCR mechanism.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Chunk Model and RAG Index&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 6. MODELO DE FRAGMENTOS E ÍNDICE RAG
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This final section contains the main indexing and retrieval logic.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Chunk&lt;/strong&gt; class represents each text fragment and stores information such as the document name, its Google Drive link, and the words it contains.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;DriveKnowledgeBase&lt;/strong&gt; class manages our knowledge base through three main methods:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;__init__()&lt;/strong&gt;: initializes the structures used to store chunks, statistics, and warnings.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;refresh()&lt;/strong&gt;: queries Google Drive documents, extracts their content, and rebuilds the in-memory RAG index.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;search()&lt;/strong&gt;: receives the user's question, identifies the most relevant chunks using a TF-IDF-based lexical score, and returns results along with their sources.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The retrieved chunks will later be used by the agent developed with Google ADK, which will supply them to &lt;strong&gt;Gemini&lt;/strong&gt; as context for generating a grounded response.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Important Considerations&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Although this implementation is sufficient to understand RAG and integrate it with our agent, we should be aware of a few characteristics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;In-memory indexing:&lt;/strong&gt; processed documents are not stored in a persistent database. Therefore, the index must be rebuilt when needed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lexical search:&lt;/strong&gt; retrieval is based on matching words rather than semantic similarity. This means that questions expressed using synonyms may fail to retrieve the expected chunks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Processing limits:&lt;/strong&gt; we can control the number of documents, their size, and the number of retrieved chunks using the variables configured in .env.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Document security:&lt;/strong&gt; the application can query any documents accessible to its service account. It is important to use an authorized folder and avoid including information that should not be available to agent users.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For our example, this approach lets us understand the entire information retrieval process without adding the complexity of a vector database or additional services.&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;drive_rag.py&lt;/strong&gt; ready, we now have the component responsible for querying our knowledge base. Next, we will create the agent with Google ADK and integrate this functionality as a tool Gemini can use during conversations.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Developing and configuring the AI Agent with Google ADK&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Once our RAG system is implemented, the next step is to develop the agent responsible for interpreting user questions, querying corporate policies, and generating responses using Gemini.&lt;/p&gt;

&lt;p&gt;We will use &lt;strong&gt;Google Agent Development Kit (ADK)&lt;/strong&gt; to define the agent's behavior, integrate tools, and manage interactions with the language model.&lt;/p&gt;

&lt;p&gt;All this logic will be implemented in &lt;strong&gt;corporate_agent/agent.py&lt;/strong&gt;, organized into five main sections.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Project Configuration&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 1. CONFIGURACIÓN DEL PROYECTO
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the first section, we load the environment variables from .env and configure the Gemini model and parameters used by our agent.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;create_agent_model()&lt;/strong&gt; function selects how to connect to Gemini depending on the runtime: through an API key for the local application or through Vertex AI when the agent is deployed to Google Cloud.&lt;/p&gt;

&lt;p&gt;We also configure parameters such as &lt;strong&gt;RAG_TOP_K&lt;/strong&gt;, which sets the maximum number of retrieved chunks, and &lt;strong&gt;RAG_REFRESH_INTERVAL_SECONDS&lt;/strong&gt;, which determines the refresh interval of the index managed by Agent Runtime.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Knowledge Base&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 2. BASE DE CONOCIMIENTO
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This section manages the RAG index implemented earlier in &lt;strong&gt;drive_rag.py&lt;/strong&gt;, allowing retrieved information to be reused without continuously querying Google Drive.&lt;/p&gt;

&lt;p&gt;It contains three main functions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;set_knowledge_base()&lt;/strong&gt;: allows our Streamlit application to provide the agent with a previously loaded RAG index managed by the application itself.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;_cache_is_current()&lt;/strong&gt;: checks whether the index stored in memory remains valid or needs refreshing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;get_knowledge_base()&lt;/strong&gt;: retrieves the available index and, when appropriate, queries Google Drive again to rebuild it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This prevents unnecessary downloads and improves response times. In Streamlit, refreshing is controlled manually, whereas in Agent Runtime it can happen automatically when a query arrives after the configured interval has expired.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;RAG Tool for Google ADK&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 3. HERRAMIENTA RAG PARA GOOGLE ADK
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we implement &lt;strong&gt;search_corporate_policies()&lt;/strong&gt;, the tool our agent will use to query corporate information.&lt;/p&gt;

&lt;p&gt;When users ask a question, this function accesses the RAG index, retrieves the most relevant chunks, and returns their content along with the names and links of the original documents.&lt;/p&gt;

&lt;p&gt;It also includes error handling to identify connection, permission, or Google Drive access issues without exposing sensitive information during execution.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Per-Turn Document Search Control&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 4. CONTROL DE CONSULTA DOCUMENTAL POR TURNO
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This section introduces &lt;strong&gt;enforce_search_per_turn()&lt;/strong&gt;, which we use as a Google ADK &lt;em&gt;callback&lt;/em&gt; to control when the search tool must run. Its goal is to ensure that the agent performs a new document search whenever a user submits a question, rather than answering solely from information retrieved earlier in the conversation.&lt;/p&gt;

&lt;p&gt;Once &lt;strong&gt;search_corporate_policies&lt;/strong&gt; has been executed and returned its results, the agent can continue generating a response through Gemini.&lt;/p&gt;

&lt;p&gt;This behavior is particularly useful when corporate policies change and we need to consult up-to-date information.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Defining the Agent with Google ADK&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 5. DEFINICIÓN DEL AGENTE CON GOOGLE ADK
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we define our main agent using &lt;strong&gt;root_agent = Agent()&lt;/strong&gt;, the central component of the solution.&lt;/p&gt;

&lt;p&gt;In this configuration, we set its key properties:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;name&lt;/strong&gt;: identifies the agent as corporate_policies_assistant.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;model&lt;/strong&gt;: specifies which Gemini model the agent will use to interpret queries and generate answers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;description&lt;/strong&gt;: briefly explains its purpose within the organization.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;instruction&lt;/strong&gt;: contains the instructions or prompt that determine how the agent should behave, including consulting documents, generating grounded answers, and including references.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;tools&lt;/strong&gt;: registers the search_corporate_policies function as an available tool for the agent.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;before_model_callback&lt;/strong&gt;: adds the mechanism requiring a new document search whenever a user query is received.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent's instructions are especially important because they specify that answers must be based on retrieved documents and that the assistant should acknowledge insufficient information rather than make up an answer. They also limit its behavior to corporate policy topics.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Important Considerations&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;With this implementation, our agent integrates &lt;strong&gt;Google ADK, Gemini, and the RAG system&lt;/strong&gt; developed earlier, allowing it to answer questions about policies stored in Google Drive.&lt;/p&gt;

&lt;p&gt;It is important to remember that response quality depends on the information available in the documents and the chunks retrieved during the search. For this reason, we have included instructions to rely on document sources and avoid unsupported answers.&lt;/p&gt;

&lt;p&gt;The design also allows the same agent to run in our local &lt;strong&gt;Streamlit&lt;/strong&gt; application and later in Google Cloud Agent Runtime, mainly by changing the authentication mechanism and model configuration.&lt;/p&gt;

&lt;p&gt;With our agent defined, the next step is to build the &lt;strong&gt;Streamlit&lt;/strong&gt; web interface, where users can ask questions, view answers, and see information about documents and token usage.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Developing the agent's web interface with Streamlit&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Once our &lt;strong&gt;Google ADK&lt;/strong&gt; agent and its &lt;strong&gt;RAG system&lt;/strong&gt; integration have been implemented, the next step is to build a web interface that allows users to interact with it easily.&lt;/p&gt;

&lt;p&gt;We will use &lt;strong&gt;Streamlit&lt;/strong&gt;, a Python framework for creating web applications without working directly with HTML, JavaScript, or additional frontend frameworks.&lt;/p&gt;

&lt;p&gt;The entire interface logic will be implemented in &lt;strong&gt;app.py&lt;/strong&gt;, located at the project root and organized into eight main sections.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Environment Variables and Project Configuration&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 1. VARIABLES DE ENTORNO Y CONFIGURACIÓN DEL PROYECTO
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the first section, we load the environment variables from .env, import our Google ADK agent, and configure general Streamlit parameters.&lt;/p&gt;

&lt;p&gt;We also define the maximum agent response time and the reference prices used to calculate estimated token costs.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Dashboard Visual Styles&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 2. ESTILOS VISUALES DEL DASHBOARD (TEMA OSCURO)
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This section defines the application's appearance, including colors, typography, cards, and dashboard components.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;render_dashboard_style()&lt;/strong&gt; function applies custom styles using CSS, while &lt;strong&gt;get_kb()&lt;/strong&gt; loads and keeps the RAG index of Google Drive documents in memory.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Creating Sessions and the Google ADK Runner&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 3. CREACIÓN DE SESIONES Y RUNNER DE GOOGLE ADK
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;init_runner()&lt;/strong&gt; function initializes the components that execute our agent and maintain conversation context.&lt;/p&gt;

&lt;p&gt;We use Google ADK's Runner and InMemorySessionService to process queries and manage conversation sessions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Measuring Tokens, Costs, and Agent Execution&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 4. MEDICIÓN DE TOKENS, COSTES Y EJECUCIÓN DEL AGENTE
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This section sends questions to the agent, receives answers, and collects information about Gemini model consumption.&lt;/p&gt;

&lt;p&gt;Its main functions are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;new_usage_metrics()&lt;/strong&gt;: initializes usage metrics.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;collect_usage()&lt;/strong&gt;: gathers token usage information available in Google ADK events.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;calculate_estimated_cost()&lt;/strong&gt;: calculates the approximate cost of queries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;render_usage_metrics() and render_session_usage()&lt;/strong&gt;: display metrics for an individual query and the session.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ask_agent()&lt;/strong&gt;: sends a question to the agent and retrieves the generated answer.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We also have &lt;strong&gt;select_chat_page()&lt;/strong&gt;, which simplifies navigation to the chatbot.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Footer and Version Information&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 5. PIE DE PÁGINA COMÚN Y DATOS DE VERSIÓN
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;render_footer()&lt;/strong&gt; function adds a shared footer displaying application details, copyright information, and version.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Introduction Page&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 6. PÁGINA DE INTRODUCCIÓN (DISEÑO DASHBOARD)
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;render_intro_page()&lt;/strong&gt; function builds the application's welcome screen.&lt;/p&gt;

&lt;p&gt;It presents the assistant's goal, the technologies used, and a brief explanation of how Google ADK, Gemini, and Google Drive work together.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Chat Page, Index, and Query Tools&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 7. PÁGINA DE CHAT, ÍNDICE Y HERRAMIENTAS DE CONSULTA
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This section contains the &lt;strong&gt;render_chat_page()&lt;/strong&gt; function, which builds the chatbot's main interface.&lt;/p&gt;

&lt;p&gt;On this screen, users can ask questions about corporate policies, view answers and their sources, inspect usage metrics, and manually refresh the documents indexed from Google Drive.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Main Navigation and Entry Point&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 8. NAVEGACIÓN PRINCIPAL Y PUNTO DE ENTRADA
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, the &lt;strong&gt;main()&lt;/strong&gt; function controls navigation between screens and coordinates our Streamlit application's execution. This section also contains the main entry point from which the application starts.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Streamlit Visual Configuration with config.toml&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;In addition to the custom styles defined in app.py, we will use &lt;strong&gt;.streamlit/config.toml&lt;/strong&gt; to set the general configuration of our Streamlit application. This file lets us customize visual elements such as the theme, primary colors, background, and typography while keeping these preferences separate from the Python code. Our project will use a dark appearance (&lt;em&gt;Dark Mode&lt;/em&gt;), supplemented with the CSS styles defined in &lt;strong&gt;render_dashboard_style()&lt;/strong&gt;. In this way, we can maintain a consistent interface and easily change its appearance without affecting the agent logic or its Google ADK and Gemini integrations.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Final Considerations&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;By implementing app.py, we complete the integration of the solution's main components: &lt;strong&gt;Streamlit&lt;/strong&gt; as the web interface, &lt;strong&gt;Google ADK&lt;/strong&gt; to run the agent, &lt;strong&gt;Gemini&lt;/strong&gt; to generate answers, and &lt;strong&gt;Google Drive&lt;/strong&gt; as the document repository.&lt;/p&gt;

&lt;p&gt;We have also added features such as session management, manual RAG index refresh, and usage metrics, allowing us to evaluate the assistant's behavior during testing.&lt;/p&gt;

&lt;p&gt;We now have everything needed to run the &lt;strong&gt;Corporate Policies Assistant&lt;/strong&gt; locally and start submitting our first queries.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Running and testing the agent locally&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;With the solution's components developed, we can now launch the &lt;strong&gt;Corporate Policies Assistant&lt;/strong&gt; and verify its behavior.&lt;/p&gt;

&lt;p&gt;We will test it in three ways: through our custom &lt;strong&gt;Streamlit&lt;/strong&gt; interface, the &lt;strong&gt;ADK Web&lt;/strong&gt; development interface, and directly from the &lt;strong&gt;Google ADK command-line interface (CLI)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Run the Application with Streamlit&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Streamlit will be our main interface because it provides a chatbot for interacting with the agent and displays additional information, such as indexed documents and usage metrics.&lt;/p&gt;

&lt;p&gt;Although both versions are in the same repository, we can run them independently using the same Python virtual environment.&lt;/p&gt;

&lt;p&gt;To start the &lt;strong&gt;English version&lt;/strong&gt;, run the following from the project root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;streamlit&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="n"&gt;sources_en&lt;/span&gt;\&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To start the &lt;strong&gt;Spanish version&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;streamlit&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="n"&gt;sources_es&lt;/span&gt;\&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also run both applications simultaneously on ports 8501 and 8502, respectively. Each version will use its own .env configuration, instructions, and configured Google Drive documents.&lt;/p&gt;

&lt;p&gt;This setup allows us to work with two language versions of the same solution while keeping their components separate and making it easier to evolve toward &lt;strong&gt;Google Cloud Agent Runtime and Gemini Enterprise&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Once the server has started, open the following address in your browser: &lt;a href="http://localhost:8501" rel="noopener noreferrer"&gt;&lt;strong&gt;http://localhost:8501&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the application, we can ask questions about corporate policies, view the cited sources, and manually refresh the index of documents stored in Google Drive.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fwiki-cloud.co%2Fwp-content%2Fuploads%2F2026%2F11%2Farticle_image_build_ai_agent_with_google_adk_05.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fwiki-cloud.co%2Fwp-content%2Fuploads%2F2026%2F11%2Farticle_image_build_ai_agent_with_google_adk_05.gif" alt="Streamlit assistant interface" width="480" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Run the Agent from ADK Web&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Google ADK&lt;/strong&gt; includes a development web interface that allows us to interact directly with agents, review their responses, and observe tool execution. From the project root, run:&lt;/p&gt;

&lt;p&gt;To start the &lt;strong&gt;English version&lt;/strong&gt;, run the following from the project root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;adk&lt;/span&gt; &lt;span class="n"&gt;web&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;8000&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="n"&gt;sources_en&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To start the &lt;strong&gt;Spanish version&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;adk&lt;/span&gt; &lt;span class="n"&gt;web&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;8001&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="n"&gt;sources_es&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then open: &lt;a href="http://localhost:8000" rel="noopener noreferrer"&gt;&lt;strong&gt;http://localhost:8000&lt;/strong&gt;&lt;/a&gt; or &lt;a href="http://localhost:8001" rel="noopener noreferrer"&gt;&lt;strong&gt;http://localhost:8001&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the interface, select our &lt;strong&gt;corporate_agent&lt;/strong&gt; and start asking questions.&lt;/p&gt;

&lt;p&gt;This mode is especially useful during development because it lets us inspect interactions with Gemini and see when the agent runs the &lt;strong&gt;search_corporate_policies&lt;/strong&gt; tool.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg88ku04q15qdj4t9zkx6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg88ku04q15qdj4t9zkx6.png" alt="Running the agent in ADK Web" width="800" height="741"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://wiki-cloud.co/wp-content/uploads/2026/11/article_image_build_ai_agent_with_google_adk_06.gif" rel="noopener noreferrer"&gt;View Animated GIF&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Run the Agent from the Command Line&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;We can also interact with our agent directly from PowerShell, without a graphical interface. To do so, run:&lt;/p&gt;

&lt;p&gt;To start the &lt;strong&gt;English version&lt;/strong&gt;, run the following from the project root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;adk&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="n"&gt;sources_en&lt;/span&gt;\&lt;span class="n"&gt;corporate_agent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To start the &lt;strong&gt;Spanish version&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;adk&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="n"&gt;sources_es&lt;/span&gt;\&lt;span class="n"&gt;corporate_agent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command starts an interactive session where we can type questions and receive answers directly in the terminal.&lt;/p&gt;

&lt;p&gt;It is a simple alternative for quick testing, checking agent behavior, and identifying errors during development.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp7e5axso9ly7z3yo3n2a.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp7e5axso9ly7z3yo3n2a.gif" alt="Agent in the command line" width="760" height="558"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Validate the Agent's Behavior&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Regardless of how we run it, we can ask questions about the documents stored in Google Drive:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How many vacation days do employees receive each year?&lt;/li&gt;
&lt;li&gt;What is the company's remote work policy?&lt;/li&gt;
&lt;li&gt;How can I request reimbursement for an expense?&lt;/li&gt;
&lt;li&gt;What does the recycling and sustainability policy say?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;During these tests, we should verify that the agent queries documents using &lt;strong&gt;search_corporate_policies&lt;/strong&gt;, generates coherent responses, and provides references to the original sources.&lt;/p&gt;

&lt;p&gt;It is also advisable to ask a question that the documents cannot answer to verify that the agent acknowledges when it lacks sufficient information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Streamlit, ADK Web, and ADK CLI all allow interaction with the same agent but offer different experiences. Streamlit is our custom interface, while ADK Web and ADK CLI are primarily intended for development and testing. The latter two do not replace a production-ready enterprise interface.&lt;/p&gt;

&lt;p&gt;To stop any of the servers or sessions, press &lt;strong&gt;Ctrl + C&lt;/strong&gt; in the corresponding terminal.&lt;/p&gt;

&lt;p&gt;With these tests, we will have completed the local implementation of our &lt;strong&gt;Corporate Policies Assistant&lt;/strong&gt;. In the second part of this series, we will reuse the agent to deploy it to &lt;strong&gt;Google Cloud Agent Runtime&lt;/strong&gt; and make it available to users through &lt;strong&gt;Gemini Enterprise&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusions&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Throughout this exercise, we developed a &lt;strong&gt;Corporate Policies Assistant&lt;/strong&gt; using Google ADK, Gemini, Google Drive, and Streamlit. With a simple RAG-based architecture, we connected an artificial intelligence agent to enterprise documents, enabling it to query information, retrieve relevant content, and generate natural-language answers accompanied by their sources. We also explored key aspects of agent development, including tool integration, session management, model instructions, and building a web interface.&lt;/p&gt;

&lt;p&gt;Developing AI agents offers organizations an opportunity to transform how employees access information and perform everyday tasks. Solutions like the one we built can reduce the time spent searching for documents, improve access to corporate knowledge, and serve as a starting point for automating more complex processes. However, adoption also requires attention to security, access permissions, information quality, and oversight of generated responses. This exercise helps us understand the foundations of agentic AI and how to begin applying these capabilities to real enterprise scenarios.&lt;/p&gt;

&lt;p&gt;In the &lt;strong&gt;second part of this series&lt;/strong&gt;, we will take the next step: deploying our agent to &lt;strong&gt;Google Cloud Agent Runtime&lt;/strong&gt; and integrating it with &lt;strong&gt;Gemini Enterprise&lt;/strong&gt;, moving from a local application to a solution accessible through an enterprise platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Resources&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To learn more about the technologies used in this exercise, see the following official documentation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://adk.dev/get-started/python/" rel="noopener noreferrer"&gt;Google Agent Development Kit (ADK)&lt;/a&gt;:&lt;/strong&gt; an introduction to agent development, tools, and execution with Python.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://aistudio.google.com/" rel="noopener noreferrer"&gt;Google AI Studio&lt;/a&gt;:&lt;/strong&gt; a platform for experimenting with Gemini models and obtaining an API key.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://ai.google.dev/gemini-api/docs" rel="noopener noreferrer"&gt;Gemini API&lt;/a&gt;:&lt;/strong&gt; model, SDK, and API configuration documentation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://developers.google.com/workspace/drive/api/quickstart/python" rel="noopener noreferrer"&gt;Google Drive API&lt;/a&gt;:&lt;/strong&gt; integrating Python applications with documents stored in Google Drive.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://docs.streamlit.io/get-started" rel="noopener noreferrer"&gt;Streamlit&lt;/a&gt;:&lt;/strong&gt; building interactive web applications with Python.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://cloud.google.com/use-cases/retrieval-augmented-generation" rel="noopener noreferrer"&gt;Introduction to RAG — Google Cloud&lt;/a&gt;:&lt;/strong&gt; concepts and operation of retrieval-augmented generation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/runtime/quickstart-adk" rel="noopener noreferrer"&gt;Google Cloud Agent Runtime&lt;/a&gt;:&lt;/strong&gt; deploying and running Google ADK agents on Google Cloud.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope you find this useful!!!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow us:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉&lt;a href="http://wiki-cloud.co/" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt; | 👉&lt;a href="https://x.com/johnbulla" rel="noopener noreferrer"&gt;X&lt;/a&gt; | 👉&lt;a href="https://www.linkedin.com/in/johnbulla" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; | 👉&lt;a href="https://github.com/johnbulla" rel="noopener noreferrer"&gt;Github&lt;/a&gt; | 👉&lt;a href="https://www.youtube.com/user/johnbulla" rel="noopener noreferrer"&gt;Youtube&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>cloud</category>
      <category>googlecloud</category>
    </item>
    <item>
      <title>Cómo construir un agente de IA con Google ADK</title>
      <dc:creator>John Bulla</dc:creator>
      <pubDate>Sat, 14 Nov 2026 22:31:17 +0000</pubDate>
      <link>https://dev.to/johnbulla/como-construir-un-agente-de-ia-con-google-adk-209i</link>
      <guid>https://dev.to/johnbulla/como-construir-un-agente-de-ia-con-google-adk-209i</guid>
      <description>&lt;div class="ltag__user ltag__user__id__666134"&gt;
    &lt;a href="/johnbulla" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=150,height=150,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F666134%2Fc19791a4-86a8-48f5-8ff6-b31d0aa6b1a7.png" alt="johnbulla image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/johnbulla"&gt;John Bulla&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/johnbulla"&gt;💼 Sr. Cloud Solutions Architect - Cloud, Data &amp;amp; AI | Pre-Sales Architect | Cloud Evangelist 
🏆 Google Developer Expert | AWS Community Builder | Alibaba Cloud MVP | Ex-Microsoft MVP&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;✋ &lt;strong&gt;Nota:&lt;/strong&gt; Este artículo se publicó originalmente en mi blog &lt;a href="https://wiki-cloud.co/es/2026/11/build-ai-agent-with-google-adk/" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introducción&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;La inteligencia artificial está atravesando una nueva etapa de evolución. Durante los últimos años, los modelos de &lt;strong&gt;inteligencia artificial generativa&lt;/strong&gt; han transformado nuestra forma de crear contenido, desarrollar software y acceder a la información. Sin embargo, las necesidades de las organizaciones van más allá de obtener respuestas a partir de un &lt;em&gt;prompt&lt;/em&gt;: también requieren aplicaciones capaces de consultar sistemas empresariales, utilizar herramientas y ejecutar pasos orientados a resolver una necesidad concreta. Este avance impulsa la &lt;strong&gt;inteligencia artificial agéntica&lt;/strong&gt;, en la que un modelo de lenguaje se integra con instrucciones, herramientas y fuentes de información para actuar dentro de un flujo de trabajo.&lt;/p&gt;

&lt;p&gt;En este contexto, Google desarrolló &lt;strong&gt;Google Agent Development Kit (Google ADK)&lt;/strong&gt; que es un &lt;em&gt;framework&lt;/em&gt; de código abierto, orientado al desarrollo de agentes de IA mediante código. Ofrece componentes para definir agentes y sus instrucciones, integrar modelos como Gemini, incorporar herramientas y funciones, gestionar sesiones y coordinar flujos que pueden evolucionar desde un agente individual hasta sistemas multiagente. Su valor no reside únicamente en generar respuestas, sino en proporcionar una estructura para construir soluciones extensibles, observables y comprobables.&lt;/p&gt;

&lt;p&gt;En artículos anteriores realicé una &lt;a href="https://wiki-cloud.co/es/2026/07/google-adk-intro-ai-agent-development/" rel="noopener noreferrer"&gt;introducción al desarrollo de agentes de IA&lt;/a&gt; donde comenté la evolución desde la IA generativa hacia la IA agéntica, qué caracteriza a un agente y por qué Google ADK resulta útil para su desarrollo. Por otra parte, también se introdujo a la &lt;a href="https://wiki-cloud.co/es/2026/07/google-adk-architecture-essential-components/" rel="noopener noreferrer"&gt;arquitectura y componentes de Google ADK&lt;/a&gt; que sirve como lectura complementaria para profundizar en el diseño y los elementos que conforman este tipo de soluciones.&lt;/p&gt;

&lt;p&gt;En este nuevo artículo damos el siguiente paso: pasamos de los conceptos y la arquitectura a una implementación práctica de un agente de IA con Google ADK.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Objetivo de la solución&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;En esta guía vamos a desarrollar un agente de inteligencia artificial que funcionará como un &lt;strong&gt;Asistente de Políticas Corporativas&lt;/strong&gt;, capaz de responder preguntas sobre documentos internos de Recursos Humanos, Finanzas, Tecnología, Seguridad, Legal, Compras, Operaciones y Sostenibilidad, entre otras áreas.&lt;/p&gt;

&lt;p&gt;Imaginemos que un empleado necesita saber cuántos días de vacaciones le corresponden, cómo solicitar un reembolso o qué establece la política de reciclaje de su empresa. En lugar de buscar manualmente entre diferentes documentos, podrá realizar sus preguntas en lenguaje natural y obtener respuestas claras y contextualizadas. Para ello, nuestro agente consultará las políticas que se encuentran en documentos almacenados en &lt;strong&gt;Google Drive&lt;/strong&gt;, recuperará la información relevante y generará respuestas respaldadas por sus fuentes originales.&lt;/p&gt;

&lt;p&gt;Para implementar esta solución utilizaremos &lt;strong&gt;Google ADK&lt;/strong&gt;, como framework para desarrollar y ejecutar el agente; &lt;strong&gt;Gemini&lt;/strong&gt;, como modelo de lenguaje; &lt;strong&gt;Google Drive&lt;/strong&gt;, como repositorio documental; y &lt;strong&gt;Streamlit&lt;/strong&gt;, para construir una interfaz web tipo chatbot con Python. También incorporaremos una estrategia &lt;strong&gt;RAG basada en búsquedas léxicas&lt;/strong&gt;, utilizando un índice en memoria y sin necesidad de una base de datos vectorial. Esto nos permitirá comprender de forma sencilla cómo interactúan los diferentes componentes y cómo el agente transforma una consulta en una respuesta fundamentada.&lt;/p&gt;

&lt;p&gt;A lo largo del ejercicio prepararemos nuestro entorno de desarrollo con &lt;strong&gt;Python, PowerShell&lt;/strong&gt; en &lt;strong&gt;Visual Studio Code&lt;/strong&gt;, configuraremos el acceso a &lt;strong&gt;Google Drive&lt;/strong&gt;, implementaremos las herramientas de búsqueda y definiremos nuestro agente con &lt;strong&gt;Google ADK&lt;/strong&gt;. Finalmente, construiremos una aplicación web como frontend que contendrá un chatbot en Streamlit y realizaremos pruebas para validar las respuestas, sus fuentes y el consumo estimado de tokens.&lt;/p&gt;

&lt;p&gt;Este artículo constituye la &lt;strong&gt;primera parte de una serie práctica&lt;/strong&gt;. En la segunda, llevaremos el mismo agente a &lt;strong&gt;Google Cloud Agent Runtime&lt;/strong&gt; y lo integraremos con &lt;strong&gt;Gemini Enterprise&lt;/strong&gt;, mostrando cómo evolucionar desde una aplicación local hacia una solución accesible desde una plataforma empresarial.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Arquitectura de la Solución&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A continuación, se detalla la arquitectura planteada para esta solución y cómo funciona el flujo de trabajo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0wj3zeh7pzwqqr80pxkv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0wj3zeh7pzwqqr80pxkv.png" alt=" " width="800" height="605"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;La arquitectura de nuestro Asistente de Políticas Corporativas combina &lt;strong&gt;Streamlit, Google ADK, Gemini y Google Drive&lt;/strong&gt;, permitiendo que los usuarios consulten documentos empresariales mediante una interfaz de conversación y reciban respuestas basadas en información real.&lt;/p&gt;

&lt;p&gt;El proceso comienza con los documentos de políticas corporativas almacenados en &lt;strong&gt;Google Drive&lt;/strong&gt;. Cuando iniciamos la aplicación, esta se conecta al repositorio, identifica los archivos disponibles y extrae su contenido. Posteriormente, divide los textos en fragmentos más pequeños y construye un &lt;strong&gt;índice RAG en memoria&lt;/strong&gt;, que facilitará la búsqueda de información relevante. Este índice se mantiene disponible durante la ejecución de la aplicación y puede actualizarse manualmente cuando se incorporan nuevos documentos.&lt;/p&gt;

&lt;p&gt;Una vez preparada la base de conocimiento, el usuario puede realizar una pregunta desde la aplicación web que contiene un &lt;strong&gt;chatbot&lt;/strong&gt; desarrollado con &lt;strong&gt;Streamlit&lt;/strong&gt;. La consulta se envía al agente construido con &lt;strong&gt;Google ADK&lt;/strong&gt;, que utiliza el modelo &lt;strong&gt;Gemini&lt;/strong&gt; para interpretar lo que el usuario necesita y determinar si debe utilizar alguna de sus herramientas.&lt;/p&gt;

&lt;p&gt;Cuando la pregunta está relacionada con las políticas corporativas, el agente ejecuta la herramienta &lt;strong&gt;search_corporate_policies&lt;/strong&gt;, encargada de buscar en el índice RAG los fragmentos que mejor coincidan con la consulta. A diferencia de una búsqueda tradicional por documentos completos, este mecanismo permite recuperar únicamente las secciones que podrían contener la respuesta.&lt;/p&gt;

&lt;p&gt;Los fragmentos recuperados se devuelven al agente como información de contexto. A partir de ellos, &lt;strong&gt;Gemini&lt;/strong&gt; genera una respuesta en lenguaje natural, procurando utilizar únicamente la información encontrada y proporcionando referencias a los documentos originales de Google Drive. Si no encuentra información suficiente, el agente debe indicarlo en lugar de inventar una respuesta.&lt;/p&gt;

&lt;p&gt;Finalmente, la respuesta se presenta en &lt;strong&gt;Streamlit&lt;/strong&gt;, donde el usuario puede continuar la conversación, realizar nuevas preguntas y consultar las fuentes utilizadas. La aplicación web también permite visualizar métricas como el consumo estimado de tokens y actualizar manualmente el índice cuando se añaden o modifican políticas.&lt;/p&gt;

&lt;p&gt;De esta manera, conseguimos una arquitectura sencilla que permite comprender el funcionamiento de un agente de IA: desde la preparación e indexación de los documentos hasta la interpretación de una pregunta, la ejecución de herramientas y la generación de respuestas fundamentadas. Todo ello sin necesidad de incorporar una base de datos vectorial en esta primera implementación.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requisitos previos
&lt;/h2&gt;

&lt;p&gt;Para esta demostración trabajaremos sobre &lt;strong&gt;Windows&lt;/strong&gt;, utilizando &lt;strong&gt;PowerShell&lt;/strong&gt; para ejecutar los comandos y &lt;strong&gt;Visual Studio Code&lt;/strong&gt; como entorno de desarrollo. También necesitaremos tener instalado &lt;strong&gt;Python 3.12&lt;/strong&gt;, que utilizaremos para implementar el agente con Google ADK y construir la aplicación web con Streamlit.&lt;/p&gt;

&lt;p&gt;En cuanto a los servicios de Google, necesitaremos acceso a &lt;strong&gt;Google AI Studio&lt;/strong&gt; para obtener una API Key de Gemini, con cuota o créditos de facturación disponibles para realizar las consultas al modelo. También será necesario disponer de un proyecto en &lt;strong&gt;Google Cloud&lt;/strong&gt; con la API de Google Drive habilitada y una carpeta donde almacenaremos las políticas corporativas que consultará nuestro agente.&lt;/p&gt;

&lt;p&gt;Para acceder a estos documentos utilizaremos una &lt;strong&gt;cuenta de servicio&lt;/strong&gt; de &lt;strong&gt;Google Cloud&lt;/strong&gt;, a la que concederemos permisos de lectura sobre la carpeta correspondiente en Google Drive. En entornos empresariales, es importante revisar previamente las políticas de seguridad de la organización, especialmente las relacionadas con la creación y descarga de claves JSON. Para este laboratorio utilizaremos este mecanismo de autenticación únicamente en un entorno de pruebas autorizado.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Verificación de las herramientas&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Una vez instaladas las herramientas, podemos comprobar que estén disponibles ejecutando los siguientes comandos desde PowerShell:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Verificar la versión de Python:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;py&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;3.12&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#OUTPUT
Python 3.12.10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Verificar la instalación de Visual Studio Code:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#OUTPUT
1.145.2
x64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Verificar la instalación de Google Cloud CLI:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#OUTPUT
Google Cloud SDK 592.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;El último comando requiere tener instalado &lt;strong&gt;&lt;a href="https://docs.cloud.google.com/sdk/docs/install-sdk?hl=es-419" rel="noopener noreferrer"&gt;Google Cloud CLI&lt;/a&gt;&lt;/strong&gt;, que utilizaremos principalmente en la segunda parte de esta serie, cuando despleguemos nuestro agente en &lt;strong&gt;Google Cloud Agent Runtime&lt;/strong&gt; y lo integremos con Gemini Enterprise.&lt;/p&gt;

&lt;p&gt;Para esta primera implementación local con &lt;strong&gt;Google ADK y Streamlit&lt;/strong&gt;, será suficiente disponer de la API Key de Gemini y de una cuenta de servicio autorizada para consultar los documentos de Google Drive.&lt;/p&gt;

&lt;p&gt;Con estos requisitos preparados, podremos continuar con la creación del entorno virtual de Python y la instalación de las dependencias necesarias para desarrollar nuestro asistente.&lt;/p&gt;

&lt;h2&gt;
  
  
  Organización y estructura del código fuente de la solución
&lt;/h2&gt;

&lt;p&gt;En nuestro ejemplo, organizaremos el código en carpetas independientes para la definición del agente, la integración con Google Drive, las políticas corporativas, las pruebas y los scripts de despliegue.&lt;/p&gt;

&lt;p&gt;Antes de comenzar con la implementación de nuestro agente, vamos a conocer cómo está organizado el proyecto. Mantener una estructura clara nos permitirá separar las responsabilidades de cada componente, facilitar su mantenimiento y reutilizar el código cuando avancemos hacia el despliegue en Google Cloud.&lt;/p&gt;

&lt;p&gt;Para esta demostración, hemos organizado el código fuente en un único repositorio que contiene dos versiones del &lt;strong&gt;Asistente de Políticas Corporativas:&lt;/strong&gt; una en inglés &lt;strong&gt;(sources_en)&lt;/strong&gt; y otra en español &lt;strong&gt;(sources_es)&lt;/strong&gt;. Ambas mantienen la misma arquitectura y funcionalidades, pero cuentan con sus propios archivos Python, instrucciones del agente, ejemplos de políticas corporativas y configuración de entorno. De esta manera, podremos ejecutar y probar cada versión de forma independiente.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Estructura del proyecto&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Para simplificar la explicación, mostraremos únicamente la estructura interna de &lt;strong&gt;sources_en&lt;/strong&gt;, ya que &lt;strong&gt;sources_es&lt;/strong&gt; utiliza la misma organización, con los contenidos correspondientes al idioma español.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;google-adk-gemini-corporate-policies-agent/
│
├── sources_es/ # Versión en español
│ └── ... # Misma estructura que sources_en
│
├── sources_en/ # Versión en inglés
│ ├── .streamlit/
│ │ └── config.toml
│ │
│ ├── corporate_agent/
│ │ ├── __init__.py
│ │ ├── agent.py
│ │ └── drive_rag.py
│ │
│ ├── corporate_policies/
│ │ └── *.txt
│ │
│ ├── credentials/
│ │ └── .gitkeep
│ │
│ ├── deployment/
│ │ ├── __init__.py
│ │ └── deploy_agent.py
│ │
│ ├── prompts/
│ │ └── *.txt
│ │
│ ├── test/
│ │ ├── __init__.py
│ │ ├── test_drive.py
│ │ ├── test_gemini.py
│ │ └── test_runtime.py
│ │
│ ├── __init__.py
│ ├── .env
│ ├── app.py
│ └── pyproject.toml
│
├── .gitignore
├── README.md
├── README_ES.md
└── requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;Descripción de los componentes&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;A continuación, describimos brevemente la función de las principales carpetas y archivos que componen ambas versiones de nuestra solución.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Carpeta o Archivo&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;sources_en/&lt;/td&gt;
&lt;td&gt;Contiene la versión del agente en inglés, incluyendo su interfaz, instrucciones y políticas corporativas.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sources_es/&lt;/td&gt;
&lt;td&gt;Contiene la versión del agente en español, que utilizaremos como referencia durante este artículo.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;.streamlit/&lt;/td&gt;
&lt;td&gt;Contiene config.toml, utilizado para personalizar la apariencia y configuración de Streamlit.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;corporate_agent/&lt;/td&gt;
&lt;td&gt;Contiene la lógica principal del agente de inteligencia artificial desarrollado con Google ADK.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;corporate_agent/agent.py&lt;/td&gt;
&lt;td&gt;Define el agente principal (root_agent), sus instrucciones, el modelo Gemini y la herramienta de búsqueda de políticas.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;corporate_agent/drive_rag.py&lt;/td&gt;
&lt;td&gt;Implementa la conexión con Google Drive, la lectura de documentos, su fragmentación, indexación y recuperación mediante RAG.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;corporate_policies/&lt;/td&gt;
&lt;td&gt;Contiene ejemplos de políticas corporativas en archivos TXT, redactados en el idioma correspondiente a cada versión. Estos documentos servirán como base de conocimiento al cargarlos en Google Drive.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;credentials/&lt;/td&gt;
&lt;td&gt;Carpeta destinada a almacenar las credenciales locales necesarias para acceder a Google Drive.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;deployment/&lt;/td&gt;
&lt;td&gt;Contiene los scripts necesarios para desplegar el agente en Google Cloud Agent Runtime. Se utilizará principalmente en la segunda parte de la serie, cuando se implemente el agente en Gemini Enterprise.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;prompts/&lt;/td&gt;
&lt;td&gt;Almacena las instrucciones o prompts del agente en el idioma correspondiente.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;test/&lt;/td&gt;
&lt;td&gt;Agrupa las pruebas para validar la conexión con Google Drive, el funcionamiento de Gemini y la ejecución del agente desplegado en Agent Runtime.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;__init__.py&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Archivos utilizados para identificar paquetes Python y organizar la importación de módulos.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;.env&lt;/td&gt;
&lt;td&gt;Almacena las variables de entorno de la aplicación, como la configuración de Gemini, Google Drive y Agent Runtime.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;.gitignore&lt;/td&gt;
&lt;td&gt;Define los archivos y carpetas que Git debe excluir, como credenciales, cachés y entornos virtuales.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;app.py&lt;/td&gt;
&lt;td&gt;Implementa la interfaz web desarrollada con Streamlit, incluyendo el chatbot, las sesiones y las métricas de consumo.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pyproject.toml&lt;/td&gt;
&lt;td&gt;Define la configuración de empaquetado del proyecto, necesaria para generar el paquete instalable del agente.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;README.md&lt;/td&gt;
&lt;td&gt;Contiene la documentación general del proyecto, los requisitos, las instrucciones de instalación y los comandos de ejecución en idioma inglés.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;README_ES.md&lt;/td&gt;
&lt;td&gt;Contiene la documentación general del proyecto, los requisitos, las instrucciones de instalación y los comandos de ejecución en idioma español.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;requirements.txt&lt;/td&gt;
&lt;td&gt;Incluye las dependencias de Python necesarias para configurar el entorno de desarrollo y ejecutar la solución.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Esta separación nos permitirá trabajar inicialmente con &lt;strong&gt;Google ADK&lt;/strong&gt; y &lt;strong&gt;Streamlit&lt;/strong&gt; en nuestro entorno local, manteniendo los componentes necesarios para desplegar posteriormente el mismo agente en &lt;strong&gt;Google Cloud Agent Runtime&lt;/strong&gt; e integrarlo con &lt;strong&gt;Gemini Enterprise&lt;/strong&gt;, sin tener que desarrollar una solución completamente nueva.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Código fuente disponible en GitHub&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;El código fuente de ambas versiones se encuentra organizado en un único repositorio de &lt;strong&gt;GitHub&lt;/strong&gt;, donde podrás consultar los archivos Python, descargar los ejemplos de políticas corporativas y seguir las instrucciones de instalación y ejecución.&lt;/p&gt;

&lt;p&gt;Puedes descargar el proyecto desde la opción &lt;strong&gt;Code → Download ZIP&lt;/strong&gt; de GitHub o clonarlo directamente mediante Git:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;git&lt;/span&gt; &lt;span class="n"&gt;clone&lt;/span&gt; &lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;johnbulla&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;adk&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;gemini&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;corporate&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;policies&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Una vez descargado, abre la carpeta del proyecto en Visual Studio Code y selecciona la versión que deseas ejecutar.&lt;/p&gt;

&lt;p&gt;El repositorio incluye dos archivos de documentación: README.md, disponible en inglés de forma predeterminada, y README_ES.md, con las instrucciones en español.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repositorio del proyecto:&lt;/strong&gt; &lt;a href="https://github.com/johnbulla/google-adk-gemini-corporate-policies-agent" rel="noopener noreferrer"&gt;Corporate Policies Agent — GitHub&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Crear entorno virtual en VS Code con PowerShell
&lt;/h2&gt;

&lt;p&gt;Una vez que tenemos instaladas las herramientas necesarias y conocemos la estructura del proyecto, el siguiente paso será preparar nuestro entorno de desarrollo en &lt;strong&gt;Visual Studio Code (VS Code)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Para trabajar con Python utilizaremos un &lt;strong&gt;entorno virtual&lt;/strong&gt;, que nos permitirá instalar y administrar las bibliotecas que necesita nuestra aplicación de forma independiente, sin afectar otras versiones de Python ni las dependencias de otros proyectos que tengamos en nuestro equipo.&lt;/p&gt;

&lt;p&gt;En este ejercicio utilizaremos &lt;strong&gt;Python 3.12&lt;/strong&gt; y ejecutaremos los comandos desde la terminal integrada de VS Code, utilizando PowerShell.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Crear el entorno virtual de Python&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Primero, abrimos la carpeta raíz de nuestro proyecto en Visual Studio Code y accedemos a la terminal desde el menú &lt;strong&gt;Terminal → New Terminal&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Desde esta ubicación ejecutamos:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;venv&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;venv&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este comando crea un entorno virtual llamado &lt;strong&gt;.venv&lt;/strong&gt; dentro del proyecto. Allí se instalarán las bibliotecas necesarias para desarrollar nuestro agente, evitando conflictos con otros proyectos Python.&lt;/p&gt;

&lt;p&gt;El nombre &lt;strong&gt;.venv&lt;/strong&gt; es una convención habitual y permite que Visual Studio Code identifique fácilmente el entorno virtual.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Habilitar y activar el entorno virtual&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;En Windows, PowerShell puede restringir la ejecución de scripts por motivos de seguridad. Si encontramos esta restricción al intentar activar nuestro entorno, podemos habilitar temporalmente su ejecución mediante:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;ExecutionPolicy&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Scope&lt;/span&gt; &lt;span class="k"&gt;Process&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;ExecutionPolicy&lt;/span&gt; &lt;span class="nc"&gt;Bypass&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este comando modifica la política de ejecución únicamente para la sesión actual de PowerShell, sin cambiar permanentemente la configuración del sistema. Debe utilizarse solo cuando sea necesario y esté permitido por las políticas de seguridad del equipo.&lt;/p&gt;

&lt;p&gt;Posteriormente, activamos el entorno virtual:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;venv&lt;/span&gt;\&lt;span class="nc"&gt;Scripts&lt;/span&gt;\&lt;span class="nc"&gt;Activate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ps1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cuando el entorno esté activo, veremos el prefijo (.venv) al inicio de la línea de comandos, indicando que las instalaciones y ejecuciones de Python utilizarán nuestro entorno virtual.&lt;/p&gt;

&lt;p&gt;Por ejemplo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(.venv) PS C:\Projects\Corporate Policies Agent\&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;Actualizar las herramientas de instalación de Python&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Antes de instalar las dependencias, es recomendable actualizar las herramientas que Python utiliza para administrar y construir paquetes.&lt;/p&gt;

&lt;p&gt;Ejecutamos:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;upgrade&lt;/span&gt; &lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;setuptools&lt;/span&gt; &lt;span class="n"&gt;wheel&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este comando actualiza tres herramientas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;pip:&lt;/strong&gt; administrador de paquetes utilizado para instalar las bibliotecas de Python.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;setuptools:&lt;/strong&gt; herramienta que permite configurar y construir paquetes Python distribuibles.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;wheel:&lt;/strong&gt; proporciona soporte para generar paquetes instalables en formato .whl, que utilizaremos posteriormente para desplegar nuestro agente en Google Cloud Agent Runtime.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Aunque pip es suficiente para instalar muchas de las bibliotecas del proyecto, setuptools y wheel serán especialmente útiles cuando preparemos el agente para su despliegue en la nube.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Instalar las dependencias del proyecto&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Nuestro agente utilizará varias bibliotecas de Python para interactuar con Gemini, Google Drive, Google ADK y Streamlit. En lugar de instalarlas manualmente una por una, las agruparemos en un archivo llamado &lt;strong&gt;requirements.txt&lt;/strong&gt;, ubicado en la raíz del proyecto.&lt;/p&gt;

&lt;p&gt;Este archivo nos permite mantener una lista centralizada de dependencias y facilita que otras personas puedan reproducir el mismo entorno de desarrollo.&lt;/p&gt;

&lt;p&gt;Para instalar todas las bibliotecas, ejecutamos:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="n"&gt;requirements&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;txt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;El comando lee el archivo requirements.txt e instala las dependencias declaradas junto con las bibliotecas adicionales que estas necesiten.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Contenido de requirements.txt&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;adk&lt;/span&gt;
&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;genai&lt;/span&gt;
&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;
&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;
&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;oauthlib&lt;/span&gt;
&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;cloud&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;storage&lt;/span&gt;
&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;dotenv&lt;/span&gt;
&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;docx&lt;/span&gt;
&lt;span class="n"&gt;pypdf&lt;/span&gt;
&lt;span class="n"&gt;streamlit&lt;/span&gt;
&lt;span class="n"&gt;pydantic&lt;/span&gt;
&lt;span class="n"&gt;cloudpickle&lt;/span&gt;
&lt;span class="c1"&gt;# Dependencies for the environment running deployment scripts&lt;/span&gt;
&lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;cloud&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;aiplatform&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;agent_engines&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;adk&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="mf"&gt;1.112&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A continuación, explicamos brevemente para qué utilizaremos cada dependencia.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dependencia&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;google-adk&lt;/td&gt;
&lt;td&gt;Framework de Google que utilizaremos para desarrollar nuestro agente de IA, definir sus instrucciones, integrar herramientas y gestionar las sesiones de conversación.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;google-genai&lt;/td&gt;
&lt;td&gt;SDK para interactuar con los modelos Gemini, enviar consultas y obtener respuestas generadas por el modelo.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;google-api-python-client&lt;/td&gt;
&lt;td&gt;Cliente que permite consumir las APIs de Google. En nuestro caso, lo utilizaremos para consultar y descargar documentos mediante Google Drive API.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;google-auth&lt;/td&gt;
&lt;td&gt;Proporciona los mecanismos de autenticación necesarios para acceder a los servicios de Google mediante credenciales autorizadas.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;google-auth-oauthlib&lt;/td&gt;
&lt;td&gt;Facilita la implementación de flujos OAuth 2.0 cuando una aplicación necesita autenticarse con una cuenta de usuario.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;google-cloud-storage&lt;/td&gt;
&lt;td&gt;Permite interactuar con Google Cloud Storage. Lo utilizaremos principalmente en la segunda parte de la serie para validar el bucket de almacenamiento utilizado durante el despliegue.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;python-dotenv&lt;/td&gt;
&lt;td&gt;Permite cargar las variables de configuración definidas en el archivo .env, como el modelo Gemini y los parámetros de conexión con Google Drive.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;python-docx&lt;/td&gt;
&lt;td&gt;Biblioteca utilizada para leer y extraer contenido de documentos Microsoft Word (.docx).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pypdf&lt;/td&gt;
&lt;td&gt;Permite extraer texto de archivos PDF que contienen texto seleccionable.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;streamlit&lt;/td&gt;
&lt;td&gt;Framework de Python con el que construiremos la interfaz web del asistente, incluyendo el chatbot y los indicadores de consumo.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pydantic&lt;/td&gt;
&lt;td&gt;Biblioteca para definir, validar y estructurar datos mediante modelos Python. También es utilizada por componentes del ecosistema Google ADK.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cloudpickle&lt;/td&gt;
&lt;td&gt;Permite serializar objetos Python, una capacidad útil para empaquetar y desplegar componentes del agente en entornos remotos.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;google-cloud-aiplatform[agent_engines,adk]&amp;gt;=1.112.0&lt;/td&gt;
&lt;td&gt;Instala el SDK de Vertex AI con dependencias adicionales para Agent Runtime y Google ADK. Lo utilizaremos en la segunda parte para desplegar y probar el agente en Google Cloud.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Como podemos observar, algunas dependencias están orientadas al desarrollo local de nuestro asistente, mientras que otras serán necesarias posteriormente para su despliegue en Google Cloud.&lt;/p&gt;

&lt;p&gt;Aunque en este ejercicio utilizaremos un único archivo requirements.txt para simplificar la instalación, en proyectos empresariales es habitual separar las dependencias de desarrollo, pruebas y despliegue. También se recomienda fijar versiones específicas una vez validado el funcionamiento de la solución, para evitar cambios inesperados al actualizar bibliotecas.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Comprobar que las dependencias se instalaron correctamente&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Una vez finalizada la instalación, podemos comprobar que no existan conflictos entre las dependencias mediante:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Si todo está correcto, deberíamos obtener un mensaje similar a:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;No broken requirements found.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;También podemos verificar que Google ADK y Streamlit estén disponibles:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;show&lt;/span&gt; &lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;adk&lt;/span&gt; &lt;span class="n"&gt;streamlit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este comando mostrará información sobre las bibliotecas instaladas, como su versión y ubicación dentro del entorno virtual.&lt;/p&gt;

&lt;p&gt;Finalmente, es recomendable seleccionar el intérprete del entorno virtual en Visual Studio Code. Para ello, utilizamos &lt;strong&gt;Ctrl + Shift + P&lt;/strong&gt;, buscamos &lt;strong&gt;Python: Select Interpreter&lt;/strong&gt; y seleccionamos el intérprete que se encuentra dentro de .venv.&lt;/p&gt;

&lt;p&gt;Con esto tendremos preparado nuestro entorno de desarrollo para comenzar a implementar el &lt;strong&gt;Asistente de Políticas Corporativas&lt;/strong&gt; con &lt;strong&gt;Google ADK, Gemini y Streamlit&lt;/strong&gt;. En los siguientes apartados configuraremos las credenciales necesarias y estableceremos la conexión con Google Drive, que será nuestra fuente de conocimiento para las consultas del agente.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuración del entorno y variables de la aplicación
&lt;/h2&gt;

&lt;p&gt;Una vez preparado nuestro entorno virtual e instaladas las dependencias de Python, el siguiente paso será configurar las variables que necesita la aplicación para conectarse a los diferentes servicios de Google y definir algunos parámetros de funcionamiento del agente.&lt;/p&gt;

&lt;p&gt;Para ello utilizaremos un archivo llamado &lt;strong&gt;.env&lt;/strong&gt;, ubicado en la raíz del proyecto. Este archivo nos permite centralizar información como las credenciales de acceso, el modelo Gemini que utilizaremos, la ubicación de los documentos en Google Drive y los parámetros de recuperación de información del agente.&lt;/p&gt;

&lt;p&gt;Una de sus principales ventajas es que podemos modificar estas configuraciones sin necesidad de cambiar directamente el código Python. Además, nos permite mantener separados los datos sensibles de la lógica de la aplicación, facilitando su mantenimiento y configuración en diferentes entornos.&lt;/p&gt;

&lt;p&gt;En nuestro proyecto utilizaremos la biblioteca python-dotenv, instalada previamente, para cargar estas variables desde Python.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nota de seguridad:&lt;/strong&gt; En esta demostración utilizaremos algunas credenciales, como la API Key de Gemini y el archivo JSON de una cuenta de servicio, configuradas localmente para simplificar el desarrollo y facilitar la comprensión del ejercicio. Sin embargo, no es una buena práctica incluir claves, contraseñas o secretos directamente en el código fuente &lt;strong&gt;(&lt;em&gt;hardcoding&lt;/em&gt;)&lt;/strong&gt;, ni almacenarlos en repositorios públicos.&lt;/p&gt;

&lt;p&gt;En un entorno empresarial o de producción, se recomienda utilizar soluciones especializadas de gestión de secretos, como &lt;strong&gt;Google Cloud Secret Manager&lt;/strong&gt; o &lt;strong&gt;HashiCorp Vault&lt;/strong&gt;, que permitan almacenar las credenciales de forma segura, controlar su acceso y gestionar su ciclo de vida, incluyendo la generación, rotación y revocación. Siempre que sea posible, también es preferible utilizar identidades administradas y credenciales temporales en lugar de claves estáticas.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;La configuración presentada en este artículo tiene fines exclusivamente educativos y de demostración&lt;/strong&gt;, por lo que debe adaptarse a las políticas y los requisitos de seguridad de cada organización antes de utilizarse en un entorno productivo.&lt;/p&gt;

&lt;p&gt;Como podemos observar, hemos dividido el archivo en cuatro grupos para facilitar su comprensión y administración.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Configuración de Gemini&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;En este primer bloque definimos cómo se conectará nuestro agente con Gemini y qué modelo utilizaremos para procesar las consultas.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GOOGLE_API_KEY&lt;/td&gt;
&lt;td&gt;Clave de acceso a Gemini API, generada desde Google AI Studio. Debemos reemplazar &lt;strong&gt;YOUR_GEMINI_API_KEY&lt;/strong&gt; por nuestra API Key.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GOOGLE_GENAI_USE_VERTEXAI&lt;/td&gt;
&lt;td&gt;Indica si utilizaremos Gemini API (FALSE) o Vertex AI (TRUE). Para esta primera implementación local mantendremos FALSE.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GEMINI_MODEL&lt;/td&gt;
&lt;td&gt;Define el modelo Gemini que utilizará nuestro agente. En este ejemplo configuramos &lt;strong&gt;gemini-3.5-flash-lite&lt;/strong&gt;, siempre que esté disponible para nuestro proyecto.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GEMINI_VERTEX_LOCATION&lt;/td&gt;
&lt;td&gt;Establece la ubicación del endpoint de inferencia cuando utilizamos Vertex AI. Mantendremos global, que utilizaremos en la segunda parte del ejercicio.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Configuración de Google Drive&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;En este bloque configuramos el acceso a Google Drive, donde estarán almacenados los documentos que utilizará nuestro agente como base de conocimiento.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;DRIVE_AUTH_MODE&lt;/td&gt;
&lt;td&gt;Define el mecanismo de autenticación utilizado para acceder a Google Drive. Para nuestra aplicación local utilizaremos service_account_file, que permite autenticarnos mediante un archivo JSON de una cuenta de servicio.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DRIVE_SERVICE_ACCOUNT_FILE&lt;/td&gt;
&lt;td&gt;Indica la ubicación del archivo JSON que contiene las credenciales de la cuenta de servicio. Debemos comprobar que exista en la ruta &lt;strong&gt;credentials/service-account.json.&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GOOGLE_DRIVE_FOLDER_ID&lt;/td&gt;
&lt;td&gt;Identificador de la carpeta de Google Drive donde almacenaremos las políticas corporativas. Debemos reemplazar &lt;strong&gt;YOUR_DRIVE_FOLDER_ID&lt;/strong&gt; por el identificador real de nuestra carpeta.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Por ejemplo, si tenemos una carpeta de Google Drive con una dirección similar a:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://drive.google.com/drive/folders/1ABCdefGhijKlmNopQRstUv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;El identificador que debemos configurar corresponde a la última parte de la dirección:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GOOGLE_DRIVE_FOLDER_ID=XXXxxxXXXxxxXXXXxxx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;También debemos asegurarnos de que la carpeta esté compartida con la cuenta de servicio utilizada por nuestra aplicación, con los permisos necesarios para consultar los documentos.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Configuración de Google Cloud Agent Runtime&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Aunque inicialmente ejecutaremos el agente de forma local con Streamlit, dejaremos preparadas algunas variables que utilizaremos en la segunda parte de esta serie, cuando despleguemos el agente en Google Cloud Agent Runtime y lo integremos con Gemini Enterprise.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GOOGLE_CLOUD_PROJECT&lt;/td&gt;
&lt;td&gt;Identificador del proyecto de Google Cloud. Reemplazaremos &lt;strong&gt;YOUR_PROJECT_ID&lt;/strong&gt; por el ID real de nuestro proyecto.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AGENT_RUNTIME_LOCATION&lt;/td&gt;
&lt;td&gt;Región de Google Cloud donde desplegaremos el agente. En este ejemplo utilizaremos europe-west1.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AGENT_RUNTIME_STAGING_BUCKET&lt;/td&gt;
&lt;td&gt;Bucket de Google Cloud Storage utilizado durante el despliegue para almacenar temporalmente los archivos necesarios. Debemos reemplazar &lt;strong&gt;YOUR_STAGING_BUCKET&lt;/strong&gt; por el nombre del bucket creado.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AGENT_RUNTIME_SERVICE_ACCOUNT&lt;/td&gt;
&lt;td&gt;Cuenta de servicio que utilizará el agente cuando se ejecute en Google Cloud. Debemos reemplazar el correo de ejemplo por el de la cuenta configurada para Agent Runtime.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Estas variables no son necesarias para comenzar a utilizar Streamlit con Gemini API, pero nos permitirán reutilizar el mismo proyecto cuando avancemos hacia su publicación en Gemini Enterprise.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Configuración de RAG y límites de procesamiento&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;En este último bloque definimos algunos parámetros que controlan cómo se recupera la información de los documentos, la cantidad de contenido que se procesa y el tiempo máximo de ejecución de las consultas.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;th&gt;Valor del ejemplo&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;RAG_TOP_K&lt;/td&gt;
&lt;td&gt;Cantidad máxima de fragmentos relevantes que recuperará el agente por consulta.&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RAG_MAX_FRAGMENT_CHARS&lt;/td&gt;
&lt;td&gt;Número máximo de caracteres que se enviarán al modelo por cada fragmento recuperado.&lt;/td&gt;
&lt;td&gt;900&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RAG_REFRESH_INTERVAL_SECONDS&lt;/td&gt;
&lt;td&gt;Intervalo de actualización automática del índice RAG, expresado en segundos. Se utiliza cuando el agente administra su propia caché, como en Agent Runtime.&lt;/td&gt;
&lt;td&gt;300 (5 minutos)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MAX_DRIVE_FILES&lt;/td&gt;
&lt;td&gt;Número máximo de archivos de Google Drive que se procesarán durante la indexación.&lt;/td&gt;
&lt;td&gt;250&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MAX_FILE_BYTES&lt;/td&gt;
&lt;td&gt;Tamaño máximo permitido por archivo, expresado en bytes.&lt;/td&gt;
&lt;td&gt;10000000 (10 MB decimales)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MAX_DOCUMENT_CHARS&lt;/td&gt;
&lt;td&gt;Número máximo de caracteres que se extraerán y procesarán de cada documento.&lt;/td&gt;
&lt;td&gt;150000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AGENT_TIMEOUT_SECONDS&lt;/td&gt;
&lt;td&gt;Tiempo máximo de espera para completar una consulta desde la aplicación Streamlit.&lt;/td&gt;
&lt;td&gt;180 segundos&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Estos valores son adecuados como punto de partida para nuestro laboratorio y pueden ajustarse según el tamaño de los documentos, la cantidad de políticas y el comportamiento esperado de la aplicación.&lt;/p&gt;

&lt;p&gt;En el caso de &lt;strong&gt;Streamlit&lt;/strong&gt;, mantendremos un botón para actualizar manualmente el índice de documentos. Para Agent Runtime, utilizaremos el intervalo de actualización configurado en &lt;strong&gt;RAG_REFRESH_INTERVAL_SECONDS&lt;/strong&gt;, que se comprobará cuando el agente vuelva a consultar su herramienta de búsqueda.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Configuración de costes estimados de Gemini&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Finalmente, incorporamos dos variables opcionales que utilizaremos para calcular una estimación del consumo económico de las consultas desde el dashboard de Streamlit.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GEMINI_INPUT_USD_PER_1M&lt;/td&gt;
&lt;td&gt;Precio de referencia en dólares por cada millón de tokens de entrada.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GEMINI_OUTPUT_USD_PER_1M&lt;/td&gt;
&lt;td&gt;Precio de referencia en dólares por cada millón de tokens de salida.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Estos valores permiten mostrar una estimación del coste de las interacciones con el modelo, pero &lt;strong&gt;no representan la facturación real&lt;/strong&gt; de Google. Las tarifas pueden cambiar dependiendo del modelo, la modalidad de servicio y las condiciones comerciales aplicables, por lo que conviene revisar los precios oficiales antes de utilizarlos.&lt;/p&gt;

&lt;h2&gt;
  
  
  Crear la API Key de Gemini
&lt;/h2&gt;

&lt;p&gt;Para que nuestro agente pueda utilizar los modelos de Gemini, necesitaremos generar una &lt;strong&gt;API Key desde Google AI Studio&lt;/strong&gt;. Para ello, accedemos a &lt;a href="https://aistudio.google.com/api-keys" rel="noopener noreferrer"&gt;Google AI Studio&lt;/a&gt; e iniciamos sesión con nuestra cuenta de Google.&lt;/p&gt;

&lt;p&gt;Una vez dentro, nos dirigimos a la sección &lt;strong&gt;API Keys&lt;/strong&gt;, seleccionamos la opción para crear una nueva clave y elegimos el proyecto de Google Cloud al que queremos asociarla. Si todavía no contamos con un proyecto disponible, podremos crear uno o importar uno existente, según las opciones habilitadas en nuestra cuenta.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftj6thm619osb1a8ei57q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftj6thm619osb1a8ei57q.png" alt="API Keys en Google AI Studio" width="800" height="636"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fttmzpu6xmc51wjbcn0jt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fttmzpu6xmc51wjbcn0jt.png" alt="Crear clave de Gemini" width="504" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Una vez generada la clave, la copiamos y comprobamos que el proyecto disponga de la cuota o facturación necesaria para utilizar el modelo Gemini seleccionado.&lt;/p&gt;

&lt;p&gt;Con nuestra API Key disponible, abrimos el archivo &lt;strong&gt;.env&lt;/strong&gt; ubicado en la raíz del proyecto y reemplazamos el valor de ejemplo &lt;strong&gt;YOUR_GEMINI_API_KEY&lt;/strong&gt; en la variable &lt;strong&gt;GOOGLE_API_KEY&lt;/strong&gt; por la clave obtenida desde Google AI Studio.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuración de Google Drive y autenticación mediante una cuenta de servicio
&lt;/h2&gt;

&lt;p&gt;Para que nuestro Asistente de Políticas Corporativas pueda consultar los documentos almacenados en Google Drive, necesitamos configurar un mecanismo de autenticación que permita a la aplicación acceder a los archivos de forma segura.&lt;/p&gt;

&lt;p&gt;En este ejercicio utilizaremos una &lt;strong&gt;cuenta de servicio (Service Account)&lt;/strong&gt; de &lt;strong&gt;Google Cloud&lt;/strong&gt;, que representa una identidad utilizada por aplicaciones y servicios, en lugar de una cuenta de usuario convencional. De esta manera, nuestro agente podrá conectarse a Google Drive y recuperar las políticas corporativas sin que el usuario tenga que autenticarse manualmente cada vez que realice una consulta.&lt;/p&gt;

&lt;p&gt;Para la demostración crearemos una cuenta de servicio específica, le concederemos acceso de lectura a la carpeta donde se encuentran los documentos y descargaremos un archivo JSON con sus credenciales, que utilizaremos desde nuestra aplicación Python.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Habilitar la API de Google Drive&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Lo primero será habilitar la API que permitirá a nuestra aplicación consultar los documentos almacenados en Google Drive.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Accedemos a &lt;a href="https://console.cloud.google.com/" rel="noopener noreferrer"&gt;Google Cloud Console&lt;/a&gt; e iniciamos sesión.&lt;/li&gt;
&lt;li&gt; Seleccionamos el proyecto de Google Cloud que utilizaremos para el ejercicio.&lt;/li&gt;
&lt;li&gt; En el menú lateral, nos dirigimos a &lt;strong&gt;APIs y servicios → Biblioteca&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt; Buscamos &lt;strong&gt;Google Drive API&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt; Seleccionamos la API y hacemos clic en &lt;strong&gt;Habilitar (Enable)&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;También podemos habilitarla desde PowerShell, utilizando Google Cloud CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;services&lt;/span&gt; &lt;span class="n"&gt;enable&lt;/span&gt; &lt;span class="n"&gt;drive&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;googleapis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;YOUR_PROJECT_ID&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Debemos reemplazar &lt;strong&gt;YOUR_PROJECT_ID&lt;/strong&gt; por el identificador real de nuestro proyecto de Google Cloud.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Crear la cuenta de servicio&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Una vez habilitada la API, crearemos la identidad que utilizará nuestro agente para acceder a los documentos.&lt;/p&gt;

&lt;p&gt;Desde Google Cloud Console, seguimos estos pasos:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Accedemos a &lt;strong&gt;IAM y administración → Cuentas de servicio (Service Accounts)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Hacemos clic en &lt;strong&gt;Crear cuenta de servicio (Create Service Account)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Introducimos los siguientes valores de ejemplo:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Campo&lt;/th&gt;
&lt;th&gt;Valor sugerido&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Nombre&lt;/td&gt;
&lt;td&gt;Corporate Policies Drive Reader&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ID de cuenta de servicio&lt;/td&gt;
&lt;td&gt;drive-agent-reader&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Descripción&lt;/td&gt;
&lt;td&gt;Cuenta de servicio para consultar políticas corporativas almacenadas en Google Drive&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;El correo electrónico de la cuenta tendrá una estructura similar a:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;drive-agent-reader@YOUR_PROJECT_ID.iam.gserviceaccount.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Seleccionamos &lt;strong&gt;Crear y continuar (Create and Continue)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;En la asignación de roles del proyecto, podemos continuar sin añadir permisos IAM generales.&lt;/li&gt;
&lt;li&gt;Finalizamos seleccionando &lt;strong&gt;Listo (Done)&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Para este caso, no necesitamos asignar roles como Editor o Owner, ya que nuestro agente únicamente necesita consultar los documentos de una carpeta específica de Google Drive. El acceso a esos archivos se gestionará directamente desde los permisos de uso compartido de Drive.&lt;/p&gt;

&lt;p&gt;Google Cloud permite crear cuentas de servicio sin asignarles inicialmente roles IAM sobre el proyecto.&lt;/p&gt;

&lt;p&gt;También podemos crear la cuenta mediante PowerShell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;gcloud&lt;/span&gt; &lt;span class="n"&gt;iam&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;accounts&lt;/span&gt; &lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="n"&gt;drive&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;reader&lt;/span&gt; &lt;span class="sb"&gt;`
--display-name="Corporate Policies Drive Reader" `&lt;/span&gt;
&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Read corporate policy documents from Google Drive"&lt;/span&gt; &lt;span class="sb"&gt;`
--project=YOUR_PROJECT_ID
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;Configurar los permisos de acceso a Google Drive&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Después de crear la cuenta de servicio, debemos autorizarla para que pueda consultar la carpeta donde almacenaremos las políticas corporativas.&lt;/p&gt;

&lt;p&gt;En nuestro ejemplo, tendremos una carpeta principal de Google Drive con los documentos de Recursos Humanos, Finanzas, Tecnología, Seguridad, Legal, Compras, Operaciones y Sostenibilidad.&lt;/p&gt;

&lt;p&gt;Para conceder acceso:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Abrimos &lt;a href="https://drive.google.com/" rel="noopener noreferrer"&gt;Google Drive&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt; Localizamos la carpeta principal que contiene las políticas corporativas.&lt;/li&gt;
&lt;li&gt; Hacemos clic derecho sobre ella y seleccionamos &lt;strong&gt;Compartir (Share)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt; Introducimos el correo electrónico de la cuenta de servicio creada anteriormente.&lt;/li&gt;
&lt;li&gt; Seleccionamos el permiso &lt;strong&gt;Lector (Viewer)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt; Confirmamos la configuración de uso compartido.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Por ejemplo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cuenta:
drive-agent-reader@YOUR_PROJECT_ID.iam.gserviceaccount.com
Permiso:
Lector (Viewer)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp5h5g2v7c6gra3yac0nw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp5h5g2v7c6gra3yac0nw.png" alt="Permisos de Google Drive para la cuenta de servicio" width="515" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Con este permiso, la cuenta podrá consultar los documentos disponibles dentro de la carpeta y sus subcarpetas, siempre que los permisos se hereden correctamente y no existan restricciones adicionales. &lt;strong&gt;No es necesario conceder permisos de edición&lt;/strong&gt;, ya que nuestro agente únicamente leerá información para responder preguntas.&lt;/p&gt;

&lt;p&gt;Google Workspace permite compartir directamente archivos y carpetas con una cuenta de servicio mediante su dirección de correo electrónico, sin necesidad de concederle privilegios administrativos.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Generar el archivo de credenciales service-account.json&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Una vez creada y autorizada la cuenta de servicio, necesitaremos obtener las credenciales que utilizará nuestra aplicación Python para autenticarse desde el entorno local.&lt;/p&gt;

&lt;p&gt;Para ello, regresamos a Google Cloud Console y seguimos estos pasos:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Accedemos a &lt;strong&gt;IAM y administración → Cuentas de servicio&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt; Seleccionamos la cuenta de servicio &lt;strong&gt;drive-agent-reader&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt; Abrimos la pestaña &lt;strong&gt;Claves (Keys)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt; Hacemos clic en &lt;strong&gt;Agregar clave → Crear clave nueva (Add Key → Create New Key)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt; Seleccionamos el formato &lt;strong&gt;JSON&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt; Hacemos clic en &lt;strong&gt;Crear (Create)&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Google Cloud descargará automáticamente un archivo JSON con las credenciales de la cuenta de servicio. Renombraremos el archivo descargado como: &lt;strong&gt;service-account.json&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Este archivo contiene información como el identificador del proyecto, el correo electrónico de la cuenta de servicio y una clave privada utilizada durante la autenticación. Por esta razón, debemos tratarlo como una credencial sensible.&lt;/p&gt;

&lt;p&gt;Y lo guardaremos dentro de la carpeta &lt;strong&gt;credentials&lt;/strong&gt; de nuestro proyecto:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Corporate Policies Agent/
├── corporate_agent/
├── corporate_policies/
├── credentials/
│ └── service-account.json
├── app.py
├── .env
└── requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;Configurar las credenciales en el archivo .env&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Con el archivo JSON almacenado en la carpeta &lt;strong&gt;credentials&lt;/strong&gt;, configuraremos las variables de entorno que utilizará nuestra aplicación para conectarse a Google Drive.&lt;/p&gt;

&lt;p&gt;Abrimos el archivo .env y completamos el bloque correspondiente:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 2. LOCAL GOOGLE DRIVE AUTHENTICATION
# ============================================================
DRIVE_AUTH_MODE=service_account_file
DRIVE_SERVICE_ACCOUNT_FILE=credentials/service-account.json
GOOGLE_DRIVE_FOLDER_ID=YOUR_DRIVE_FOLDER_ID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;Verificar la conexión con Google Drive&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Antes de continuar con la implementación del agente, es recomendable comprobar que las credenciales funcionan y que tenemos acceso a los documentos.&lt;/p&gt;

&lt;p&gt;Nuestro proyecto incluye un archivo de pruebas llamado &lt;strong&gt;test_drive.py&lt;/strong&gt;, ubicado en la carpeta test, que permite validar esta conexión.&lt;/p&gt;

&lt;p&gt;Desde la terminal PowerShell de Visual Studio Code, con el entorno virtual activado, ejecutamos:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;sources_en&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;test_drive&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Esta prueba nos permitirá comprobar que la aplicación puede autenticarse y acceder a Google Drive. El resultado exacto dependerá de las verificaciones implementadas en el script.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OUTPUT
Google Drive connection successful
📁 Root folder: Corporate Policies
🆔 ID: YOUR_DRIVE_FOLDER_ID
📚 Files found:
-----------------------------------------------------------------
-----------------------------------------------------------------
✅ Total files found: 0
(.venv) PS C:\Projects\Corporate Policies Agent&amp;gt; python -m test.test_drive
✅ Google Drive connection successful
📁 Root folder: Corporate Policies
🆔 ID: YOUR_DRIVE_FOLDER_ID
📚 Files found:
-----------------------------------------------------------------
📄 en_legal_policies.txt
📄 en_it_policies.txt
📄 en_human_resources_policies.txt
📄 en_finance_policies.txt
-----------------------------------------------------------------
✅ Total files found: 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Si aparece un error 403 Forbidden, deberemos revisar los permisos de la cuenta de servicio sobre la carpeta, la configuración de la API o los permisos del proyecto. Si aparece un error 404 Not Found, comprobaremos que el identificador de la carpeta sea correcto y que la cuenta tenga acceso a ella.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Consideraciones de seguridad&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Para esta demostración estamos utilizando un archivo JSON de cuenta de servicio porque facilita la configuración de nuestro entorno local y permite comprender cómo se realiza la autenticación entre Python y Google Drive. Sin embargo, las claves JSON son credenciales de larga duración y no se recomiendan como mecanismo habitual para aplicaciones empresariales o entornos de producción.&lt;/p&gt;

&lt;p&gt;En una implementación productiva es preferible utilizar identidades administradas, credenciales temporales y mecanismos de autenticación que eviten almacenar claves privadas en archivos locales. Google Cloud recomienda limitar el uso de claves exportables de cuentas de servicio y aplicar controles adecuados sobre su ciclo de vida.&lt;/p&gt;

&lt;p&gt;Con esta configuración tendremos preparada la conexión entre nuestra aplicación y Google Drive, que funcionará como repositorio de conocimiento para el Asistente de Políticas Corporativas.&lt;/p&gt;

&lt;p&gt;En los siguientes apartados utilizaremos estas credenciales para implementar la lectura de documentos, su fragmentación e indexación y la herramienta de búsqueda que nuestro agente ejecutará mediante Google ADK.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementación del sistema RAG para la consulta de documentos
&lt;/h2&gt;

&lt;p&gt;Ahora que tenemos configurado el acceso a Google Drive, vamos a implementar el componente encargado de recuperar la información que utilizará nuestro agente para responder las preguntas de los usuarios.&lt;/p&gt;

&lt;p&gt;Para ello, utilizaremos una estrategia &lt;strong&gt;RAG (Retrieval-Augmented Generation)&lt;/strong&gt;, que permite complementar las respuestas de Gemini con información obtenida de nuestros documentos corporativos.&lt;/p&gt;

&lt;p&gt;En esta primera implementación construiremos un &lt;strong&gt;RAG léxico en memoria&lt;/strong&gt;, sin utilizar una base de datos vectorial. El proceso consiste en consultar los documentos de Google Drive, extraer su contenido, dividirlo en fragmentos y construir un índice que permita localizar la información más relevante para cada pregunta.&lt;/p&gt;

&lt;p&gt;Toda esta lógica estará implementada en el archivo &lt;strong&gt;corporate_agent/drive_rag.py&lt;/strong&gt;, que hemos organizado en seis bloques principales.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Configuración de Google Drive y tipos MIME&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 1. CONFIGURACIÓN DE GOOGLE DRIVE Y TIPOS MIME
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;En este primer bloque definimos las configuraciones generales para trabajar con Google Drive, incluyendo el permiso de lectura (drive.readonly) y los formatos de archivo que podrá procesar nuestra aplicación.&lt;/p&gt;

&lt;p&gt;Se admiten documentos de Google Docs, archivos TXT, Markdown, PDF y Word (DOCX). También se define una lista de palabras frecuentes (&lt;em&gt;stopwords&lt;/em&gt;) que se excluirán durante las búsquedas para mejorar la relevancia de los resultados.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Tokenización y segmentación de texto&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 2. TOKENIZACIÓN Y SEGMENTACIÓN DE TEXTO
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este bloque prepara el contenido de los documentos para su posterior indexación y búsqueda. Contiene dos funciones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;words()&lt;/strong&gt;: convierte el texto en palabras, normaliza su escritura y elimina términos frecuentes que aportan poco valor a la búsqueda.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;split_chunks()&lt;/strong&gt;: divide los documentos en fragmentos más pequeños, manteniendo cierto solapamiento entre ellos para evitar perder información relevante al separar el contenido.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;La fragmentación permite recuperar únicamente las secciones relacionadas con una pregunta, en lugar de enviar documentos completos al modelo Gemini.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Descarga y conexión con Google Drive&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 3. DESCARGA Y CONEXIÓN CON DRIVE
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;En este apartado implementamos la conexión con Google Drive y la descarga de los documentos:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;get_drive_service()&lt;/strong&gt;: establece la conexión utilizando las credenciales configuradas en .env. Admite tanto el archivo JSON de la cuenta de servicio para el entorno local como la autenticación ADC que utilizaremos posteriormente en Agent Runtime.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;download_bytes()&lt;/strong&gt;: descarga los archivos por partes y comprueba que no superen el tamaño máximo permitido.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;De esta manera, centralizamos el acceso a Google Drive y controlamos la cantidad de información que puede descargar nuestra aplicación.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Recorrido de carpetas y paginación&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 4. RECORRIDO DE CARPETAS Y PAGINACIÓN
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;La función &lt;strong&gt;list_files()&lt;/strong&gt; se encarga de localizar los documentos disponibles dentro de la carpeta de Google Drive configurada en nuestro proyecto.&lt;/p&gt;

&lt;p&gt;También recorre sus subcarpetas, utiliza paginación para consultar los resultados y selecciona únicamente los formatos admitidos, respetando el límite de archivos establecido mediante MAX_DRIVE_FILES.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Extracción de texto por formato&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 5. EXTRACCIÓN DE TEXTO POR FORMATO
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Una vez identificados los documentos, necesitamos obtener su contenido en un formato que podamos procesar.&lt;/p&gt;

&lt;p&gt;La función &lt;strong&gt;extract_text()&lt;/strong&gt; realiza esta tarea según el tipo de archivo: exporta Google Docs como texto, utiliza pypdf para los PDF, python-docx para documentos Word y decodifica directamente los archivos TXT y Markdown.&lt;/p&gt;

&lt;p&gt;Es importante tener en cuenta que, en esta versión, los PDF escaneados que solo contienen imágenes no podrán procesarse correctamente, ya que necesitaríamos incorporar un mecanismo adicional de OCR.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Modelo de fragmentos e índice RAG&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 6. MODELO DE FRAGMENTOS E ÍNDICE RAG
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este último bloque contiene la lógica principal de indexación y recuperación de información.&lt;/p&gt;

&lt;p&gt;La clase &lt;strong&gt;Chunk&lt;/strong&gt; representa cada fragmento de texto y conserva información como el nombre del documento, su enlace en Google Drive y las palabras que contiene.&lt;/p&gt;

&lt;p&gt;Por otra parte, la clase &lt;strong&gt;DriveKnowledgeBase&lt;/strong&gt; administra nuestra base de conocimiento mediante tres métodos principales:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;__init__()&lt;/strong&gt;: inicializa las estructuras donde se almacenarán los fragmentos, las estadísticas y las advertencias.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;refresh()&lt;/strong&gt;: consulta los documentos de Google Drive, extrae su contenido y reconstruye el índice RAG en memoria.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;search()&lt;/strong&gt;: recibe la pregunta del usuario, identifica los fragmentos más relevantes mediante una puntuación léxica basada en TF-IDF y devuelve los resultados junto con sus fuentes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Los fragmentos recuperados serán utilizados posteriormente por el agente desarrollado con Google ADK, que los proporcionará a &lt;strong&gt;Gemini&lt;/strong&gt; como contexto para generar una respuesta fundamentada.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Consideraciones importantes&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Aunque esta implementación es suficiente para comprender el funcionamiento de RAG e integrarlo con nuestro agente, debemos tener presentes algunas características:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Indexación en memoria:&lt;/strong&gt; los documentos procesados no se almacenan en una base de datos persistente. Por tanto, será necesario reconstruir el índice cuando corresponda.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Búsqueda léxica:&lt;/strong&gt; la recuperación se basa en coincidencias de palabras y no en similitud semántica. Esto significa que algunas preguntas formuladas con sinónimos podrían no recuperar los fragmentos esperados.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Límites de procesamiento:&lt;/strong&gt; podemos controlar el número de documentos, su tamaño y la cantidad de fragmentos recuperados mediante las variables configuradas en .env.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Seguridad documental:&lt;/strong&gt; la aplicación puede consultar los documentos accesibles para su cuenta de servicio. Es importante utilizar una carpeta autorizada y evitar incluir información que no deba estar disponible para los usuarios del agente.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Para nuestro ejemplo, este enfoque nos permitirá comprender el proceso completo de recuperación de información sin añadir la complejidad de una base de datos vectorial o servicios adicionales.&lt;/p&gt;

&lt;p&gt;Con el archivo &lt;strong&gt;drive_rag.py&lt;/strong&gt; preparado, ya tendremos el componente encargado de consultar nuestra base de conocimiento. El siguiente paso será crear el agente con Google ADK e integrar esta funcionalidad mediante una herramienta que Gemini pueda utilizar durante la conversación.&lt;/p&gt;

&lt;h2&gt;
  
  
  Desarrollo y configuración del agente de IA con Google ADK
&lt;/h2&gt;

&lt;p&gt;Una vez implementado nuestro sistema RAG, el siguiente paso será desarrollar el agente encargado de interpretar las preguntas de los usuarios, consultar las políticas corporativas y generar respuestas utilizando Gemini.&lt;/p&gt;

&lt;p&gt;Para ello, utilizaremos &lt;strong&gt;Google Agent Development Kit (ADK)&lt;/strong&gt;, que nos permite definir el comportamiento del agente, integrar herramientas y gestionar la interacción con el modelo de lenguaje.&lt;/p&gt;

&lt;p&gt;Toda esta lógica estará implementada en el archivo &lt;strong&gt;corporate_agent/agent.py&lt;/strong&gt;, organizado en cinco bloques principales.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Configuración del proyecto&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 1. CONFIGURACIÓN DEL PROYECTO
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;En este primer bloque cargamos las variables de entorno definidas en .env y configuramos el modelo Gemini y los parámetros que utilizará nuestro agente.&lt;/p&gt;

&lt;p&gt;La función &lt;strong&gt;create_agent_model()&lt;/strong&gt; permite seleccionar el mecanismo de conexión con Gemini según el entorno de ejecución: mediante una API Key para nuestra aplicación local o utilizando Vertex AI cuando despleguemos el agente en Google Cloud.&lt;/p&gt;

&lt;p&gt;También configuramos parámetros como &lt;strong&gt;RAG_TOP_K&lt;/strong&gt;, que establece la cantidad máxima de fragmentos recuperados, y &lt;strong&gt;RAG_REFRESH_INTERVAL_SECONDS&lt;/strong&gt;, que determina el intervalo de actualización del índice administrado por Agent Runtime.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Base de conocimiento&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 2. BASE DE CONOCIMIENTO
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este bloque administra el índice RAG que implementamos anteriormente en &lt;strong&gt;drive_rag.py&lt;/strong&gt;, permitiendo reutilizar la información recuperada sin tener que consultar Google Drive continuamente.&lt;/p&gt;

&lt;p&gt;Contiene tres funciones principales:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;set_knowledge_base()&lt;/strong&gt;: permite que nuestra aplicación Streamlit proporcione al agente un índice RAG previamente cargado y administrado desde su propia interfaz.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;_cache_is_current()&lt;/strong&gt;: comprueba si el índice almacenado en memoria sigue siendo válido o necesita actualizarse.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;get_knowledge_base()&lt;/strong&gt;: obtiene el índice disponible y cuando corresponde, vuelve a consultar los documentos de Google Drive para reconstruirlo.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;De esta manera, evitamos descargas innecesarias y mejoramos los tiempos de respuesta. En Streamlit la actualización se controla manualmente, mientras que en Agent Runtime puede realizarse automáticamente cuando llega una consulta y ha vencido el intervalo configurado.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Herramienta RAG para Google ADK&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 3. HERRAMIENTA RAG PARA GOOGLE ADK
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;En este apartado implementamos la función &lt;strong&gt;search_corporate_policies()&lt;/strong&gt;, que será la herramienta que nuestro agente utilizará para consultar la información corporativa.&lt;/p&gt;

&lt;p&gt;Cuando el usuario realiza una pregunta, esta función accede al índice RAG, recupera los fragmentos más relevantes y devuelve sus contenidos junto con el nombre y el enlace de los documentos originales.&lt;/p&gt;

&lt;p&gt;También incorpora un mecanismo de manejo de errores para identificar problemas de conexión, permisos o acceso a Google Drive, evitando exponer información sensible durante la ejecución.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Control de consulta documental por turno&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 4. CONTROL DE CONSULTA DOCUMENTAL POR TURNO
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este bloque incorpora la función &lt;strong&gt;enforce_search_per_turn()&lt;/strong&gt;, que utilizamos como un &lt;em&gt;callback&lt;/em&gt; de Google ADK para controlar cuándo debe ejecutarse la herramienta de búsqueda. Su objetivo es asegurar que el agente realice una nueva consulta documental cada vez que el usuario envíe una pregunta, evitando responder únicamente con información recuperada en conversaciones anteriores.&lt;/p&gt;

&lt;p&gt;Una vez ejecutada la función &lt;strong&gt;search_corporate_policies&lt;/strong&gt; y obtenidos sus resultados, el agente puede continuar con la generación de la respuesta mediante Gemini.&lt;/p&gt;

&lt;p&gt;Este comportamiento resulta especialmente útil cuando las políticas corporativas cambian y necesitamos consultar información actualizada.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Definición del agente con Google ADK&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 5. DEFINICIÓN DEL AGENTE CON GOOGLE ADK
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finalmente, definimos nuestro agente principal mediante &lt;strong&gt;root_agent = Agent()&lt;/strong&gt;, que representa el componente central de la solución.&lt;/p&gt;

&lt;p&gt;En esta configuración establecemos sus principales características:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;name&lt;/strong&gt;: identifica al agente como corporate_policies_assistant.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;model&lt;/strong&gt;: especifica el modelo Gemini que utilizará para interpretar las consultas y generar respuestas.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;description&lt;/strong&gt;: describe brevemente su propósito dentro de la organización.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;instruction&lt;/strong&gt;: contiene las instrucciones o prompt que determinan cómo debe comportarse el agente, incluyendo la consulta de documentos, la generación de respuestas fundamentadas y la incorporación de referencias.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;tools&lt;/strong&gt;: registra la función search_corporate_policies como herramienta disponible para el agente.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;before_model_callback&lt;/strong&gt;: incorpora el mecanismo que exige una nueva búsqueda documental al recibir una consulta del usuario.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Las instrucciones del agente son especialmente importantes, ya que establecen que las respuestas deben basarse en los documentos recuperados y que, cuando no exista información suficiente, el asistente debe indicarlo en lugar de inventar una respuesta. También limitan su comportamiento al ámbito de las políticas corporativas.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Consideraciones importantes&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Con esta implementación, nuestro agente integra &lt;strong&gt;Google ADK, Gemini y el sistema RAG&lt;/strong&gt; desarrollado anteriormente, permitiendo responder preguntas sobre las políticas almacenadas en Google Drive.&lt;/p&gt;

&lt;p&gt;Es importante tener en cuenta que la calidad de las respuestas dependerá de la información disponible en los documentos y de los fragmentos recuperados durante la búsqueda. Por esta razón, se han incorporado instrucciones para utilizar las fuentes documentales y evitar respuestas sin respaldo.&lt;/p&gt;

&lt;p&gt;Además, el diseño permite ejecutar el mismo agente tanto en nuestra aplicación local con &lt;strong&gt;Streamlit&lt;/strong&gt; como posteriormente en Google Cloud Agent Runtime, cambiando principalmente el mecanismo de autenticación y la configuración del modelo.&lt;/p&gt;

&lt;p&gt;Con nuestro agente definido, el siguiente paso será construir la interfaz web con &lt;strong&gt;Streamlit&lt;/strong&gt;, desde donde los usuarios podrán realizar preguntas, consultar las respuestas y visualizar información sobre los documentos y el consumo de tokens.&lt;/p&gt;

&lt;h2&gt;
  
  
  Desarrollo de la interfaz web del agente con Streamlit
&lt;/h2&gt;

&lt;p&gt;Una vez implementado nuestro agente con &lt;strong&gt;Google ADK&lt;/strong&gt; y su integración con el &lt;strong&gt;sistema RAG&lt;/strong&gt;, el siguiente paso será construir una interfaz web que permita a los usuarios interactuar con él de manera sencilla.&lt;/p&gt;

&lt;p&gt;Para ello utilizaremos &lt;strong&gt;Streamlit&lt;/strong&gt;, un framework de Python con el que podemos desarrollar aplicaciones web sin necesidad de trabajar directamente con HTML, JavaScript o frameworks frontend adicionales.&lt;/p&gt;

&lt;p&gt;Toda la lógica de nuestra interfaz estará implementada en el archivo &lt;strong&gt;app.py&lt;/strong&gt; que se encuentra en la raíz del proyecto y que se ha organizado en ocho bloques principales.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Variables de entorno y configuración del proyecto&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 1. VARIABLES DE ENTORNO Y CONFIGURACIÓN DEL PROYECTO
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;En este primer bloque cargamos las variables de entorno desde .env, importamos nuestro agente de Google ADK y configuramos los parámetros generales de Streamlit.&lt;/p&gt;

&lt;p&gt;También definimos el tiempo máximo de respuesta del agente y los precios de referencia que utilizaremos para calcular el consumo estimado de tokens.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Estilos visuales del dashboard&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 2. ESTILOS VISUALES DEL DASHBOARD (TEMA OSCURO)
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este apartado define la apariencia visual de la aplicación, incluyendo colores, tipografía, tarjetas y componentes del dashboard.&lt;/p&gt;

&lt;p&gt;La función &lt;strong&gt;render_dashboard_style()&lt;/strong&gt; aplica los estilos personalizados mediante CSS, mientras que &lt;strong&gt;get_kb()&lt;/strong&gt; carga y mantiene en memoria el índice RAG de los documentos disponibles en Google Drive.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Creación de sesiones y Runner de Google ADK&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 3. CREACIÓN DE SESIONES Y RUNNER DE GOOGLE ADK
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mediante la función &lt;strong&gt;init_runner()&lt;/strong&gt;, inicializamos los componentes que permiten ejecutar nuestro agente y mantener el contexto de las conversaciones.&lt;/p&gt;

&lt;p&gt;Para ello utilizamos Runner e InMemorySessionService de Google ADK, que se encargan de procesar las consultas y administrar las sesiones de conversación.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Medición de tokens, costes y ejecución del agente&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 4. MEDICIÓN DE TOKENS, COSTES Y EJECUCIÓN DEL AGENTE
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este bloque permite enviar las preguntas al agente, recibir sus respuestas y recopilar información sobre el consumo del modelo Gemini.&lt;/p&gt;

&lt;p&gt;Sus principales funciones son:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;new_usage_metrics()&lt;/strong&gt;: inicializa las métricas de consumo.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;collect_usage()&lt;/strong&gt;: recopila la información de tokens disponible en los eventos de Google ADK.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;calculate_estimated_cost()&lt;/strong&gt;: calcula el coste aproximado de las consultas.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;render_usage_metrics() y render_session_usage()&lt;/strong&gt;: muestran las métricas de una consulta y de la sesión.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ask_agent()&lt;/strong&gt;: envía la pregunta al agente y recupera la respuesta generada.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;También encontramos &lt;strong&gt;select_chat_page()&lt;/strong&gt;, que facilita la navegación hacia el chatbot.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Pie de página y datos de versión&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 5. PIE DE PÁGINA COMÚN Y DATOS DE VERSIÓN
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;La función &lt;strong&gt;render_footer()&lt;/strong&gt; incorpora un pie de página común que muestra información de la aplicación, los derechos de autor y su versión.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Página de introducción&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 6. PÁGINA DE INTRODUCCIÓN (DISEÑO DASHBOARD)
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;La función &lt;strong&gt;render_intro_page()&lt;/strong&gt; construye la pantalla de bienvenida de nuestra aplicación.&lt;/p&gt;

&lt;p&gt;En ella presentamos el objetivo del asistente, las tecnologías utilizadas y una breve explicación de cómo Google ADK, Gemini y Google Drive trabajan conjuntamente.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Página de chat, índice y herramientas de consulta&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 7. PÁGINA DE CHAT, ÍNDICE Y HERRAMIENTAS DE CONSULTA
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este bloque contiene la función &lt;strong&gt;render_chat_page()&lt;/strong&gt;, encargada de construir la interfaz principal del chatbot.&lt;/p&gt;

&lt;p&gt;Desde esta pantalla, los usuarios podrán realizar preguntas sobre las políticas corporativas, visualizar las respuestas y sus fuentes, consultar las métricas de consumo y actualizar manualmente los documentos indexados desde Google Drive.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Navegación principal y punto de entrada&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# ============================================================
# 8. NAVEGACIÓN PRINCIPAL Y PUNTO DE ENTRADA
# ============================================================
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finalmente, la función &lt;strong&gt;main()&lt;/strong&gt; controla la navegación entre las diferentes pantallas y coordina la ejecución de nuestra aplicación Streamlit. Este bloque también contiene el punto de entrada principal, desde donde se inicia la aplicación.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Configuración visual de Streamlit mediante config.toml&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Además de los estilos personalizados definidos en app.py, utilizaremos el archivo &lt;strong&gt;.streamlit/config.toml&lt;/strong&gt; para establecer la configuración general de nuestra aplicación Streamlit. Este archivo permite personalizar aspectos visuales como el tema, los colores principales, el fondo y la tipografía, manteniendo estas preferencias separadas del código Python. En nuestro proyecto utilizaremos una apariencia oscura (&lt;em&gt;Dark Mode&lt;/em&gt;), que complementaremos con los estilos CSS definidos en la función &lt;strong&gt;render_dashboard_style()&lt;/strong&gt;. De esta manera, podremos mantener una interfaz visual consistente y modificar su apariencia fácilmente sin afectar la lógica del agente ni su integración con Google ADK y Gemini.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Consideraciones finales&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Con la implementación de app.py, completamos la integración de los principales componentes de nuestra solución: &lt;strong&gt;Streamlit&lt;/strong&gt; como interfaz web*&lt;em&gt;, Google ADK&lt;/em&gt;* para ejecutar el agente*&lt;em&gt;, Gemini&lt;/em&gt;* para generar las respuestas y &lt;strong&gt;Google Drive&lt;/strong&gt; como repositorio documental.&lt;/p&gt;

&lt;p&gt;Además, incorporamos funcionalidades como la gestión de sesiones, la actualización manual del índice RAG y la visualización de métricas de consumo, que nos permitirán evaluar el comportamiento de nuestro asistente durante las pruebas.&lt;/p&gt;

&lt;p&gt;Con esto, ya tendremos los componentes necesarios para ejecutar el &lt;strong&gt;Asistente de Políticas Corporativas&lt;/strong&gt; en nuestro entorno local y comenzar a realizar las primeras consultas.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ejecución y pruebas del agente en entorno local
&lt;/h2&gt;

&lt;p&gt;Una vez desarrollados los componentes de nuestra solución, ya podemos poner en funcionamiento el &lt;strong&gt;Asistente de Políticas Corporativas&lt;/strong&gt; y comprobar su comportamiento.&lt;/p&gt;

&lt;p&gt;Para ello, realizaremos las pruebas de tres maneras: utilizando nuestra interfaz personalizada con &lt;strong&gt;Streamlit&lt;/strong&gt;, desde la interfaz de desarrollo &lt;strong&gt;ADK Web&lt;/strong&gt; y directamente desde la &lt;strong&gt;línea de comandos de Google ADK (CLI)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Ejecutar la aplicación con Streamlit&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Streamlit será nuestra interfaz principal, ya que permite interactuar con el agente mediante un chatbot y visualizar información adicional, como los documentos indexados y las métricas de consumo.&lt;/p&gt;

&lt;p&gt;Aunque ambas versiones se encuentran en el mismo repositorio, podemos ejecutarlas de forma independiente, utilizando el mismo entorno virtual de Python.&lt;/p&gt;

&lt;p&gt;Para iniciar la &lt;strong&gt;versión en inglés&lt;/strong&gt;, desde la raíz del proyecto ejecutamos:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;streamlit&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="n"&gt;sources_en&lt;/span&gt;\&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Para iniciar la &lt;strong&gt;versión en español&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="n"&gt;streamlit&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="n"&gt;sources_es&lt;/span&gt;\&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;También podemos ejecutar ambas aplicaciones simultáneamente, utilizando los puertos 8501 y 8502, respectivamente. Cada versión utilizará su propia configuración .env, sus instrucciones y los documentos de Google Drive que tenga configurados.&lt;/p&gt;

&lt;p&gt;Esta organización nos permitirá trabajar con dos versiones lingüísticas de una misma solución, manteniendo separados sus componentes y facilitando su evolución hacia &lt;strong&gt;Google Cloud Agent Runtime y Gemini Enterprise&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Una vez iniciado el servidor, abrimos la siguiente dirección en nuestro navegador: &lt;a href="http://localhost:8501" rel="noopener noreferrer"&gt;&lt;strong&gt;http://localhost:8501&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Desde la aplicación podremos realizar preguntas sobre las políticas corporativas, consultar las fuentes utilizadas y actualizar manualmente el índice de documentos almacenados en Google Drive.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fwiki-cloud.co%2Fwp-content%2Fuploads%2F2026%2F11%2Farticle_image_build_ai_agent_with_google_adk_05.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fwiki-cloud.co%2Fwp-content%2Fuploads%2F2026%2F11%2Farticle_image_build_ai_agent_with_google_adk_05.gif" alt="Interfaz del asistente en Streamlit" width="480" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Ejecutar el agente desde ADK Web&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Google ADK&lt;/strong&gt; incluye una interfaz web de desarrollo que permite interactuar directamente con nuestros agentes, revisar sus respuestas y observar la ejecución de sus herramientas. Desde la carpeta raíz del proyecto ejecutamos:&lt;/p&gt;

&lt;p&gt;Para iniciar la &lt;strong&gt;versión en inglés&lt;/strong&gt;, desde la raíz del proyecto ejecutamos:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;adk&lt;/span&gt; &lt;span class="n"&gt;web&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;8000&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="n"&gt;sources_en&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Para iniciar la &lt;strong&gt;versión en español&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;adk&lt;/span&gt; &lt;span class="n"&gt;web&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="mi"&gt;8001&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="n"&gt;sources_es&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Posteriormente, abrimos: &lt;a href="http://localhost:8000" rel="noopener noreferrer"&gt;&lt;strong&gt;http://localhost:8000&lt;/strong&gt;&lt;/a&gt; o &lt;a href="http://localhost:8001" rel="noopener noreferrer"&gt;&lt;strong&gt;http://localhost:8001&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;En la interfaz seleccionamos nuestro agente &lt;strong&gt;corporate_agent&lt;/strong&gt; y comenzamos a realizar consultas.&lt;/p&gt;

&lt;p&gt;Esta modalidad es especialmente útil durante el desarrollo, porque permite inspeccionar la interacción con Gemini y comprobar cuándo el agente ejecuta la herramienta &lt;strong&gt;search_corporate_policies&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg88ku04q15qdj4t9zkx6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg88ku04q15qdj4t9zkx6.png" alt="Ejecución del agente en ADK Web" width="800" height="741"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://wiki-cloud.co/wp-content/uploads/2026/11/article_image_build_ai_agent_with_google_adk_06.gif" rel="noopener noreferrer"&gt;Ver Gif Animado&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Ejecutar el agente desde la consola de comandos&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;También podemos interactuar con nuestro agente directamente desde PowerShell, sin utilizar una interfaz gráfica. Para ello ejecutamos:&lt;/p&gt;

&lt;p&gt;Para iniciar la &lt;strong&gt;versión en inglés&lt;/strong&gt;, desde la raíz del proyecto ejecutamos:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;adk&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="n"&gt;sources_en&lt;/span&gt;\&lt;span class="n"&gt;corporate_agent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Para iniciar la &lt;strong&gt;versión en español&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;adk&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;\&lt;span class="n"&gt;sources_es&lt;/span&gt;\&lt;span class="n"&gt;corporate_agent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Este comando inicia una sesión interactiva donde podremos escribir preguntas y recibir las respuestas directamente en la terminal.&lt;/p&gt;

&lt;p&gt;Es una alternativa sencilla para realizar pruebas rápidas, comprobar el comportamiento del agente y detectar posibles errores durante el desarrollo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp7e5axso9ly7z3yo3n2a.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp7e5axso9ly7z3yo3n2a.gif" alt="Agente en línea de comandos" width="760" height="558"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Validar el funcionamiento del agente&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Independientemente de la modalidad de ejecución, podemos realizar algunas preguntas relacionadas con los documentos que tenemos almacenados en Google Drive:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;¿Cuántos días de vacaciones tienen los empleados al año?&lt;/li&gt;
&lt;li&gt;¿Cuál es la política de trabajo remoto de la empresa?&lt;/li&gt;
&lt;li&gt;¿Cómo puedo solicitar el reembolso de un gasto?&lt;/li&gt;
&lt;li&gt;¿Qué establece la política de reciclaje y sostenibilidad?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Durante estas pruebas debemos comprobar que el agente consulta los documentos mediante &lt;strong&gt;search_corporate_policies&lt;/strong&gt;, genera respuestas coherentes y proporciona referencias a las fuentes originales.&lt;/p&gt;

&lt;p&gt;También es recomendable realizar alguna pregunta cuya respuesta no se encuentre en los documentos para verificar que el agente reconoce cuando no dispone de información suficiente.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nota:&lt;/strong&gt; Streamlit, ADK Web y ADK CLI permiten interactuar con el mismo agente, pero ofrecen experiencias diferentes. Streamlit es nuestra interfaz personalizada, mientras que ADK Web y ADK CLI están orientados principalmente al desarrollo y las pruebas. Estas dos últimas opciones no sustituyen una interfaz empresarial preparada para producción.&lt;/p&gt;

&lt;p&gt;Para detener cualquiera de los servidores o sesiones, podemos utilizar &lt;strong&gt;Ctrl + C&lt;/strong&gt; desde la terminal correspondiente.&lt;/p&gt;

&lt;p&gt;Con estas pruebas habremos completado la implementación local de nuestro &lt;strong&gt;Asistente de Políticas Corporativas&lt;/strong&gt;. En la segunda parte de esta serie reutilizaremos el agente desarrollado para desplegarlo en &lt;strong&gt;Google Cloud Agent Runtime&lt;/strong&gt; y ponerlo a disposición de los usuarios mediante &lt;strong&gt;Gemini Enterprise&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusiones
&lt;/h2&gt;

&lt;p&gt;A lo largo de este ejercicio hemos desarrollado un &lt;strong&gt;Asistente de Políticas Corporativas&lt;/strong&gt; utilizando Google ADK, Gemini, Google Drive y Streamlit. Mediante una arquitectura sencilla basada en RAG, hemos conectado un agente de inteligencia artificial con documentos empresariales, permitiéndole consultar información, recuperar contenido relevante y generar respuestas en lenguaje natural acompañadas de sus fuentes. Además, hemos explorado aspectos importantes del desarrollo de agentes, como la integración de herramientas, la gestión de sesiones, las instrucciones del modelo y la construcción de una interfaz web.&lt;/p&gt;

&lt;p&gt;El desarrollo de agentes de IA representa una oportunidad para que las organizaciones transformen la manera en que sus empleados acceden a la información y realizan sus actividades diarias. Soluciones como la que hemos construido pueden reducir el tiempo dedicado a buscar documentos, facilitar el acceso al conocimiento corporativo y servir como punto de partida para automatizar procesos más complejos. Sin embargo, su adopción también requiere prestar atención a la seguridad, los permisos de acceso, la calidad de la información y la supervisión de las respuestas. Este ejercicio nos permite comprender los fundamentos de la IA agéntica y cómo comenzar a llevar estas capacidades a escenarios empresariales reales.&lt;/p&gt;

&lt;p&gt;En la &lt;strong&gt;segunda parte de esta serie&lt;/strong&gt;, daremos el siguiente paso: desplegaremos nuestro agente en &lt;strong&gt;Google Cloud Agent Runtime&lt;/strong&gt; y lo integraremos con &lt;strong&gt;Gemini Enterprise&lt;/strong&gt;, pasando de una aplicación local a una solución accesible desde una plataforma empresarial.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recursos
&lt;/h2&gt;

&lt;p&gt;Para profundizar en las tecnologías utilizadas durante este ejercicio, puedes consultar la siguiente documentación oficial:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://adk.dev/get-started/python/" rel="noopener noreferrer"&gt;Google Agent Development Kit (ADK)&lt;/a&gt;:&lt;/strong&gt; introducción al desarrollo de agentes, herramientas y ejecución con Python.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://aistudio.google.com/" rel="noopener noreferrer"&gt;Google AI Studio&lt;/a&gt;:&lt;/strong&gt; plataforma para experimentar con los modelos Gemini y obtener una API Key.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://ai.google.dev/gemini-api/docs" rel="noopener noreferrer"&gt;Gemini API&lt;/a&gt;:&lt;/strong&gt; documentación de los modelos, SDK y configuración de la API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://developers.google.com/workspace/drive/api/quickstart/python" rel="noopener noreferrer"&gt;Google Drive API&lt;/a&gt;:&lt;/strong&gt; integración de aplicaciones Python con documentos almacenados en Google Drive.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://docs.streamlit.io/get-started" rel="noopener noreferrer"&gt;Streamlit&lt;/a&gt;:&lt;/strong&gt; desarrollo de aplicaciones web interactivas utilizando Python.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://cloud.google.com/use-cases/retrieval-augmented-generation?hl=es" rel="noopener noreferrer"&gt;Introducción a RAG — Google Cloud&lt;/a&gt;:&lt;/strong&gt; conceptos y funcionamiento de la generación aumentada por recuperación.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/runtime/quickstart-adk" rel="noopener noreferrer"&gt;Google Cloud Agent Runtime&lt;/a&gt;:&lt;/strong&gt; despliegue y ejecución de agentes con Google ADK en Google Cloud.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Espero sea de utilidad !!!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Síguenos:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉&lt;a href="http://wiki-cloud.co/" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt; | 👉&lt;a href="https://x.com/johnbulla" rel="noopener noreferrer"&gt;X&lt;/a&gt; | 👉&lt;a href="https://www.linkedin.com/in/johnbulla" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; | 👉&lt;a href="https://github.com/johnbulla" rel="noopener noreferrer"&gt;Github&lt;/a&gt; | 👉&lt;a href="https://www.youtube.com/user/johnbulla" rel="noopener noreferrer"&gt;Youtube&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>cloud</category>
      <category>googlecloud</category>
    </item>
    <item>
      <title>Google ADK: Architecture and Essential Components</title>
      <dc:creator>John Bulla</dc:creator>
      <pubDate>Sun, 02 Aug 2026 12:04:38 +0000</pubDate>
      <link>https://dev.to/gde/google-adk-architecture-and-essential-components-4hb6</link>
      <guid>https://dev.to/gde/google-adk-architecture-and-essential-components-4hb6</guid>
      <description>&lt;div class="ltag__user ltag__user__id__666134"&gt;
    &lt;a href="/johnbulla" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=150,height=150,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F666134%2Fc19791a4-86a8-48f5-8ff6-b31d0aa6b1a7.png" alt="johnbulla image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/johnbulla"&gt;John Bulla&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/johnbulla"&gt;💼 Sr. Cloud Solutions Architect - Cloud, Data &amp;amp; AI | Pre-Sales Architect | Cloud Evangelist 
🏆 Google Developer Expert | AWS Community Builder | Alibaba Cloud MVP | Ex-Microsoft MVP&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Nota:&lt;/strong&gt; ✋ This post was originally published on my blog &lt;a href="https://wiki-cloud.co/en/2026/07/google-adk-architecture-essential-components/" rel="noopener noreferrer"&gt;wiki-cloud.co&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The development of artificial intelligence solutions is evolving from traditional conversational assistants to systems capable of reasoning, using tools, querying information, executing processes, and collaborating with other agents.&lt;/p&gt;

&lt;p&gt;In this context, &lt;strong&gt;Google Agent Development Kit (ADK)&lt;/strong&gt; provides a framework for designing, developing, testing, and deploying AI-based agent applications. Its modular architecture allows you to build anything from a simple agent to multi-agent systems capable of coordinating complex business workflows.&lt;/p&gt;

&lt;p&gt;Based on the official product guide, some research, and the experience of many developers, I present a high-level architecture of Google ADK with different components, which can be explained through the following layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User interfaces.&lt;/li&gt;
&lt;li&gt;ADK Runtime and Runner.&lt;/li&gt;
&lt;li&gt;Agent system.&lt;/li&gt;
&lt;li&gt;Foundation components.&lt;/li&gt;
&lt;li&gt;Models and knowledge.&lt;/li&gt;
&lt;li&gt;Observability and governance.&lt;/li&gt;
&lt;li&gt;Deployment options.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each layer fulfills a specific function and integrates with the others to process user requests in an organized, secure, and scalable manner.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;High-level architecture&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa0dray3z5h723cpn9vec.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa0dray3z5h723cpn9vec.png" alt=" " width="690" height="1180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below I present the high-level architecture divided into layers and components, where I will explain each one of them:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;User interfaces&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The top layer of this high-level architecture represents the different channels through which users or applications can interact with the agents.&lt;/p&gt;

&lt;p&gt;Google ADK doesn't require the use of a specific interface. Users and developers can interact with the agents through various options, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CLI:&lt;/strong&gt; for running and testing agents from the command line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web UI:&lt;/strong&gt; for interacting with agents through a web interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Endpoints:&lt;/strong&gt; for integrating agents with other applications or services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom Frontends:&lt;/strong&gt; such as corporate portals, mobile apps, conversational assistants, or messaging channels.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This separation allows the agent's logic to be independent of the user experience. The same agent system can be used from different channels without needing to modify its internal behavior.&lt;/p&gt;

&lt;p&gt;For example, a support agent can handle inquiries from a web application, an internal chatbot, and an API used by other corporate applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0wfh3xm5iugbydhvvgua.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0wfh3xm5iugbydhvvgua.gif" alt=" " width="600" height="337"&gt;&lt;/a&gt;&lt;br&gt;
Source: Google ADK&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;ADK Runtime &amp;amp; Runner&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The ADK Runtime and Runner constitute the environment responsible for executing and coordinating the operation of the agents.&lt;/p&gt;

&lt;p&gt;This layer acts as the operational engine of the architecture and is responsible for connecting the user interfaces with the agent system and the services they need.&lt;/p&gt;

&lt;p&gt;Its main capabilities are:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Event Loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The event loop is the central operating pattern that defines the interaction between the Runner and the custom code (agents, tools, callbacks, collectively referred to as “execution logic” or “logical components” in the design document). The event loop manages the sequence of actions that occur during an interaction.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdznvcce50cia0f8rcj8w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdznvcce50cia0f8rcj8w.png" alt=" " width="799" height="333"&gt;&lt;/a&gt;&lt;br&gt;
Source: Google ADK&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Orchestration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Orchestration controls how agents participate and in what order tasks are performed.&lt;/p&gt;

&lt;p&gt;You can determine, for example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which agent should handle a request?&lt;/li&gt;
&lt;li&gt;Whether multiple agents should execute sequentially?&lt;/li&gt;
&lt;li&gt;Whether certain tasks can be processed in parallel?&lt;/li&gt;
&lt;li&gt;When should an action be repeated?&lt;/li&gt;
&lt;li&gt;When should control be transferred to another agent?&lt;/li&gt;
&lt;li&gt;When should the execution flow end?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This capability is especially important in multi-agent architectures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Service Management&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Service management connects the Runner to the infrastructure components used by the application.&lt;/p&gt;

&lt;p&gt;This includes services such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sessions.&lt;/li&gt;
&lt;li&gt;Memory.&lt;/li&gt;
&lt;li&gt;State.&lt;/li&gt;
&lt;li&gt;Artifacts.&lt;/li&gt;
&lt;li&gt;Tools.&lt;/li&gt;
&lt;li&gt;Evaluation services.&lt;/li&gt;
&lt;li&gt;Observability systems.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks to this separation, the agent's logic can remain decoupled from the mechanism used to store information or deploy the solution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Agent System&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The functional core of the architecture is the agent system. ADK allows combining different types of agents depending on the level of autonomy, control, and specialization required by the solution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLM Agents&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;LLM Agents use language models to interpret requests, reason about the context, and decide what action to take. Google ADKuse models from the Gemini family through Vertex AI or Google AI Studio to reason and make decisions.&lt;/p&gt;

&lt;p&gt;This type of agent can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understand natural language.&lt;/li&gt;
&lt;li&gt;Analyze information.&lt;/li&gt;
&lt;li&gt;Generate responses.&lt;/li&gt;
&lt;li&gt;Select tools.&lt;/li&gt;
&lt;li&gt;Decide which agent should intervene.&lt;/li&gt;
&lt;li&gt;Solve tasks that don't follow a completely deterministic flow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, a customer service agent can analyze a request, check the status of an order, and determine whether to respond directly or transfer the case to a specialized agent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent workflow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Workflows control the execution of other agents using more structured patterns. They are useful when the process requires predictable behavior and a defined execution order.&lt;/p&gt;

&lt;p&gt;The main patterns are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sequential execution&lt;/li&gt;
&lt;li&gt;Parallel execution&lt;/li&gt;
&lt;li&gt;Execution using loops&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Custom Agents&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Custom agents allow you to implement specialized behaviors when agents based solely on language models or predefined flows are insufficient.&lt;/p&gt;

&lt;p&gt;A custom agent can include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Specific business logic.&lt;/li&gt;
&lt;li&gt;Custom algorithms.&lt;/li&gt;
&lt;li&gt;Deterministic validations.&lt;/li&gt;
&lt;li&gt;Complex integrations.&lt;/li&gt;
&lt;li&gt;Security rules.&lt;/li&gt;
&lt;li&gt;Specialized data processing.&lt;/li&gt;
&lt;li&gt;Advanced execution cycle control.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, an organization could create a custom agent to validate financial transactions by applying internal rules before allowing another agent to continue the process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Foundation components&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The ADK architecture relies on a set of components that preserve context, coordinate actions, and enable interaction with external systems. These components are essential for the agent to maintain continuity and perform tasks beyond a simple conversation. The basic or fundamental components are as follows:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Session&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A session represents a continuous interaction between a user and an agent application. The session allows for the preservation of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User messages.&lt;/li&gt;
&lt;li&gt;Agent responses.&lt;/li&gt;
&lt;li&gt;Tool calls.&lt;/li&gt;
&lt;li&gt;Intermediate results.&lt;/li&gt;
&lt;li&gt;Transfers between agents.&lt;/li&gt;
&lt;li&gt;Events that occur during execution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The session provides the necessary context to maintain a coherent conversation across multiple exchanges.&lt;/p&gt;

&lt;p&gt;For example, if a user provides an order number at the beginning of a conversation, the agent can reuse it in subsequent requests within the same session.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;State&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;State stores structured information that can change during execution. Unlike conversational history, state contains concrete values ​​that agents can query or update. Some examples are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User name.&lt;/li&gt;
&lt;li&gt;Selected language.&lt;/li&gt;
&lt;li&gt;Incident number.&lt;/li&gt;
&lt;li&gt;Selected product.&lt;/li&gt;
&lt;li&gt;Approval status.&lt;/li&gt;
&lt;li&gt;Validation result.&lt;/li&gt;
&lt;li&gt;Current step in a process.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;State facilitates the construction of multi-step conversational flows and avoids relying solely on the text in the history.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Memory allows information to be stored and retrieved beyond a single session. It can be used to remember:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User preferences.&lt;/li&gt;
&lt;li&gt;Previous interactions.&lt;/li&gt;
&lt;li&gt;Related projects.&lt;/li&gt;
&lt;li&gt;Previous decisions.&lt;/li&gt;
&lt;li&gt;Relevant information from past conversations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Memory helps deliver more personalized experiences and maintain continuity across different sessions.&lt;/p&gt;

&lt;p&gt;It is important to distinguish between three concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Session:&lt;/strong&gt; represents a specific conversation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State:&lt;/strong&gt; stores structured values ​​during execution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory:&lt;/strong&gt; stores reusable information long-term.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Events&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Events are the fundamental units of information flow within the Agent Development Kit (ADK). They represent every significant occurrence during an agent's interaction lifecycle, from initial user input to final response, including all intermediate steps. Understanding events is crucial, as they are the primary means of communication between components, state management, and control flow direction. An event can correspond to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A message.&lt;/li&gt;
&lt;li&gt;An answer.&lt;/li&gt;
&lt;li&gt;A call to a tool.&lt;/li&gt;
&lt;li&gt;The result of a tool.&lt;/li&gt;
&lt;li&gt;A change of state.&lt;/li&gt;
&lt;li&gt;A transfer between agents.&lt;/li&gt;
&lt;li&gt;A mistake.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The use of events allows you to reconstruct the path followed by the system and understand how a response was generated. It is also an important basis for traceability, debugging, and evaluation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tools&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Tools allow agents to interact with external services and perform real-world actions. A tool can be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Python function.&lt;/li&gt;
&lt;li&gt;An enterprise API.&lt;/li&gt;
&lt;li&gt;A database query.&lt;/li&gt;
&lt;li&gt;A Google Cloud service.&lt;/li&gt;
&lt;li&gt;A ticketing system.&lt;/li&gt;
&lt;li&gt;A search tool.&lt;/li&gt;
&lt;li&gt;A SaaS application.&lt;/li&gt;
&lt;li&gt;Another agent.&lt;/li&gt;
&lt;li&gt;An MCP-compatible server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When an agent needs information or needs to perform an action, they can select a tool, generate its parameters, and process the result. For example, a support agent can query a knowledge base, check the status of a service, and create a ticket on an external platform. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Artifacts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Artifacts represent a crucial mechanism for managing named and versioned binary data, associated with a specific user interaction session or persistently with a user across multiple sessions. They allow agents and tools to manage data beyond simple text strings, enabling more comprehensive interactions that include files, images, audio, and other binary formats.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Models and Knowledge&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The models and knowledge layer provides the intelligence, context, and information sources used by the agents. This layer includes four main elements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gemini and other models&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Google ADK is designed to integrate seamlessly with Gemini, although it can also use other third-party models depending on the solution's needs.&lt;/p&gt;

&lt;p&gt;The model can handle:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understanding user intent.&lt;/li&gt;
&lt;li&gt;Reasoning about a problem.&lt;/li&gt;
&lt;li&gt;Generate responses.&lt;/li&gt;
&lt;li&gt;Select tools.&lt;/li&gt;
&lt;li&gt;Classifying requests.&lt;/li&gt;
&lt;li&gt;Summarizing information.&lt;/li&gt;
&lt;li&gt;Coordinating agents.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An architecture can use different models depending on the task.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An advanced model for complex reasoning.&lt;/li&gt;
&lt;li&gt;A faster model for classification.&lt;/li&gt;
&lt;li&gt;A multimodal model for processing images or documents.&lt;/li&gt;
&lt;li&gt;A specialized model for a specific task.&lt;/li&gt;
&lt;li&gt;This flexibility allows for balancing quality, latency, and cost.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Long-Term Memory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Long-term memory retains relevant information obtained from previous interactions. It can be used to retrieve:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User preferences.&lt;/li&gt;
&lt;li&gt;Historical decisions.&lt;/li&gt;
&lt;li&gt;Project context.&lt;/li&gt;
&lt;li&gt;Previous interactions.&lt;/li&gt;
&lt;li&gt;Information associated with long-running processes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Retrieval should be selective to avoid sending unnecessary information to the model. It is also important to implement data privacy, retention, and deletion policies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Retrieval Augmented Generation (RAG)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The architecture can integrate &lt;strong&gt;Retrieval Augmented Generation&lt;/strong&gt; mechanisms, known as RAG. This approach allows the agent to search for information in knowledge sources before generating a response. These sources can include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enterprise documentation.&lt;/li&gt;
&lt;li&gt;Manuals.&lt;/li&gt;
&lt;li&gt;Internal policies.&lt;/li&gt;
&lt;li&gt;Knowledge bases.&lt;/li&gt;
&lt;li&gt;Technical documents.&lt;/li&gt;
&lt;li&gt;Repositories.&lt;/li&gt;
&lt;li&gt;Vector databases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;RAG reduces reliance on general model knowledge and improves the accuracy of responses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;APIs, services and external systems&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Agents can connect to internal and external systems using tools and integrations. Some examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enterprise APIs.&lt;/li&gt;
&lt;li&gt;Databases.&lt;/li&gt;
&lt;li&gt;ERP systems.&lt;/li&gt;
&lt;li&gt;CRM systems.&lt;/li&gt;
&lt;li&gt;Ticketing platforms.&lt;/li&gt;
&lt;li&gt;SaaS services.&lt;/li&gt;
&lt;li&gt;Storage systems.&lt;/li&gt;
&lt;li&gt;Search engines.&lt;/li&gt;
&lt;li&gt;Google Cloud services.&lt;/li&gt;
&lt;li&gt;Third-party applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This capability allows agents not only to answer questions but also to access up-to-date information and perform actions within business processes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Observability and governance&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Observability and governance allow us to understand what happens within an agent as it performs a task. Through telemetry and structured logs, it's possible to analyze aspects such as its reasoning steps, tool calls, and the responses generated by the models. This information is especially useful during development, as it facilitates error identification, diagnosis of unexpected behavior, continuous agent improvement, and monitoring of system performance.&lt;/p&gt;

&lt;p&gt;This layer consists of: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Traceability:&lt;/strong&gt; Allows us to reconstruct the complete path of a request. This information is fundamental for analyzing errors and understanding the behavior of multi-agent systems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Logs:&lt;/strong&gt; Logs record important events that occur during execution. Logs facilitate incident investigation and operational monitoring.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Metrics:&lt;/strong&gt; Metrics allow us to measure system performance and quality. These metrics help identify performance, cost, or design problems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evaluation:&lt;/strong&gt; Evaluation allows us to verify whether the agents meet the expected objectives. In an agent-based system, it's not enough to evaluate the final response. It's also necessary to review whether the agent followed the correct process.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alerts:&lt;/strong&gt; Alerts notify you of unexpected behavior or critical conditions. They allow you to respond quickly before the problem affects a larger number of users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security:&lt;/strong&gt; Security should be integrated into the entire architecture, enabling control over user authentication, role-based authorization and permissions, data protection, auditing, and more. For example, an agent can view an invoice but not modify it. Another authorized agent could make changes after human validation or approval.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Deployment Options&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Una aplicación desarrollada con Google ADK puede desplegarse en diferentes entornos. La elección depende del nivel de control, escalabilidad, costos, integración, seguridad y operación requerida por la organización. A continuación se mencionan las opciones de despliegue más comunes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Agent Runtime:&lt;/strong&gt; This is a fully managed, auto-scaling service on Google Cloud, specifically designed to deploy, manage, and scale AI agents built with frameworks like ADK.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Run:&lt;/strong&gt; Cloud Run allows you to deploy agents as serverless containers. Cloud Run can be used to expose the agent via an API or integrate it with events and other Google Cloud services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google Kubernetes Engine:&lt;/strong&gt; Google Kubernetes Engine (GKE) is a managed Kubernetes service from Google Cloud that allows you to run agents in a container environment. GKE is a good option if you need greater control over the deployment and to run Open Models.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Other Environments:&lt;/strong&gt; As an open-source, code-based framework, ADK can also be deployed in other compatible environments, such as on-premises infrastructure, private data centers, other container platforms, other cloud environments, and virtual machines. This flexibility allows you to tailor the deployment to sovereignty, regulatory, integration, or multicloud strategy requirements.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The Google ADK architecture provides a modular framework for building AI-based applications.&lt;/p&gt;

&lt;p&gt;User interfaces allow access to the system from various channels. The Runtime and Runner coordinate execution. The agent system provides reasoning, orchestration, and specialized behaviors. Core components manage sessions, state, memory, events, tools, and artifacts.&lt;/p&gt;

&lt;p&gt;The model and knowledge layer connects the agents to Gemini, other models, RAG systems, and external sources. Observability and governance enable control over performance, quality, and security. Finally, the various deployment options allow the solution to run in managed environments, serverless environments, Kubernetes, or on-premises infrastructure.&lt;/p&gt;

&lt;p&gt;The main strength of ADK lies not only in connecting an application to a language model, but also in providing the necessary components to transform that model into an organized, extensible, observable agentic system ready to integrate with real-world business processes.&lt;/p&gt;

&lt;p&gt;The appropriate design will depend on each use case, but should always maintain a balance between autonomy, control, security, and simplicity.&lt;/p&gt;

&lt;p&gt;In future articles, we will delve deeper into this topic.&lt;/p&gt;

&lt;p&gt;Other articles:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/gde/google-adk-introduction-to-ai-agent-development-1b4e"&gt;- Google ADK: An Introduction to AI Agent Development&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope will be useful.&lt;/p&gt;

&lt;p&gt;Best Regards,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow me:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉&lt;a href="http://wiki-cloud.co/" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt; | 👉&lt;a href="https://x.com/johnbulla" rel="noopener noreferrer"&gt;X&lt;/a&gt; | 👉&lt;a href="https://www.linkedin.com/in/johnbulla" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; | 👉&lt;a href="https://github.com/johnbulla" rel="noopener noreferrer"&gt;Github&lt;/a&gt; | 👉&lt;a href="https://www.youtube.com/user/johnbulla" rel="noopener noreferrer"&gt;Youtube&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>cloud</category>
      <category>googlecloud</category>
    </item>
    <item>
      <title>Google ADK: Arquitectura y componentes esenciales</title>
      <dc:creator>John Bulla</dc:creator>
      <pubDate>Sun, 02 Aug 2026 11:43:27 +0000</pubDate>
      <link>https://dev.to/johnbulla/google-adk-arquitectura-y-componentes-esenciales-2c8m</link>
      <guid>https://dev.to/johnbulla/google-adk-arquitectura-y-componentes-esenciales-2c8m</guid>
      <description>&lt;div class="ltag__user ltag__user__id__666134"&gt;
    &lt;a href="/johnbulla" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=150,height=150,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F666134%2Fc19791a4-86a8-48f5-8ff6-b31d0aa6b1a7.png" alt="johnbulla image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/johnbulla"&gt;John Bulla&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/johnbulla"&gt;💼 Sr. Cloud Solutions Architect - Cloud, Data &amp;amp; AI | Pre-Sales Architect | Cloud Evangelist 
🏆 Google Developer Expert | AWS Community Builder | Alibaba Cloud MVP | Ex-Microsoft MVP&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Nota:&lt;/strong&gt; ✋ Este post se publicó originalmente en mi blog &lt;a href="https://wiki-cloud.co/es/2026/07/google-adk-architecture-essential-components/" rel="noopener noreferrer"&gt;wiki-cloud.co&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introducción&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;El desarrollo de soluciones de inteligencia artificial está evolucionando desde los asistentes conversacionales tradicionales hacia sistemas capaces de razonar, utilizar herramientas, consultar información, ejecutar procesos y colaborar con otros agentes.&lt;/p&gt;

&lt;p&gt;En este contexto, &lt;strong&gt;Google Agent Development Kit (ADK)&lt;/strong&gt; proporciona un framework para diseñar, desarrollar, probar y desplegar aplicaciones basadas en agentes de inteligencia artificial. Su arquitectura modular permite construir desde un agente sencillo hasta sistemas multiagente capaces de coordinar flujos de trabajo empresariales complejos.&lt;/p&gt;

&lt;p&gt;De acuerdo con la guía oficial del producto, algunas investigaciones y a la experiencia de muchos desarrolladores, presento una arquitectura a alto nivel de Google ADK con diferentes componentes y puede explicarse mediante las siguientes capas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Interfaces de usuario.&lt;/li&gt;
&lt;li&gt;ADK Runtime y Runner.&lt;/li&gt;
&lt;li&gt;Sistema de agentes.&lt;/li&gt;
&lt;li&gt;Componentes fundamentales.&lt;/li&gt;
&lt;li&gt;Modelos y conocimiento.&lt;/li&gt;
&lt;li&gt;Observabilidad y gobierno.&lt;/li&gt;
&lt;li&gt;Opciones de despliegue.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cada capa cumple una función específica y se integra con las demás para procesar las solicitudes de los usuarios de forma organizada, segura y escalable.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Arquitectura alto nivel&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn1p5c5227ynsrue0d97q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn1p5c5227ynsrue0d97q.png" alt=" " width="690" height="1180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A continuación presento la arquitectura a alto nivel dividida en capas y componentes donde explicare cado uno de ellos:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Interfaces de usuario&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;La capa superior de esta arquitectura a alto nivel representa los diferentes canales desde los que los usuarios o aplicaciones pueden interactuar con los agentes.&lt;/p&gt;

&lt;p&gt;Google ADK no obliga a utilizar una interfaz concreta. Los usuarios y desarrolladores pueden interactuar con los agentes mediante distintas opciones, entre ellas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CLI:&lt;/strong&gt; para ejecutar y probar agentes desde la línea de comandos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web UI:&lt;/strong&gt; para interactuar con los agentes desde una interfaz web.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Endpoints:&lt;/strong&gt; para integrar los agentes con otras aplicaciones o servicios.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontends personalizados:&lt;/strong&gt; como portales corporativos, aplicaciones móviles, asistentes conversacionales o canales de mensajería.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Esta separación permite que la lógica del agente sea independiente de la experiencia de usuario. Un mismo sistema de agentes puede ser utilizado desde distintos canales sin necesidad de modificar su comportamiento interno.&lt;/p&gt;

&lt;p&gt;Por ejemplo, un agente de soporte puede atender consultas desde una aplicación web, un chatbot interno y una API utilizada por otras aplicaciones corporativas.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0wfh3xm5iugbydhvvgua.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0wfh3xm5iugbydhvvgua.gif" alt=" " width="600" height="337"&gt;&lt;/a&gt;&lt;br&gt;
Fuente: Google ADK&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;ADK Runtime &amp;amp; Runner&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;El ADK Runtime y Runner constituyen el entorno responsable de ejecutar y coordinar el funcionamiento de los agentes.&lt;/p&gt;

&lt;p&gt;Esta capa actúa como el motor operativo de la arquitectura y se encarga de conectar las interfaces de usuario con el sistema de agentes y los servicios que estos necesitan.&lt;/p&gt;

&lt;p&gt;Sus principales capacidades son:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bucle de eventos&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;El bucle de eventos es el patrón operativo central que define la interacción entre el Runner y el código personalizado (agentes, herramientas, devoluciones de llamada, denominados colectivamente “lógica de ejecución” o “componentes lógicos” en el documento de diseño). El bucle de eventos gestiona la secuencia de acciones que se producen durante una interacción.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdznvcce50cia0f8rcj8w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdznvcce50cia0f8rcj8w.png" alt=" " width="799" height="333"&gt;&lt;/a&gt;&lt;br&gt;
Fuente: Google ADK&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Orquestación&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;La orquestación controla cómo participan los agentes y en qué orden se ejecutan las tareas.&lt;/p&gt;

&lt;p&gt;Puede determinar, por ejemplo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Qué agente debe atender una solicitud.&lt;/li&gt;
&lt;li&gt;Si varios agentes deben ejecutarse secuencialmente.&lt;/li&gt;
&lt;li&gt;Si determinadas tareas pueden procesarse en paralelo.&lt;/li&gt;
&lt;li&gt;Cuando debe repetirse una acción.&lt;/li&gt;
&lt;li&gt;Cuando debe transferirse el control a otro agente.&lt;/li&gt;
&lt;li&gt;Cuando debe finalizar el flujo de ejecución.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Esta capacidad es especialmente importante en arquitecturas multiagente.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gestión de Servicios&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;La gestión de servicios conecta el Runner con los componentes de infraestructura utilizados por la aplicación.&lt;/p&gt;

&lt;p&gt;Esto incluye servicios como:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sesiones.&lt;/li&gt;
&lt;li&gt;Memoria.&lt;/li&gt;
&lt;li&gt;Estado.&lt;/li&gt;
&lt;li&gt;Artefactos.&lt;/li&gt;
&lt;li&gt;Herramientas.&lt;/li&gt;
&lt;li&gt;Servicios de evaluación.&lt;/li&gt;
&lt;li&gt;Sistemas de observabilidad.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Gracias a esta separación, la lógica del agente puede mantenerse desacoplada del mecanismo utilizado para almacenar información o desplegar la solución.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Sistema de Agentes&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;El núcleo funcional de la arquitectura es el sistema de agentes. ADK permite combinar diferentes tipos de agentes dependiendo del nivel de autonomía, control y especialización requerido por la solución.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agentes LLM&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Los LLM Agents utilizan modelos de lenguaje para interpretar las solicitudes, razonar sobre el contexto y decidir qué acción realizar. Google ADK utilizan modelos de la familia Gemini a través de Vertex AI o Google AI Studio para razonar y tomar decisiones.&lt;/p&gt;

&lt;p&gt;Este tipo de agente puede:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Comprender lenguaje natural.&lt;/li&gt;
&lt;li&gt;Analizar información.&lt;/li&gt;
&lt;li&gt;Generar respuestas.&lt;/li&gt;
&lt;li&gt;Seleccionar herramientas.&lt;/li&gt;
&lt;li&gt;Decidir qué agente debe intervenir.&lt;/li&gt;
&lt;li&gt;Resolver tareas que no siguen un flujo completamente determinista.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Por ejemplo, un agente de atención al cliente puede analizar una solicitud, consultar el estado de un pedido y determinar si debe responder directamente o transferir el caso a un agente especializado.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flujo de trabajo de agentes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Los flujos de trabajo controlan la ejecución de otros agentes mediante patrones más estructurados. Son útiles cuando el proceso requiere un comportamiento predecible y un orden de ejecución definido.&lt;/p&gt;

&lt;p&gt;Los principales patrones son:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ejecución secuencial&lt;/li&gt;
&lt;li&gt;Ejecución paralela&lt;/li&gt;
&lt;li&gt;Ejecución mediante bucles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Agentes personalizados&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Los agentes personalizados permiten implementar comportamientos especializados cuando los agentes basados exclusivamente en modelos de lenguaje o los flujos predefinidos no son suficientes.&lt;/p&gt;

&lt;p&gt;Un agente personalizado puede incluir:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lógica de negocio específica.&lt;/li&gt;
&lt;li&gt;Algoritmos propios.&lt;/li&gt;
&lt;li&gt;Validaciones deterministas.&lt;/li&gt;
&lt;li&gt;Integraciones complejas.&lt;/li&gt;
&lt;li&gt;Reglas de seguridad.&lt;/li&gt;
&lt;li&gt;Procesamiento especializado de datos.&lt;/li&gt;
&lt;li&gt;Control avanzado del ciclo de ejecución.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Por ejemplo, una organización podría crear un agente personalizado para validar transacciones financieras aplicando reglas internas antes de permitir que otro agente continúe el proceso.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Componentes fundamentales&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;La arquitectura de ADK se apoya en un conjunto de componentes que conservan el contexto, coordinan las acciones y permiten interactuar con sistemas externos. Estos componentes son esenciales para que el agente mantenga continuidad y pueda ejecutar tareas más allá de una simple conversación. Los componentes básicos o fundamentales son los siguientes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sesión&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Una sesión representa una interacción continua entre un usuario y una aplicación de agentes. La sesión permite conservar:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mensajes del usuario.&lt;/li&gt;
&lt;li&gt;Respuestas de los agentes.&lt;/li&gt;
&lt;li&gt;Llamadas a herramientas.&lt;/li&gt;
&lt;li&gt;Resultados intermedios.&lt;/li&gt;
&lt;li&gt;Transferencias entre agentes.&lt;/li&gt;
&lt;li&gt;Eventos producidos durante la ejecución.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;La sesión proporciona el contexto necesario para mantener una conversación coherente a lo largo de varios intercambios.&lt;/p&gt;

&lt;p&gt;Por ejemplo, si un usuario proporciona un número de pedido al comienzo de una conversación, el agente puede reutilizarlo en solicitudes posteriores dentro de la misma sesión.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Estado&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;El estado almacena información estructurada que puede cambiar durante la ejecución. A diferencia del historial conversacional, el estado contiene valores concretos que los agentes pueden consultar o actualizar. Algunos ejemplos son:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nombre del usuario.&lt;/li&gt;
&lt;li&gt;Idioma seleccionado.&lt;/li&gt;
&lt;li&gt;Número de incidencia.&lt;/li&gt;
&lt;li&gt;Producto elegido.&lt;/li&gt;
&lt;li&gt;Estado de una aprobación.&lt;/li&gt;
&lt;li&gt;Resultado de una validación.&lt;/li&gt;
&lt;li&gt;Paso actual de un proceso.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;El estado facilita la construcción de flujos conversacionales de varios pasos y evita depender únicamente del texto del historial.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memoria&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;La memoria permite conservar y recuperar información más allá de una única sesión. Puede utilizarse para recordar:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Preferencias de los usuarios.&lt;/li&gt;
&lt;li&gt;Interacciones anteriores.&lt;/li&gt;
&lt;li&gt;Proyectos relacionados.&lt;/li&gt;
&lt;li&gt;Decisiones previas.&lt;/li&gt;
&lt;li&gt;Información relevante de conversaciones pasadas.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;La memoria ayuda a ofrecer experiencias más personalizadas y a mantener continuidad entre diferentes sesiones.&lt;/p&gt;

&lt;p&gt;Es importante diferenciar tres conceptos:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sesión:&lt;/strong&gt; representa una conversación específica.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Estado:&lt;/strong&gt; almacena valores estructurados durante la ejecución.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memoria:&lt;/strong&gt; conserva información reutilizable a largo plazo.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Eventos&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Los eventos son las unidades fundamentales del flujo de información dentro del Kit de Desarrollo de Agentes (ADK). Representan cada suceso significativo durante el ciclo de vida de la interacción de un agente, desde la entrada inicial del usuario hasta la respuesta final, incluyendo todos los pasos intermedios. Comprender los eventos es crucial, ya que son la principal vía de comunicación entre componentes, la gestión del estado y la dirección del flujo de control. Un evento puede corresponder a:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Un mensaje.&lt;/li&gt;
&lt;li&gt;Una respuesta.&lt;/li&gt;
&lt;li&gt;Una llamada a una herramienta.&lt;/li&gt;
&lt;li&gt;El resultado de una herramienta.&lt;/li&gt;
&lt;li&gt;Un cambio de estado.&lt;/li&gt;
&lt;li&gt;Una transferencia entre agentes.&lt;/li&gt;
&lt;li&gt;Un error.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;El uso de eventos permite reconstruir el recorrido seguido por el sistema y entender cómo se generó una respuesta. También es una base importante para la trazabilidad, la depuración y la evaluación.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Herramientas&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Las herramientas permiten que los agentes interactúen con servicios externos y ejecuten acciones reales. Una herramienta puede ser:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Una función de Python.&lt;/li&gt;
&lt;li&gt;Una API empresarial.&lt;/li&gt;
&lt;li&gt;Una consulta a una base de datos.&lt;/li&gt;
&lt;li&gt;Un servicio de Google Cloud.&lt;/li&gt;
&lt;li&gt;Un sistema de tickets.&lt;/li&gt;
&lt;li&gt;Una herramienta de búsqueda.&lt;/li&gt;
&lt;li&gt;Una aplicación SaaS.&lt;/li&gt;
&lt;li&gt;Otro agente.&lt;/li&gt;
&lt;li&gt;Un servidor compatible con MCP.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cuando el agente necesita información o debe ejecutar una acción, puede seleccionar una herramienta, generar sus parámetros y procesar el resultado obtenido. Por ejemplo, un agente de soporte puede consultar una base de conocimiento, revisar el estado de un servicio y crear una incidencia en una plataforma externa. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Artefactos&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Los artefactos representan un mecanismo crucial para gestionar datos binarios con nombre y versión, asociados a una sesión de interacción de usuario específica o de forma persistente a un usuario a lo largo de varias sesiones. Permiten que los agentes y herramientas gestionen datos más allá de simples cadenas de texto, posibilitando interacciones más completas que incluyan archivos, imágenes, audio y otros formatos binarios.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Modelos y Conocimiento&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;La capa de modelos y conocimientos proporciona la inteligencia, el contexto y las fuentes de información utilizadas por los agentes. Esta capa incluye cuatro elementos principales.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gemini y otros modelos&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Google ADK está diseñado para integrarse de forma natural con Gemini, aunque también puede utilizar otros modelos de terceros según las necesidades de la solución.&lt;/p&gt;

&lt;p&gt;El modelo puede encargarse de:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Comprender la intención del usuario.&lt;/li&gt;
&lt;li&gt;Razonar sobre un problema.&lt;/li&gt;
&lt;li&gt;Generar respuestas.&lt;/li&gt;
&lt;li&gt;Seleccionar herramientas.&lt;/li&gt;
&lt;li&gt;Clasificar solicitudes.&lt;/li&gt;
&lt;li&gt;Resumir información.&lt;/li&gt;
&lt;li&gt;Coordinar agentes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Una arquitectura puede utilizar diferentes modelos dependiendo de la tarea.&lt;/p&gt;

&lt;p&gt;Por ejemplo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Un modelo avanzado para razonamiento complejo.&lt;/li&gt;
&lt;li&gt;Un modelo más rápido para clasificación.&lt;/li&gt;
&lt;li&gt;Un modelo multimodal para procesar imágenes o documentos.&lt;/li&gt;
&lt;li&gt;Un modelo especializado para una tarea concreta.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Esta flexibilidad permite equilibrar calidad, latencia y coste.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memoria de largo plazo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;La memoria de largo plazo conserva información relevante obtenida en interacciones anteriores. Puede utilizarse para recuperar:&lt;/p&gt;

&lt;p&gt;Preferencias del usuario.&lt;br&gt;
Decisiones históricas.&lt;br&gt;
Contexto de proyectos.&lt;br&gt;
Interacciones previas.&lt;br&gt;
Información asociada a procesos de larga duración.&lt;/p&gt;

&lt;p&gt;La recuperación debe realizarse de forma selectiva para evitar enviar al modelo información innecesaria. También es importante aplicar políticas de privacidad, retención y eliminación de datos.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Generación Aumentada de Recuperación – RAG&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;La arquitectura puede integrar mecanismos de &lt;strong&gt;Retrieval-Augmented Generation&lt;/strong&gt;, conocidos como RAG. Este enfoque permite que el agente busque información en fuentes de conocimiento antes de generar una respuesta. Las fuentes pueden incluir:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Documentación empresarial.&lt;/li&gt;
&lt;li&gt;Manuales.&lt;/li&gt;
&lt;li&gt;Políticas internas.&lt;/li&gt;
&lt;li&gt;Bases de conocimiento.&lt;/li&gt;
&lt;li&gt;Documentos técnicos.&lt;/li&gt;
&lt;li&gt;Repositorios.&lt;/li&gt;
&lt;li&gt;Bases de datos vectoriales.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;RAG permite reducir la dependencia del conocimiento general del modelo y mejorar la precisión de las respuestas.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;APIs, servicios y sistemas externos&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Los agentes pueden conectarse con sistemas internos y externos mediante herramientas e integraciones. Algunos ejemplos son:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;APIs corporativas.&lt;/li&gt;
&lt;li&gt;Bases de datos.&lt;/li&gt;
&lt;li&gt;Sistemas ERP.&lt;/li&gt;
&lt;li&gt;CRM.&lt;/li&gt;
&lt;li&gt;Plataformas de tickets.&lt;/li&gt;
&lt;li&gt;Servicios SaaS.&lt;/li&gt;
&lt;li&gt;Sistemas de almacenamiento.&lt;/li&gt;
&lt;li&gt;Motores de búsqueda.&lt;/li&gt;
&lt;li&gt;Servicios de Google Cloud.&lt;/li&gt;
&lt;li&gt;Aplicaciones de terceros.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Esta capacidad permite que el agente no solo responda preguntas, sino que también consulte información actualizada y ejecute acciones dentro de procesos empresariales.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Observabilidad y Gobierno&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;La observabilidad y el gobierno permite comprender qué ocurre dentro de un agente mientras ejecuta una tarea. A través de la telemetría y de registros estructurados, es posible analizar aspectos como sus pasos de razonamiento, las llamadas a herramientas y las respuestas generadas por los modelos. Esta información resulta especialmente útil durante el desarrollo, ya que facilita la identificación de errores, el diagnóstico de comportamientos inesperados, la mejora continua del agente y controlar el funcionamiento del sistema.&lt;/p&gt;

&lt;p&gt;Esta capa se compone de: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Trazabilidad:&lt;/strong&gt; Permite reconstruir el recorrido completo de una solicitud. Esta información es fundamental para analizar errores y comprender el comportamiento de sistemas multiagente.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Logs:&lt;/strong&gt; Los logs registran eventos importantes producidos durante la ejecución. Los logs facilitan la investigación de incidencias y el seguimiento operativo.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Métricas:&lt;/strong&gt; Las métricas permiten medir el rendimiento y la calidad del sistema. Estas métricas ayudan a identificar problemas de rendimiento, coste o diseño.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evaluación:&lt;/strong&gt; La evaluación permite comprobar si los agentes cumplen los objetivos esperados. En un sistema agentico no basta con evaluar la respuesta final. También es necesario revisar si el agente siguió el proceso adecuado.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alertas:&lt;/strong&gt; Las alertas notifican comportamientos inesperados o condiciones críticas. Las alertas permiten responder rápidamente antes de que el problema afecte a un mayor número de usuarios.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Seguridad:&lt;/strong&gt; La seguridad debe formar parte de toda la arquitectura permitiendo tener control en la autenticación de usuarios, autorización por roles y permisos, protección de datos, auditoría, entre otros. Por ejemplo, un agente puede consultar una factura, pero no modificarla. Otro agente autorizado podría ejecutar cambios después de una validación o aprobación humana.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Opciones de Despliegue&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Una aplicación desarrollada con Google ADK puede desplegarse en diferentes entornos. La elección depende del nivel de control, escalabilidad, costos, integración, seguridad y operación requerida por la organización. A continuación se mencionan las opciones de despliegue más comunes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Agent Runtime:&lt;/strong&gt; Es un servicio de escalado automático totalmente administrado en Google Cloud, diseñado específicamente para implementar, administrar y escalar agentes de IA creados con marcos de trabajo como ADK.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Run:&lt;/strong&gt; Cloud Run permite desplegar agentes como contenedores serverless. Cloud Run puede utilizarse para exponer el agente mediante una API o integrarlo con eventos y otros servicios de Google Cloud.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google Kubernetes Engine:&lt;/strong&gt; Google Kubernetes Engine (GKE) es un servicio de Kubernetes administrado de Google Cloud que permite ejecutar agentes en un entorno de contenedores. GKE es una buena opción si se necesita mayor control sobre la implementación y para ejecutar Open Models.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Otros entornos:&lt;/strong&gt; Al ser un framework abierto y basado en código, ADK también puede desplegarse en otros entornos compatibles como por ejemplo infraestructura local centros de datos privados, otras plataformas de contenedores, entornos on-premises, otras nubes y máquinas virtuales. Esta flexibilidad permite adaptar el despliegue a requisitos de soberanía, regulación, integración o estrategia multicloud.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusión&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;La arquitectura de Google ADK proporciona una estructura modular para construir aplicaciones basadas en agentes de inteligencia artificial.&lt;/p&gt;

&lt;p&gt;Las interfaces de usuario permiten acceder al sistema desde distintos canales. El Runtime y el Runner coordinan la ejecución. El sistema de agentes aporta razonamiento, orquestación y comportamientos especializados. Los componentes fundamentales gestionan las sesiones, el estado, la memoria, los eventos, las herramientas y los artefactos.&lt;/p&gt;

&lt;p&gt;A su vez, la capa de modelos y conocimiento conecta los agentes con Gemini, otros modelos, sistemas RAG y fuentes externas. La observabilidad y el gobierno permiten controlar el rendimiento, la calidad y la seguridad. Finalmente, las distintas opciones de despliegue hacen posible ejecutar la solución en entornos administrados, serverless, Kubernetes o infraestructuras propias.&lt;/p&gt;

&lt;p&gt;La principal fortaleza de ADK no consiste únicamente en conectar una aplicación con un modelo de lenguaje, sino en proporcionar los componentes necesarios para transformar ese modelo en un sistema agentic organizado, extensible, observable y preparado para integrarse con procesos empresariales reales.&lt;/p&gt;

&lt;p&gt;El diseño adecuado dependerá de cada caso de uso, pero debería mantener siempre un equilibrio entre autonomía, control, seguridad y simplicidad.&lt;/p&gt;

&lt;p&gt;En próximos artículos seguiremos profundizaremos más sobre el tema.&lt;/p&gt;

&lt;p&gt;Otros artículos:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/johnbulla/google-adk-introduccion-al-desarrollo-de-agentes-de-ia-7n1"&gt;Google ADK: Introducción al desarrollo de agentes de IA&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Espero sea de utilidad !!!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Síguenos:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉&lt;a href="http://wiki-cloud.co/" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt; | 👉&lt;a href="https://x.com/johnbulla" rel="noopener noreferrer"&gt;X&lt;/a&gt; | 👉&lt;a href="https://www.linkedin.com/in/johnbulla" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; | 👉&lt;a href="https://github.com/johnbulla" rel="noopener noreferrer"&gt;Github&lt;/a&gt; | 👉&lt;a href="https://www.youtube.com/user/johnbulla" rel="noopener noreferrer"&gt;Youtube&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>cloud</category>
      <category>googlecloud</category>
    </item>
    <item>
      <title>Google ADK: Introduction to AI Agent Development</title>
      <dc:creator>John Bulla</dc:creator>
      <pubDate>Sun, 26 Jul 2026 15:56:55 +0000</pubDate>
      <link>https://dev.to/gde/google-adk-introduction-to-ai-agent-development-1b4e</link>
      <guid>https://dev.to/gde/google-adk-introduction-to-ai-agent-development-1b4e</guid>
      <description>&lt;div class="ltag__user ltag__user__id__666134"&gt;
    &lt;a href="/johnbulla" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=150,height=150,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F666134%2Fc19791a4-86a8-48f5-8ff6-b31d0aa6b1a7.png" alt="johnbulla image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/johnbulla"&gt;John Bulla&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/johnbulla"&gt;💼 Sr. Cloud Solutions Architect - Cloud, Data &amp;amp; AI | Pre-Sales Architect | Cloud Evangelist 
🏆 Google Developer Expert | AWS Community Builder | Alibaba Cloud MVP | Ex-Microsoft MVP&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Nota:&lt;/strong&gt; ✋ This post was originally published on my blog &lt;a href="https://wiki-cloud.co/en/2026/07/google-adk-intro-ai-agent-development/" rel="noopener noreferrer"&gt;wiki-cloud.co&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Artificial intelligence is evolving at an unprecedented pace and is transforming how people and businesses interact with technology. Over the past few years, much of the focus has been on generative AI models, which can create text, images, code, audio, and other types of content from natural language instructions. These capabilities have marked a significant and transformative shift in how we perform many tasks, allowing AI to move from a specialized technology to an accessible tool for millions of users.&lt;/p&gt;

&lt;p&gt;However, we are entering a new stage. Artificial intelligence models are no longer limited to simply answering questions or generating content. They can now be autonomous, understand objectives, analyze context, decide what steps to take, use tools, consult different sources of information, connect with APIs, execute actions, and collaborate with other specialized agents to complete more complex tasks.&lt;/p&gt;

&lt;p&gt;This evolution is giving rise to what is known as agentic artificial intelligence, an approach in which AI systems can act with a greater level of autonomy and actively participate in business, technical, and operational processes. Instead of simply offering a recommendation, an agent can search for information, validate data, coordinate different activities, and execute a sequence of actions aimed at achieving a specific goal.&lt;/p&gt;

&lt;p&gt;Within this new scenario appears &lt;strong&gt;Google Agent Development Kit&lt;/strong&gt;, also known as &lt;strong&gt;Google ADK&lt;/strong&gt;, is an open-source framework developed and designed by Google to facilitate the creation, evaluation, and deployment of artificial intelligence agents. ADK provides developers with a structure for defining agent behavior, connecting them to language models and external tools, managing sessions and memory, coordinating multi-agent systems, and evaluating their performance before deploying them to production.&lt;/p&gt;

&lt;p&gt;Thanks to this code-based approach, &lt;strong&gt;Google ADK&lt;/strong&gt; allows you to build everything from simple agents capable of answering questions and retrieving information to more advanced architectures made up of multiple agents that collaborate with each other. This way, teams can develop modular, scalable solutions tailored to real-world use cases, such as customer service, data analysis, process automation, technical support, and decision-making.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is an artificial intelligence agent?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;With this technological advance in artificial intelligence that is growing at an exponential speed, the question arises, What is an artificial intelligence agent?&lt;/p&gt;

&lt;p&gt;An AI agent is an application that uses an artificial intelligence model to understand a situation, reason about it, and execute goal-oriented actions.&lt;/p&gt;

&lt;p&gt;Unlike a traditional chatbot, which typically receives a question and generates a response, an agent can carry out a broader process based on the stated objective. For example, it can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Interpret the user's request.&lt;/li&gt;
&lt;li&gt;Analyze the available context.&lt;/li&gt;
&lt;li&gt;Decide what steps to take.&lt;/li&gt;
&lt;li&gt;Select and use tools.&lt;/li&gt;
&lt;li&gt;Consult APIs, databases, or external services.&lt;/li&gt;
&lt;li&gt;Delegate tasks to other agents.&lt;/li&gt;
&lt;li&gt;Evaluate the results.&lt;/li&gt;
&lt;li&gt;Deliver a response or perform an action.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In &lt;strong&gt;Google ADK&lt;/strong&gt;, an agent is typically composed of an AI model, instructions that define its behavior, and optionally a set of tools that it can use to complete its tasks and fulfill the objective set by the user.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh6vb0eh057v8tdjqe1re.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh6vb0eh057v8tdjqe1re.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is Google ADK?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Google ADK&lt;/strong&gt;, whose initials mean &lt;strong&gt;Agent Development Kit&lt;/strong&gt;, is an open-source framework provided by Google for creating, debugging, and deploying reliable, enterprise-ready artificial intelligence agents. These agents can reason, remember information, use tools, interact with other agents, and execute tasks in a coordinated manner. Thanks to its flexible approach, ADK allows you to start with simple agents and gradually evolve into sophisticated multi-agent systems capable of supporting everything from personal assistants to mission-critical enterprise workflows.&lt;/p&gt;

&lt;p&gt;An agent created with ADK can receive a goal, analyze the user's request, decide what actions to take, use the available tools, and generate a response based on the results obtained.&lt;/p&gt;

&lt;p&gt;Although ADK is specifically optimized for working with Gemini models and Google Cloud services, its architecture is flexible and allows the use of other models, tools, and deployment environments. Google presents it as an open framework for building, debugging, and deploying trusted agents at enterprise scale.&lt;/p&gt;

&lt;p&gt;Currently, ADK has implementations for different languages, including Python, TypeScript, Go, Java and Kotlin, which facilitates its adoption by teams with different technological ecosystems.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fivw43154k5zbeccgcwxo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fivw43154k5zbeccgcwxo.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Advantages of Google ADK&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A continuación menciono las principales ventajas de trabajar con Google ADK:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Multi-agent system&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Google ADK facilitates the creation of architectures composed of several specialized agents that can collaborate with each other. Each agent can assume a specific responsibility, use its own tools, and share information with other agents to solve more complex tasks.&lt;/p&gt;

&lt;p&gt;This approach allows a problem to be divided into different areas of work. For example, one agent can be responsible for querying information, another for analyzing it, and a third for generating a final response. In this way, the solutions are more modular, easier to maintain, and prepared to evolve as project requirements increase.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Compatibility with different AI models&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although ADK is specially optimized to work with Gemini, its architecture allows the integration of different artificial intelligence models according to the needs of each solution.&lt;/p&gt;

&lt;p&gt;This flexibility allows developers to select the most suitable model based on criteria such as cost, performance, response speed, reasoning capabilities, data privacy, or the environment where the application will run. In this way, developers are not limited to a single alternative and can adapt the architecture to different technological and business scenarios.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Extensive ecosystem of integrations and tools&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Google ADK allows agents to connect to a wide range of tools, services, and information sources. Its integration with Gemini and Google Cloud facilitates access to capabilities such as data analytics, storage, search, code execution, and enterprise services.&lt;/p&gt;

&lt;p&gt;Furthermore, agents can connect to APIs, databases, enterprise applications, and third-party tools. This allows them to do more than simply generate responses; they can also access up-to-date information, execute operations, and actively participate in real-world business processes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Multiple coordination patterns&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ADK offers different ways to organize and coordinate work between agents. Developers can build sequential, parallel, hierarchical, or delegation-based workflows, depending on the nature of the problem they want to solve.&lt;/p&gt;

&lt;p&gt;For example, multiple agents can execute tasks simultaneously to reduce response time, follow a specific sequence, or work under the coordination of a supervisory agent. This variety of patterns allows for combining controlled processes with dynamic, AI-driven decisions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Clear code and modular structure&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ADK provides a syntax designed to facilitate the definition of agents, instructions, tools, and workflows through code. This allows for the organized development of solutions and keeps the various responsibilities of the application separate.&lt;/p&gt;

&lt;p&gt;Its code-based approach promotes component reuse, version control, and the application of good software engineering practices. Developers can create simple agents with just a few lines of code and progressively expand the solution without having to completely redesign the architecture.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Complete development experience&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Google ADK includes tools that support developers throughout the entire agent lifecycle. It allows them to create prototypes, run tests locally, inspect interactions, analyze tool usage, and debug system behavior.&lt;/p&gt;

&lt;p&gt;It also offers capabilities to evaluate responses and validate the steps taken by agents. This helps detect errors, improve instructions, and verify that the solution performs as expected before being deployed in a production environment.&lt;/p&gt;

&lt;p&gt;Its developer-oriented approach facilitates integration with practices such as automated testing, code review, continuous integration, and continuous deployment.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Compatibility with open protocols such as MCP and A2A&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Google ADK promotes interoperability by adopting open protocols such as Model Context Protocol, known as MCP, and Agent2Agent, known as A2A.&lt;/p&gt;

&lt;p&gt;MCP facilitates the connection of agents with external tools, data sources, and services through a standardized interface. A2A, on the other hand, allows agents developed with different technologies, languages, or platforms to communicate and collaborate with each other.&lt;/p&gt;

&lt;p&gt;Adopting these protocols reduces dependence on proprietary integrations and facilitates the building of more open, extensible, and interoperable agent ecosystems.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Google Agent Development Kit&lt;/strong&gt; represents a relevant proposal within the ecosystem of agentic artificial intelligence. Its open, code-based approach allows you to build everything from simple agents to multi-agent systems capable of collaborating, using tools, and participating in complex business processes.&lt;/p&gt;

&lt;p&gt;ADK provides a framework for connecting models, instructions, tools, memory, sessions, and evaluation mechanisms. Furthermore, its integration with Google Cloud simplifies the process from local development to the deployment of scalable solutions.&lt;/p&gt;

&lt;p&gt;More than just a tool for creating chatbots, Google AdK allows you to design applications capable of reasoning, acting, and collaborating. For this reason, it can become an important alternative for organizations that want to move from the experimental use of generative artificial intelligence to agents prepared to solve real-world problems in industry and people's daily lives.&lt;/p&gt;

&lt;p&gt;In upcoming articles we will delve deeper into this topic.&lt;/p&gt;

&lt;p&gt;I hope this information is useful.&lt;/p&gt;

&lt;p&gt;Best Regards,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow me:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉&lt;a href="http://wiki-cloud.co/" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt; | 👉&lt;a href="https://x.com/johnbulla" rel="noopener noreferrer"&gt;X&lt;/a&gt; | 👉&lt;a href="https://www.linkedin.com/in/johnbulla" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; | 👉&lt;a href="https://github.com/johnbulla" rel="noopener noreferrer"&gt;Github&lt;/a&gt; | 👉&lt;a href="https://www.youtube.com/user/johnbulla" rel="noopener noreferrer"&gt;Youtube&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>cloud</category>
      <category>googlecloud</category>
    </item>
    <item>
      <title>Google ADK: Introducción al desarrollo de agentes de IA</title>
      <dc:creator>John Bulla</dc:creator>
      <pubDate>Sun, 26 Jul 2026 15:46:58 +0000</pubDate>
      <link>https://dev.to/johnbulla/google-adk-introduccion-al-desarrollo-de-agentes-de-ia-7n1</link>
      <guid>https://dev.to/johnbulla/google-adk-introduccion-al-desarrollo-de-agentes-de-ia-7n1</guid>
      <description>&lt;div class="ltag__user ltag__user__id__666134"&gt;
    &lt;a href="/johnbulla" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=150,height=150,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F666134%2Fc19791a4-86a8-48f5-8ff6-b31d0aa6b1a7.png" alt="johnbulla image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/johnbulla"&gt;John Bulla&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/johnbulla"&gt;💼 Sr. Cloud Solutions Architect - Cloud, Data &amp;amp; AI | Pre-Sales Architect | Cloud Evangelist 
🏆 Google Developer Expert | AWS Community Builder | Alibaba Cloud MVP | Ex-Microsoft MVP&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Nota:&lt;/strong&gt; ✋ Este post se publicó originalmente en mi blog &lt;a href="https://wiki-cloud.co/es/2026/07/google-adk-intro-ai-agent-development/" rel="noopener noreferrer"&gt;wiki-cloud.co&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introducción&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;La inteligencia artificial está evolucionando a una velocidad sin precedentes y está transformando la forma en que las personas y las empresas interactúan con la tecnología. Durante estos últimos años, gran parte de la atención se centró en los modelos de inteligencia artificial generativa, que son capaces de crear texto, imágenes, código, audio y otros tipos de contenido a partir de instrucciones en lenguaje natural. Estas capacidades marcaron un cambio importante y trascendental en la forma que que realizamos muchas tareas, ya que permitieron que la IA pasara de ser una tecnología especializada a convertirse en una herramienta accesible para millones de usuarios.&lt;/p&gt;

&lt;p&gt;Sin embargo, estamos entrando en una nueva etapa. Los modelos de inteligencia artificial ya no se limitan únicamente a responder preguntas o generar contenido. Ahora pueden ser autónomos, comprender objetivos, analizar el contexto, decidir qué pasos deben seguir, utilizar herramientas, consultar diferentes fuentes de información, conectarse con APIs, ejecutar acciones y colaborar con otros agentes especializados para completar tareas más complejas.&lt;/p&gt;

&lt;p&gt;Esta evolución está dando lugar a la llamada inteligencia artificial agéntica, un enfoque en el que los sistemas de IA pueden actuar con un mayor nivel de autonomía y participar activamente en procesos empresariales, técnicos y operativos. En lugar de limitarse a ofrecer una recomendación, un agente puede buscar información, validar datos, coordinar diferentes actividades y ejecutar una secuencia de acciones orientadas a alcanzar un objetivo concreto.&lt;/p&gt;

&lt;p&gt;Dentro de este nuevo escenario aparece &lt;strong&gt;Google Agent Development Kit&lt;/strong&gt;, conocido como &lt;strong&gt;Google ADK&lt;/strong&gt;, un framework de código abierto desarrollado y diseñado por Google para facilitar la creación, evaluación y despliegue de agentes de inteligencia artificial. ADK proporciona a los desarrolladores una estructura para definir el comportamiento de los agentes, conectarlos con modelos de lenguaje y herramientas externas, gestionar sesiones y memoria, coordinar sistemas multiagente y evaluar su funcionamiento antes de llevarlos a producción.&lt;/p&gt;

&lt;p&gt;Gracias a este enfoque basado en código, &lt;strong&gt;Google ADK&lt;/strong&gt; permite construir desde agentes sencillos capaces de responder preguntas y consultar información hasta arquitecturas más avanzadas, formadas por varios agentes que colaboran entre sí. De esta manera, los equipos pueden desarrollar soluciones modulares, escalables y adaptadas a casos de uso reales, como la atención al cliente, el análisis de datos, la automatización de procesos, el soporte técnico, participar en la toma de decisiones.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;¿Qué es un agente de inteligencia artificial?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Con este avance tecnologico en inteligencia artificial que crece a una velocidad exponencial, surge la pregunta, ¿Qué es un agente de inteligencia artificial?.&lt;/p&gt;

&lt;p&gt;Un agente de IA es una aplicación que utiliza un modelo de inteligencia artificial para comprender una situación, razonar sobre ella y ejecutar acciones orientadas para alcanzar un objetivo.&lt;/p&gt;

&lt;p&gt;A diferencia de un chatbot tradicional, que normalmente recibe una pregunta y genera una respuesta, un agente puede realizar un proceso más amplio de acuerdo al objetivo planteado, como por ejemplo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Interpretar la solicitud del usuario.&lt;/li&gt;
&lt;li&gt;Analizar el contexto disponible.&lt;/li&gt;
&lt;li&gt;Decidir qué pasos debe seguir.&lt;/li&gt;
&lt;li&gt;Seleccionar y utilizar herramientas.&lt;/li&gt;
&lt;li&gt;Consultar APIs, bases de datos o servicios externos.&lt;/li&gt;
&lt;li&gt;Delegar tareas en otros agentes.&lt;/li&gt;
&lt;li&gt;Evaluar los resultados.&lt;/li&gt;
&lt;li&gt;Entregar una respuesta o ejecutar una acción.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;En &lt;strong&gt;Google ADK&lt;/strong&gt;, un agente suele estar compuesto por un modelo de IA, unas instrucciones que definen su comportamiento y opcionalmente un conjunto de herramientas que puede utilizar para completar sus tareas y cumplir con el objetivo propuesto por el usuario.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2zet6ye3ibuarn7o68yy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2zet6ye3ibuarn7o68yy.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;¿Qué es Google ADK?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Google ADK&lt;/strong&gt;, cuyas siglas significan &lt;strong&gt;Agent Development Kit&lt;/strong&gt; (Kit de Desarrollo de Agentes), es un framework de código abierto proporcionado por Google para crear, depurar e implementar agentes de inteligencia artificial fiables y preparados para entornos empresariales. Estos agentes pueden razonar, recordar información, utilizar herramientas, interactuar con otros agentes y ejecutar tareas de forma coordinada. Gracias a su enfoque flexible, ADK permite comenzar con agentes sencillos y evolucionar progresivamente hacia sofisticados sistemas multiagente, capaces de dar soporte tanto a asistentes personales como a flujos de trabajo empresariales de misión crítica.&lt;/p&gt;

&lt;p&gt;Un agente creado con ADK puede recibir un objetivo, analizar la solicitud del usuario, decidir qué acciones debe realizar, utilizar las herramientas disponibles y generar una respuesta basada en los resultados obtenidos.&lt;/p&gt;

&lt;p&gt;Aunque ADK está especialmente optimizado para trabajar con los modelos de Gemini y los servicios de Google Cloud, su arquitectura es flexible y permite utilizar otros modelos, herramientas y entornos de despliegue. Google lo presenta como un framework abierto para construir, depurar y desplegar agentes confiables a escala empresarial.&lt;/p&gt;

&lt;p&gt;Actualmente, ADK dispone de implementaciones para diferentes lenguajes, entre ellos Python, TypeScript, Go, Java y Kotlin, lo que facilita su adopción por equipos con distintos ecosistemas tecnológicos.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhe6faa4pvq1wnzm75sbp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhe6faa4pvq1wnzm75sbp.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Ventajas de Google ADK&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A continuación menciono las principales ventajas de trabajar con Google ADK:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Sistema Multi agentes&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Google ADK facilita la creación de arquitecturas compuestas por varios agentes especializados que pueden colaborar entre sí. Cada agente puede asumir una responsabilidad concreta, utilizar sus propias herramientas y compartir información con otros agentes para resolver tareas más complejas.&lt;/p&gt;

&lt;p&gt;Este enfoque permite dividir un problema en diferentes áreas de trabajo. Por ejemplo, un agente puede encargarse de consultar información, otro de analizarla y un tercero de generar una respuesta final. De esta manera, las soluciones son más modulares, fáciles de mantener y preparadas para evolucionar a medida que aumentan los requisitos del proyecto.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Compatibilidad con diferentes modelos de IA&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Aunque ADK está especialmente optimizado para trabajar con Gemini, su arquitectura permite integrar diferentes modelos de inteligencia artificial según las necesidades de cada solución.&lt;/p&gt;

&lt;p&gt;Esta flexibilidad permite seleccionar el modelo más adecuado en función de criterios como el coste, el rendimiento, la velocidad de respuesta, la capacidad de razonamiento, la privacidad de los datos o el entorno donde se ejecutará la aplicación. De este modo, los desarrolladores no están limitados a una única alternativa y pueden adaptar la arquitectura a distintos escenarios tecnológicos y empresariales.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Amplio ecosistema de integraciones y herramientas&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Google ADK permite conectar los agentes con un amplio conjunto de herramientas, servicios y fuentes de información. Su integración con Gemini y Google Cloud facilita el acceso a capacidades como análisis de datos, almacenamiento, búsqueda, ejecución de código y servicios empresariales.&lt;/p&gt;

&lt;p&gt;Además, los agentes pueden conectarse con APIs, bases de datos, aplicaciones corporativas y herramientas de terceros. Esto permite que no se limiten a generar respuestas, sino que también puedan consultar información actualizada, ejecutar operaciones y participar activamente en procesos reales de negocio.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Múltiples patrones de coordinación&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ADK ofrece diferentes formas de organizar y coordinar el trabajo entre agentes. Los desarrolladores pueden construir flujos secuenciales, paralelos, jerárquicos o basados en delegación, dependiendo de la naturaleza del problema que desean resolver.&lt;/p&gt;

&lt;p&gt;Por ejemplo, varios agentes pueden ejecutar tareas al mismo tiempo para reducir el tiempo de respuesta, seguir una secuencia determinada o trabajar bajo la coordinación de un agente supervisor. Esta variedad de patrones permite combinar procesos controlados con decisiones dinámicas basadas en inteligencia artificial.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Código claro y estructura modular&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ADK proporciona una sintaxis orientada a facilitar la definición de agentes, instrucciones, herramientas y flujos de trabajo mediante código. Esto permite construir soluciones de manera organizada y mantener separadas las distintas responsabilidades de la aplicación.&lt;/p&gt;

&lt;p&gt;Su enfoque basado en código favorece la reutilización de componentes, el control de versiones y la aplicación de buenas prácticas de ingeniería de software. Los desarrolladores pueden crear agentes sencillos con pocas líneas de código y ampliar progresivamente la solución sin tener que rediseñar completamente la arquitectura.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Experiencia de desarrollo completa&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Google ADK incorpora herramientas que acompañan al desarrollador durante todo el ciclo de vida de un agente. Permite crear prototipos, ejecutar pruebas localmente, inspeccionar las interacciones, analizar el uso de herramientas y depurar el comportamiento del sistema.&lt;/p&gt;

&lt;p&gt;También ofrece capacidades para evaluar respuestas y validar los pasos seguidos por los agentes. Esto ayuda a detectar errores, mejorar las instrucciones y comprobar que la solución actúa de acuerdo con los resultados esperados antes de ser desplegada en un entorno productivo.&lt;/p&gt;

&lt;p&gt;Su enfoque orientado al desarrollador facilita la integración con prácticas como pruebas automatizadas, revisión de código, integración continua y despliegue continuo.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Compatibilidad con protocolos abiertos como MCP y A2A&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Google ADK promueve la interoperabilidad mediante la adopción de protocolos abiertos como Model Context Protocol, conocido como MCP, y Agent2Agent, conocido como A2A.&lt;/p&gt;

&lt;p&gt;MCP facilita la conexión de los agentes con herramientas, fuentes de datos y servicios externos mediante una interfaz estandarizada. Por su parte, A2A permite que agentes desarrollados con diferentes tecnologías, lenguajes o plataformas puedan comunicarse y colaborar entre sí.&lt;/p&gt;

&lt;p&gt;La adopción de estos protocolos reduce la dependencia de integraciones propietarias y facilita la construcción de ecosistemas de agentes más abiertos, extensibles e interoperables.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusiones&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Google Agent Development Kit&lt;/strong&gt; representa una propuesta relevante dentro del ecosistema de la inteligencia artificial agéntica. Su enfoque abierto y basado en código permite construir desde agentes sencillos hasta sistemas multiagente capaces de colaborar, utilizar herramientas y participar en procesos empresariales complejos.&lt;/p&gt;

&lt;p&gt;ADK proporciona una estructura para conectar modelos, instrucciones, herramientas, memoria, sesiones y mecanismos de evaluación. Además, su integración con Google Cloud facilita el camino desde el desarrollo local hasta el despliegue de soluciones escalables.&lt;/p&gt;

&lt;p&gt;Más que una herramienta para crear chatbots, Google ADK permite diseñar aplicaciones capaces de razonar, actuar y colaborar. Por esta razón, puede convertirse en una alternativa importante para las organizaciones que quieran avanzar desde el uso experimental de la inteligencia artificial generativa hacia agentes preparados para resolver problemas reales de la industria y de la vida diaria de las personas.&lt;/p&gt;

&lt;p&gt;En próximos artículos profundizaremos más sobre el tema.&lt;/p&gt;

&lt;p&gt;Espero sea de utilidad !!!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Síguenos:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉&lt;a href="http://wiki-cloud.co/" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt; | 👉&lt;a href="https://x.com/johnbulla" rel="noopener noreferrer"&gt;X&lt;/a&gt; | 👉&lt;a href="https://www.linkedin.com/in/johnbulla" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; | 👉&lt;a href="https://github.com/johnbulla" rel="noopener noreferrer"&gt;Github&lt;/a&gt; | 👉&lt;a href="https://www.youtube.com/user/johnbulla" rel="noopener noreferrer"&gt;Youtube&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>cloud</category>
      <category>googlecloud</category>
    </item>
    <item>
      <title>AlloyDB Omni: PostgreSQL Optimized for Hybrid and Multicloud Environments</title>
      <dc:creator>John Bulla</dc:creator>
      <pubDate>Sat, 20 Sep 2025 16:56:23 +0000</pubDate>
      <link>https://dev.to/gde/alloydb-omni-postgresql-optimized-for-hybrid-and-multicloud-environments-4991</link>
      <guid>https://dev.to/gde/alloydb-omni-postgresql-optimized-for-hybrid-and-multicloud-environments-4991</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; ✋ This post was originally published on my blog &lt;a href="https:/https://wiki-cloud.co/es/2025/09/alloydb-omni-optimized-hybrid-multicloud-environments/" rel="noopener noreferrer"&gt;wiki-cloud.co&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In today’s technology landscape, flexibility and performance have become essential. Companies no longer operate in a single environment; they combine the cloud, their own data centers (on-premises), and hybrid architectures that leverage the best of both worlds.&lt;/p&gt;

&lt;p&gt;In this context, Google Cloud introduces AlloyDB Omni to solve precisely this challenge, with a proposal that extends the power of its next-generation database beyond the limits of its own cloud.&lt;/p&gt;

&lt;p&gt;AlloyDB Omni is Google Cloud’s self-managed version of AlloyDB and represents a significant evolution in the PostgreSQL ecosystem, combining the flexibility and performance of the PostgreSQL database, allowing organizations to leverage AlloyDB’s advanced features with the ability to run outside of Google Cloud, including in data centers (on-premises), on laptops, on cloud-based VM instances, in containers, or on Kubernetes.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is AlloyDB Omni?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;AlloyDB Omni&lt;/strong&gt; is a &lt;strong&gt;downloadable&lt;/strong&gt;, &lt;strong&gt;packaged&lt;/strong&gt; version of AlloyDB, Google Cloud's PostgreSQL-compatible database designed for the most demanding workloads, incorporating key improvements in flexibility, performance, storage, and more.&lt;/p&gt;

&lt;p&gt;Unlike AlloyDB (which is a fully managed service exclusive to Google Cloud), AlloyDB Omni is designed to run wherever you choose to deploy the database, which can be in an on-premises data center, on your laptop, VM instances, containers, Kubernetes, or even other public clouds.&lt;/p&gt;

&lt;p&gt;This is ideal for businesses that have requirements for keeping their data on-premises, low latency, or simply prefer to maintain full control over their hardware.&lt;/p&gt;

&lt;p&gt;In a previous &lt;a href="https://dev.to/johnbulla/alloydb-the-enterprise-database-for-the-modern-cloud-51gj"&gt;article&lt;/a&gt; wrote about AlloyDB, we recall that AlloyDB maintains full compatibility with PostgreSQL, which makes it much easier to migrate existing applications without the need for costly code changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fihi7kw5wgwovqmmkpvc6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fihi7kw5wgwovqmmkpvc6.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
Fuente: Google Cloud&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Key Features and Benefits&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;AlloyDB Omni inherits the best of the managed AlloyDB version in Google Cloud, bringing high performance, PostgreSQL compatibility, and deployment flexibility. Key advantages include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;🚀 &lt;strong&gt;Superior Performance:&lt;/strong&gt; Includes optimizations to the execution engine incorporating key Google innovations, delivering up to 2x the performance of standard PostgreSQL for transactional operations and up to 100x the speed of analytical queries, thanks to its in-memory columnar engine. This makes it an ideal choice for HTAP (hybrid transactional and analytical processing) workloads.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🔗 &lt;strong&gt;Full PostgreSQL Compatibility:&lt;/strong&gt; Built on the foundation of PostgreSQL, AlloyDB Omni is 100% compatible with the existing ecosystem. It supports standard PostgreSQL applications, drivers, extensions, and tools, facilitating frictionless migrations and the use of conventional management and replication utilities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🛡️ &lt;strong&gt;Security and Compliance:&lt;/strong&gt; Designed for environments with high regulatory or compliance requirements, where the public cloud is not always a viable option.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;⚙️ &lt;strong&gt;Flexible Deployment:&lt;/strong&gt; It can run in on-premises data centers, virtual machines, Kubernetes, or even other public clouds, offering true hybrid and multi-cloud portability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;📊 &lt;strong&gt;Data Governance and Control:&lt;/strong&gt; It allows for full data sovereignty, ensuring that organizations decide exactly where their data will reside to meet strict security, data residency, and regulatory compliance policies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🔍 &lt;strong&gt;Query Optimization:&lt;/strong&gt; Includes an intelligent indexing advisor capable of analyzing the most frequent queries and recommending additional indexes to improve overall system performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🤖 &lt;strong&gt;AI Features:&lt;/strong&gt; ncorporates AlloyDB AI, which enables native integration with generative artificial intelligence models compatible with Vertex AI and other frameworks, expanding analysis and automation capabilities.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Use cases&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;On-premises modernization:&lt;/strong&gt; For companies already running PostgreSQL in their own data centers and looking to improve performance and scalability without immediately migrating to the cloud. AlloyDB Omni also enables gradual migration and workload distribution across hybrid and multi-cloud environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Low latency and data residency:&lt;/strong&gt; Ideal for applications that require data to be physically close to users or that must comply with strict data sovereignty and residency regulations, where the public cloud is not viable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local development and testing:&lt;/strong&gt; Development teams can count on an on-premises experience identical to AlloyDB in the cloud, accelerating build, testing, and validation cycles before going live.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Regulatory compliance:&lt;/strong&gt; Designed for organizations in sectors such as banking, healthcare, and government, which must operate under strict security and compliance regulations that limit the use of public cloud services.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusions&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;AlloyDB Omni&lt;/strong&gt; marks a key strategic move by Google Cloud and a bold step toward democratizing high-performance databases. By extending AlloyDB's innovation beyond the confines of its own cloud, it gives organizations the freedom to modernize PostgreSQL workloads on their own terms, regardless of their location—in the cloud, on-premises, or in hybrid configurations.&lt;/p&gt;

&lt;p&gt;With the promise of improving performance, simplifying management, and future-proofing data infrastructure, AlloyDB Omni is positioned as an alternative worth considering. Ultimately, it opens up new possibilities for driving hybrid and multi-cloud strategies with greater flexibility and control.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Resources&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/alloydb/omni/docs" rel="noopener noreferrer"&gt;AlloyDB Omni documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/alloydb/omni/docs/overview" rel="noopener noreferrer"&gt;AlloyDB Omni overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/alloydb/omni/docs/quickstart" rel="noopener noreferrer"&gt;Install AlloyDB Omni&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/alloydb/omni/docs/kubernetes-overview" rel="noopener noreferrer"&gt;AlloyDB Omni for Kubernetes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/alloydb/omni/docs/containers-overview" rel="noopener noreferrer"&gt;AlloyDB Omni for containers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hope will be useful !!!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow us:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉&lt;a href="http://wiki-cloud.co/" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt; | 👉&lt;a href="https://twitter.com/johnbulla" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; | 👉&lt;a href="https://www.linkedin.com/in/johnbulla" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; | 👉&lt;a href="https://www.youtube.com/user/johnbulla" rel="noopener noreferrer"&gt;Youtube&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>googlecloud</category>
      <category>postgres</category>
      <category>database</category>
      <category>alloydb</category>
    </item>
    <item>
      <title>AlloyDB Omni: PostgreSQL optimizado para entornos híbridos y multicloud</title>
      <dc:creator>John Bulla</dc:creator>
      <pubDate>Sat, 20 Sep 2025 16:25:52 +0000</pubDate>
      <link>https://dev.to/johnbulla/alloydb-omni-postgresql-optimizado-para-entornos-hibridos-y-multicloud-15mg</link>
      <guid>https://dev.to/johnbulla/alloydb-omni-postgresql-optimizado-para-entornos-hibridos-y-multicloud-15mg</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Nota:&lt;/strong&gt; ✋ Este post se publicó originalmente en mi blog &lt;a href="https:/https://wiki-cloud.co/es/2025/09/alloydb-omni-optimized-hybrid-multicloud-environments/" rel="noopener noreferrer"&gt;wiki-cloud.co&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introducción&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;En el panorama tecnológico actual, la flexibilidad y el rendimiento se han vuelto imprescindibles. Las empresas ya no operan en un único entorno; combinan la nube, sus propios centros de datos (on-premises) y arquitecturas híbridas que aprovechan lo mejor de ambos mundos.&lt;/p&gt;

&lt;p&gt;Con este contexto, Google Cloud presenta &lt;strong&gt;AlloyDB Omni&lt;/strong&gt; para resolver precisamente este desafío, con una propuesta que extiende el poder de su base de datos de última generación más allá de los límites de su propia nube.&lt;/p&gt;

&lt;p&gt;AlloyDB Omni es la versión autogestionada de AlloyDB de Google Cloud que representa una evolución significativa en el ecosistema de PostgreSQL, que combina la flexibilidad y el rendimiento de la base de datos de PostgreSQL, donde las organizaciones pueden disfrutar de las características avanzadas de AlloyDB con la posibilidad de ejecutarse fuera de Google Cloud, incluyendo centros de datos (on-premises), equipos portátiles, en instancias de VM basadas en la nube, en contenedores o en Kubernetes.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;¿Qué es AlloyDB Omni?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;AlloyDB Omni&lt;/strong&gt; es una versión &lt;strong&gt;empaquetada y descargable&lt;/strong&gt; de AlloyDB, la base de datos PostgreSQL compatible de Google Cloud diseñada para las cargas de trabajo más exigentes, que incorpora mejoras clave en flexibilidad, rendimiento, almacenamiento, entre otras.&lt;/p&gt;

&lt;p&gt;A diferencia de AlloyDB (que es un servicio totalmente gestionado exclusivo de Google Cloud), AlloyDB Omni está diseñado para ser ejecutado en el entorno que decidamos desplegar la base de datos, que puede ser un centro de datos local, el portátil, instancias de VM, contenedores, Kubernetes o incluso en otras nubes públicas.&lt;/p&gt;

&lt;p&gt;Esto es ideal para empresas que tienen requisitos de mantener sus datos en su infraestructura local, baja latencia o simplemente prefieren mantener el control total sobre su hardware.&lt;/p&gt;

&lt;p&gt;En un &lt;a href="https://dev.to/johnbulla/alloydb-la-base-de-datos-empresarial-para-la-nube-moderna-4opl"&gt;artículo&lt;/a&gt; anterior sobre AlloyDB, se recuerda que AlloyDB mantiene una compatibilidad total con PostgreSQL, lo que facilita enormemente la migración de aplicaciones existentes sin necesidad de realizar cambios costosos en el código.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fafoyu47nqvfmolgym1yn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fafoyu47nqvfmolgym1yn.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
Fuente: Google Cloud&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Características y beneficios clave&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;AlloyDB Omni hereda lo mejor de la versión gestionada de AlloyDB en Google Cloud, incorporando innovaciones de alto rendimiento, compatibilidad total con PostgreSQL y la flexibilidad de ejecutarse en múltiples entornos. Entre sus principales ventajas se destacan:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;🚀 &lt;strong&gt;Rendimiento superior&lt;/strong&gt;: Incorpora optimizaciones que ofrecen hasta &lt;strong&gt;2× más rendimiento&lt;/strong&gt; frente a PostgreSQL estándar para operaciones transaccionales, y hasta &lt;strong&gt;100× más velocidad&lt;/strong&gt; en consultas analíticas gracias a su motor de columnas en memoria. Ideal para cargas HTAP (procesamiento híbrido transaccional y analítico).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🔗 &lt;strong&gt;Compatibilidad total con PostgreSQL&lt;/strong&gt;: Construido sobre los cimientos de PostgreSQL, AlloyDB Omni es 100% compatible con el ecosistema existente. Permite usar aplicaciones, controladores, extensiones y herramientas estándar de PostgreSQL, lo que facilita migraciones sin fricciones y el uso de utilidades convencionales de administración y replicación.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🛡️ &lt;strong&gt;Seguridad y cumplimiento&lt;/strong&gt;: Diseñado para entornos con altos requisitos regulatorios o de compliance, donde la nube pública no siempre es una opción viable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;⚙️ &lt;strong&gt;Despliegue flexible&lt;/strong&gt;: Puede ejecutarse en data centers locales (on-premises), en máquinas virtuales, en Kubernetes o incluso en otras nubes públicas, ofreciendo una verdadera portabilidad híbrida y multicloud.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;📊 &lt;strong&gt;Gobernanza y control de datos&lt;/strong&gt;: Permite mantener la soberanía total sobre los datos, asegurando que las organizaciones decidan exactamente dónde residirán sus datos para cumplir con políticas estrictas de seguridad, residencia de datos y regulaciones.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🔍 &lt;strong&gt;Optimización de consultas&lt;/strong&gt;: Incluye un asesor de indexación inteligente, capaz de analizar las consultas más frecuentes y recomendar índices adicionales para mejorar el rendimiento global del sistema.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🤖 &lt;strong&gt;Funcionalidades de IA&lt;/strong&gt;: Incorpora &lt;strong&gt;AlloyDB AI&lt;/strong&gt;, que habilita la integración nativa con modelos de inteligencia artificial generativa, compatibles con Vertex AI y otros frameworks, ampliando las capacidades de análisis y automatización.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Casos de uso&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Modernización on-premises&lt;/strong&gt;: Para empresas que ya ejecutan PostgreSQL en sus propios centros de datos y buscan mejorar rendimiento y escalabilidad sin migrar inmediatamente a la nube. AlloyDB Omni permite también realizar una migración gradual y una distribución de cargas de trabajo entre entornos híbridos y multicloud.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Baja latencia y residencia de datos&lt;/strong&gt;: Ideal para aplicaciones que necesitan que los datos estén físicamente cerca de los usuarios o que deban cumplir con regulaciones estrictas de soberanía y residencia de datos, donde la nube pública no es viable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Desarrollo y pruebas locales&lt;/strong&gt;: Los equipos de desarrollo pueden contar con una experiencia local idéntica a la de AlloyDB en la nube, lo que acelera los ciclos de construcción, pruebas y validación antes de pasar a producción.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cumplimiento regulatorio&lt;/strong&gt;: Diseñado para organizaciones en sectores como banca, salud o gobierno, que deben operar bajo normativas estrictas de seguridad y compliance que limitan el uso de servicios en la nube pública.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusión&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;AlloyDB Omni&lt;/strong&gt; marca un movimiento estratégico clave de Google Cloud y un paso audaz hacia la democratización de las bases de datos de alto rendimiento. Al extender la innovación de AlloyDB más allá de los límites de su propia nube, brinda a las organizaciones la libertad de modernizar cargas de trabajo PostgreSQL bajo sus propios términos, sin importar dónde se encuentren, si en la nube, en entornos on-premises o en configuraciones híbridas.&lt;/p&gt;

&lt;p&gt;Con la promesa de mejorar el rendimiento, simplificar la gestión y preparar la infraestructura de datos para el futuro, AlloyDB Omni se posiciona como una alternativa que merece ser considerada. En definitiva, abre nuevas posibilidades para impulsar estrategias híbridas y multinube con mayor flexibilidad y control.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Recursos&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com" rel="noopener noreferrer"&gt;Documentación de AlloyDB Omni&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com" rel="noopener noreferrer"&gt;Información general sobre AlloyDB Omni&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com" rel="noopener noreferrer"&gt;Cómo instalar AlloyDB Omni&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com" rel="noopener noreferrer"&gt;AlloyDB Omni para Kubernetes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com" rel="noopener noreferrer"&gt;AlloyDB Omni para contenedores&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Espero sea de utilidad !!!&lt;/p&gt;

&lt;p&gt;Saludos,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Síguenos:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉&lt;a href="http://wiki-cloud.co/" rel="noopener noreferrer"&gt;Wiki Cloud&lt;/a&gt; | 👉&lt;a href="https://twitter.com/johnbulla" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; | 👉&lt;a href="https://www.linkedin.com/in/johnbulla" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; | 👉&lt;a href="https://www.youtube.com/user/johnbulla" rel="noopener noreferrer"&gt;Youtube&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>googlecloud</category>
      <category>postgres</category>
      <category>database</category>
      <category>alloydb</category>
    </item>
  </channel>
</rss>
