Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions samples/agentic-strands/app/Dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion samples/agentic-strands/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ services:
# domainname: example.com
build:
context: ./app
dockerfile: Dockerfile
ports:
- target: 5001
published: 5001
Expand Down
27 changes: 27 additions & 0 deletions samples/google-adk/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Default .dockerignore file for Defang
**/__pycache__
**/.direnv
**/.DS_Store
**/.envrc
**/.git
**/.github
**/.idea
**/.next
**/.vscode
**/compose.*.yaml
**/compose.*.yml
**/compose.yaml
**/compose.yml
**/docker-compose.*.yaml
**/docker-compose.*.yml
**/docker-compose.yaml
**/docker-compose.yml
**/node_modules
**/Thumbs.db
Dockerfile
*.Dockerfile
# Ignore our own binary, but only in the root to avoid ignoring subfolders
defang
defang.exe
# Ignore our project-level state
.defang
6 changes: 6 additions & 0 deletions samples/google-adk/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Fill in your GCP project info and rename this file to ".env".

GOOGLE_GENAI_USE_VERTEXAI=1
GOOGLE_CLOUD_PROJECT=<YOUR_PROJECT_ID>
GOOGLE_CLOUD_LOCATION=<YOUR_PROJECT_LOCATION>
GOOGLE_CLOUD_STORAGE_BUCKET=<YOUR_STORAGE_BUCKET> # Only required for deployment on Agent Engine
60 changes: 60 additions & 0 deletions samples/google-adk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Google ADK Sample

[![1-click-deploy](https://raw.githubusercontent.com/DefangLabs/defang-assets/main/Logos/Buttons/SVG/deploy-with-defang.svg)](https://portal.defang.dev/redirect?url=https%3A%2F%2Fgithub.com%2Fnew%3Ftemplate_name%3Dsample-google-adk-template%26template_owner%3DDefangSamples)

This is a simple sample demonstrating how to deploy agents build with Google ADK to Defang.

## Prerequisites

1. Download [Defang CLI](https://github.com/DefangLabs/defang)
2. (Optional) If you are using [Defang BYOC](https://docs.defang.io/docs/concepts/defang-byoc) authenticate with your cloud provider account
3. (Optional for local development) [Docker CLI](https://docs.docker.com/engine/install/)


## Development

To run the application locally, you can use the following command:

```bash
docker compose up --build
```

## Deployment

> [!NOTE]
> Download [Defang CLI](https://github.com/DefangLabs/defang)

### Defang Playground

Deploy your application to the Defang Playground by opening up your terminal and typing:
```bash
defang compose up
```

### BYOC (GCP)

If you want to deploy to your own cloud account, you can use Defang BYOC:

1. [Authenticate your GCP account](https://cloud.google.com/sdk/docs/quickstart).
2. Run in a terminal that has access to your GCP project id:
```bash
GCP_PROJECT_ID=my-project-12345 defang --provider=gcp compose up

### BYOC (AWS)

If you want to deploy to your own cloud account, you can use Defang BYOC:

1. [Authenticate your AWS account](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html), and check that you have properly set your environment variables like `AWS_PROFILE`, `AWS_REGION`, `AWS_ACCESS_KEY_ID`, and `AWS_SECRET_ACCESS_KEY`.
2. Run in a terminal that has access to your AWS environment variables:
```bash
defang --provider=aws compose up

---

Title: Google ADK

Short Description: A simple sample demonstrating how to deploy agents build with Google ADK to Defang.

Tags: Google ADK, Python, Agents

Languages: python
33 changes: 33 additions & 0 deletions samples/google-adk/academic-research.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions samples/google-adk/academic_research/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Academic_Research: Research advice, related literature finding, research area proposals, web knowledge access."""

from . import agent
45 changes: 45 additions & 0 deletions samples/google-adk/academic_research/agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Academic_Research: Research advice, related literature finding, research area proposals, web knowledge access."""

from google.adk.agents import LlmAgent
from google.adk.tools.agent_tool import AgentTool

from . import prompt
from .sub_agents.academic_newresearch import academic_newresearch_agent
from .sub_agents.academic_websearch import academic_websearch_agent

MODEL = "gemini-2.5-pro"


academic_coordinator = LlmAgent(
name="academic_coordinator",
model=MODEL,
description=(
"analyzing seminal papers provided by the users, "
"providing research advice, locating current papers "
"relevant to the seminal paper, generating suggestions "
"for new research directions, and accessing web resources "
"to acquire knowledge"
),
instruction=prompt.ACADEMIC_COORDINATOR_PROMPT,
output_key="seminal_paper",
tools=[
AgentTool(agent=academic_websearch_agent),
AgentTool(agent=academic_newresearch_agent),
],
)

root_agent = academic_coordinator
70 changes: 70 additions & 0 deletions samples/google-adk/academic_research/prompt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Prompt for the academic_coordinator_agent."""


ACADEMIC_COORDINATOR_PROMPT = """
System Role: You are an AI Research Assistant. Your primary function is to analyze a seminal paper provided by the user and
then help the user explore the recent academic landscape evolving from it. You achieve this by analyzing the seminal paper,
finding recent citing papers using a specialized tool, and suggesting future research directions using another specialized
tool based on the findings.

Workflow:

Initiation:

Greet the user.
Ask the user to provide the seminal paper they wish to analyze as PDF.
Seminal Paper Analysis (Context Building):

Once the user provides the paper information, state that you will analyze the seminal paper for context.
Process the identified seminal paper.
Present the extracted information clearly under the following distinct headings:
Seminal Paper: [Display Title, Primary Author(s), Publication Year]
Authors: [List all authors, including affiliations if available, e.g., "Antonio Gulli (Google)"]
Abstract: [Display the full abstract text]
Summary: [Provide a concise narrative summary (approx. 5-10 sentences, no bullets) covering the paper's core arguments, methodology, and findings.]
Key Topics/Keywords: [List the main topics or keywords derived from the paper.]
Key Innovations: [Provide a bulleted list of up to 5 key innovations or novel contributions introduced by this paper.]
References Cited Within Seminal Paper: [Extract the bibliography/references section from the seminal paper.
List each reference on a new line using a standard citation format (e.g., Author(s). Title. Venue. Details. Date.).]
Find Recent Citing Papers (Using academic_websearch):

Inform the user you will now search for recent papers citing the seminal work.
Action: Invoke the academic_websearch agent/tool.
Input to Tool: Provide necessary identifiers for the seminal paper.
Parameter: Specify the desired recency. Ask the user or use a default timeframe, e.g., "papers published during last year"
(e.g., since January 2025, based on the current date April 21, 2025).
Expected Output from Tool: A list of recent academic papers citing the seminal work.
Presentation: Present this list clearly under a heading like "Recent Papers Citing [Seminal Paper Title]".
Include details for each paper found (e.g., Title, Authors, Year, Source, Link/DOI).
If no papers are found in the specified timeframe, state that clearly.
The agent will provide the answer and i want you to print it to the user

Suggest Future Research Directions (Using academic_newresearch):
Inform the user that based on the seminal paper from the seminal paper and the recent citing papers provided by the academic_websearch agent/tool,
you will now suggest potential future research directions.
Action: Invoke the academic_newresearch agent/tool.
Inputs to Tool:
Information about the seminal paper (e.g., summary, keywords, innovations)
The list of recent citing papers citing the seminal work provided by the academic_websearch agent/tool
Expected Output from Tool: A synthesized list of potential future research questions, gaps, or promising avenues.
Presentation: Present these suggestions clearly under a heading like "Potential Future Research Directions".
Structure them logically (e.g., numbered list with brief descriptions/rationales for each suggested area).

Conclusion:
Briefly conclude the interaction, perhaps asking if the user wants to explore any area further.

"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Academic_websearch_agent for finding research papers using search tools."""

from .agent import academic_newresearch_agent
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Academic_newresearch_agent for finding new research lines"""

from google.adk import Agent

from . import prompt

MODEL = "gemini-2.5-pro"

academic_newresearch_agent = Agent(
model=MODEL,
name="academic_newresearch_agent",
instruction=prompt.ACADEMIC_NEWRESEARCH_PROMPT,
)
Loading
Loading