Unable to deploy ADK Agent to Vertex AI Agent Engine due to type incompatibility
Describe the bug
When trying to deploy an agent created with ADK using the agent_engines.create method from the Vertex AI SDK, the following type error occurs:
Argument of type "Agent" cannot be assigned to parameter "agent_engine" of type "Queryable | OperationRegistrable | None" in function "create"
"Agent" cannot be assigned to type "Queryable | OperationRegistrable | None"
"LlmAgent" is incompatible with protocol "Queryable"
"query" is missing
"LlmAgent" is incompatible with protocol "OperationRegistrable"
"register_operations" is missing
"LlmAgent" cannot be assigned to "None"
To Reproduce
Steps to reproduce the error:
-
Install the dependencies:
pip install google-adk google-cloud-aiplatform -
Create an agent with ADK:
from google.adk.agents import Agent
root_agent = Agent(
name="metereology_agent",
model="gemini-2.5-flash",
instruction="...",
description="...",
tools=[]
)
- Try to deploy with Agent Engine:
from vertexai import agent_engines
remote_app = agent_engines.create(
agent_engine=root_agent,
requirements=["google-cloud-aiplatform[agent_engines,adk]"],
)
OR
from vertexai import agent_engines
remote_app = agent_engines.create(
agent_engine=app,
requirements=["google-cloud-aiplatform[agent_engines,adk]"],
)
- See the type error above
Expected behavior
It was expected to be possible to deploy an agent created with ADK directly to the Vertex AI Agent Engine, as suggested by the documentation and the integration between the libraries. Screenshots Not applicable, type error at development time. Desktop (please complete the following information): OS: macOS Sonoma 14.5 Python version: 3.12.7 ADK version: 1.7.0 Model Information: Model: gemini-2.0-flash Additional context The error suggests that the Agent type from ADK does not implement the expected protocols (Queryable or OperationRegistrable) required by the agent_engines.create method.
Hi @rlucasfm ,
Could you try
from vertexai.preview import reasoning_engines
Instead of
from vertexai import agent_engines
?
Hi @rlucasfm ,
Could you try
from vertexai.preview import reasoning_enginesInstead of
from vertexai import agent_engines?
So, should I use Reasoning Engine instead of Agent Engine when deploying? I could successfully deploy it even with the error, and it's somewhat working with Agent Engine.
I can't use reasoning_engines.create(...) tho
Hi @rlucasfm, could you share the version of google-cloud-aiplatform you are using? in theory the latest version should support deploying the ADK agent directly using from vertexai import agent_engines and agent_engines.create.
To deploy to agent engine, you do not need to pass an agent for a parameter called agent_engine.
Your current code:
remote_app = agent_engines.create(
agent_engine=root_agent,
requirements=["google-cloud-aiplatform[agent_engines,adk]"],
)
should change to:
remote_app = agent_engines.create(
root_agent,
requirements=["google-cloud-aiplatform[agent_engines,adk]"],
)
I was able to deploy to agent_engine recently like so^
See a LangchainAgent deployed like so here: https://colab.research.google.com/github/GoogleCloudPlatform/generative-ai/blob/main/gemini/agent-engine/intro_agent_engine.ipynb
Hi @rlucasfm and thanks to everyone who participated in this thread.
We're currently doing some housekeeping on our issue tracker. Given the rapid pace of development and the number of updates since this was last active, there's a good chance this issue has been resolved in a newer version. To help us keep our backlog focused on current issues, we are closing this as stale.
If you're still facing this problem, could you please update to the very latest version of the library and confirm the issue still exists? If it does, please comment here, and we will be happy to reopen this issue and investigate further.
Thanks for your contribution and understanding!