python -m venv .venv
source .venv/bin/activate
pip install google-adk
mkdir agentic-apps
mkdir renovation-agent
renovation-agent/
__init__.py
agent.py
requirements.txt
.env
The agent code is from https://github.com/AbiramiSukumaran/adk-renovation-single-agent/blob/main/agent.py
A storage bucket to be created https://cloud.google.com/storage/docs/creating-buckets#console
Single agent System Source Code Explanation
The agent.py file defines the structure and behavior of our kitchen renovation multi-agent system using the Agent Development Kit (ADK). Let's break down the key components:
Agent Definition
Root Agent (Orchestrator): proposal_agent
The root_agent acts as the orchestrator of this single-agent system. It receives the initial renovation request and determines which tools to invoke based on the request's needs.
The root_agent then collects the responses from the tools and combines them to provide a comprehensive response to the user. In this case we just have one tool "store_pdf".
7. Data Flow & Key Concepts
The user initiates a request through the ADK interface (either the terminal or the web UI).
The request is received by the root_agent.
The root_agent analyzes the request and routes it to the tool as and when required.
The tool "store_pdf" is designed to write the renovated text content to a PDF file, then upload it to Google Cloud Storage.
This then returns the response to the root_agent.
The root_agent combines the responses and provides a final output to the user.
LLMs (Large Language Models)
The agents rely heavily on LLMs to generate text, answer questions, and perform reasoning tasks. The LLMs are the "brains" behind the agents' ability to understand and respond to user requests. We are using Gemini 2.5 in this application.
Google Cloud Storage
Used to store the generated renovation proposal documents. You need to create a bucket and grant the necessary permissions for the agents to access it.
Cloud Run (Optional)
The OrderingAgent uses a Cloud Run function to interface with AlloyDB. Cloud Run provides a serverless environment to execute code in response to HTTP requests.
AlloyDB
If you're using the OrderingAgent, you'll need to set up an AlloyDB database to store order information.
.env file
The .env file stores sensitive information like API keys, database credentials, and bucket names. It's crucial to keep this file secure and not commit it to your repository. It also stores configuration settings for the agents and your Google Cloud project. The root_agent or supporting functions will typically read values from this file. Make sure all required variables are properly set in the .env file. This includes the Cloud Storage bucket name
Your agent's ability to understand user requests and generate responses is powered by a Large Language Model (LLM). Your agent needs to make secure calls to this external LLM service, which requires authentication credentials. Without valid authentication, the LLM service will deny the agent's requests, and the agent will be unable to function.
Get an API key from Google AI Studio.
In the next step where you set up the .env file, replace <<your API KEY>> with your actual API KEY value.
GOOGLE_GENAI_USE_VERTEXAI=FALSE
GOOGLE_API_KEY=<<your API KEY>>
GOOGLE_CLOUD_LOCATION = us-central1 <<or your region>>
GOOGLE_CLOUD_PROJECT = <<your project id>>
PROJECT_ID = <<your project id>>
GOOGLE_CLOUD_REGION=us-central1 <<or your region>>
STORAGE_BUCKET = next-demo-store <<or your storage bucket name>>
cd agentic-apps/renovation-agent
pip install -r requirements.txt
adk run .
adk web
user>>
Hello. Generate Proposal Document for the kitchen remodel requirement in a proper format that applies to a renovation contract. Remember this text will eventually be stored as a pdf file so make sure to have the formatting appropriate. I have no other specification.
references:
https://codelabs.developers.google.com/your-first-agent-with-adk#10
No comments:
Post a Comment