Skip to content

Conversation

@jeremylongshore
Copy link
Contributor

Summary

This PR adds a tutorial notebook demonstrating how to deploy ADK agents to Vertex AI Agent Engine using inline source deployment.

Why this matters

Inline source deployment solves common issues with the default pickle-based deployment:

  • Avoids serialization errors with custom classes
  • Provides precise control over the deployment environment
  • Eliminates pickle compatibility issues across Python versions

What's included

  • Step-by-step tutorial using ADK 1.18+ (current version)
  • Simple agent with a tool (get_current_time)
  • Local testing before deployment
  • Deployment using AgentEngineApp.from_agent()
  • Testing the deployed agent
  • Cleanup instructions

Background

I built this pattern while developing a multi-agent system with ADK. The project is featured in Google's Agent Starter Pack community showcase (PR #580, merged).

Checklist

  • Follows notebook template structure
  • Includes copyright header
  • Has Colab Enterprise and GitHub links
  • Includes cost information
  • Has cleanup section

@jeremylongshore jeremylongshore requested a review from a team as a code owner December 12, 2025 03:46
@google-cla
Copy link

google-cla bot commented Dec 12, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jeremylongshore, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request adds a new tutorial notebook that guides users through the process of deploying Google Agent Development Kit (ADK) agents to Vertex AI Agent Engine using an inline source deployment method. This approach is crucial for complex agents, as it bypasses common serialization issues encountered with traditional pickle-based deployments, offering greater control over the deployment environment and ensuring compatibility. The tutorial covers the full lifecycle from agent creation and local testing to deployment and cleanup, making it a valuable resource for developers working with ADK and Agent Engine.

Highlights

  • New Tutorial Notebook: Introduces a comprehensive tutorial notebook demonstrating how to deploy ADK agents to Vertex AI Agent Engine using inline source deployment.
  • Inline Source Deployment Benefits: Highlights the advantages of inline source deployment, such as avoiding serialization errors with custom classes, providing precise control over the deployment environment, and eliminating pickle compatibility issues across Python versions.
  • Step-by-Step Guide: Provides a step-by-step guide covering agent creation with tools, local testing, deployment using AgentEngineApp.from_agent(), and testing the deployed agent.
  • Cleanup Instructions: Includes clear instructions for cleaning up deployed agents and staging buckets to manage costs.
  • Community Showcase Reference: Mentions that the pattern for inline source deployment was developed for a multi-agent system featured in Google's Agent Starter Pack community showcase.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a well-structured and informative tutorial notebook on deploying ADK agents using inline source deployment. The notebook is clear and follows a logical flow. I've identified a critical issue with an incorrect model name that will cause the notebook to fail, and I've also provided a few suggestions to improve code robustness and maintainability. Overall, this is a valuable contribution once these minor issues are addressed.

@jeremylongshore
Copy link
Contributor Author

I have signed the Google CLA. Please re-check.

@googlebot I signed it!

- Change model from gemini-2.0-flash to gemini-1.5-flash-001
- Improve exception handling with ZoneInfoNotFoundError
@jeremylongshore
Copy link
Contributor Author

Commits have been rebased with the correct GitHub email (jeremylongshore@users.noreply.github.com). CLA should pass now.

@googlebot I signed it!

- Use specific ZoneInfoNotFoundError exception instead of generic Exception
- Define REQUIREMENTS variable once and reuse to avoid duplication
- Keep generic Exception as fallback for unexpected errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@gericdong
Copy link
Contributor

@jeremylongshore please fix the failing checks.
For cla, you may not be using the email associated with your CLA in your Git commits. Check https://help.github.com/articles/setting-your-email-in-git/ matches the email associated with your CLA (https://cla.developers.google.com/clas).

@jeremylongshore
Copy link
Contributor Author

Fixed! The issue was a Co-Authored-By: Claude <noreply@anthropic.com> line in one of the commit messages that was triggering the CLA check. I've removed it and force-pushed the fix.

All commits now use jeremylongshore@users.noreply.github.com which is associated with my signed CLA.

@googlebot I signed it!

@jeremylongshore
Copy link
Contributor Author

@googlebot I signed it!

1 similar comment
@jeremylongshore
Copy link
Contributor Author

@googlebot I signed it!

@jeremylongshore
Copy link
Contributor Author

@googlebot I signed it!

@jeremylongshore
Copy link
Contributor Author

Thank you for your patience, @gericdong. The CLA check is now passing.

I see the notebook format/lint check is failing - I'll run the linter and push the fixes. Appreciate your guidance.

@jeremylongshore
Copy link
Contributor Author

Hi @gericdong, I wanted to clarify the lint check failure.

What I found:

  • The notebook passes when run through Google's official Docker linter:

    docker run -v ${PWD}:/setup/app gcr.io/cloud-devrel-public-resources/notebook_linter:latest notebooks/community/agent_engine/adk_inline_source_deployment.ipynb
    

    Result: Notebook lint finished with return code = 0

  • The CI failure is a pyupgrade bug when running on Python 3.14.2:

    TypeError: cannot use a bytes pattern on a string-like object
    

    This error is in pyupgrade's internal code (tokenize.cookie_re.match), not triggered by anything specific in the notebook.

Question:
Is there a way to re-run the CI, or would you have any other suggestions? Happy to make any changes needed.

Thank you for your time.

@gericdong gericdong merged commit 996b653 into GoogleCloudPlatform:main Jan 13, 2026
4 of 5 checks passed
@gericdong
Copy link
Contributor

The linter test has been fixed. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants