-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Describe the bug
A previous great bug fix allow to use VertexAISearch with another tools:
4485379
However, testing and deep diving into it lead me to understand a lazy and partial implementation.
Let me explain.
First, the implementation assume that all Datastore use CHUNKS.
| search_result_mode=discoveryengine.SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS, |
It's a bad assumption, users can/could prefer document mode.
Same for the chunk space just after.
In addition, when the result is processed, 2 problems
-
Chunks are the only possible answer
chunk = item.chunk -
The structData are not taken into account
https://cloud.google.com/generative-ai-app-builder/docs/prepare-data#storage-unstructured
The code only take into account the GCS uri (from document metadata)
| "url": chunk.document_metadata.uri, |
Here the problem I have with my own search (only a chunk element as example
"chunk": {
"name": "projects/630841691860/locations/global/collections/default_collection/dataStores/data-store-phenix-confluence/branches/0/documents/66983245/chunks/c11",
"id": "c11",
"content": "<REDACTED>",
"documentMetadata": {
"uri": "gs://vg1np-pf-phenix-rec-7f-care-bucket/phenix-extract/2025-08-22/content/66983245.html",
"title": "66983245",
"structData": {
"uri": "https://confluence.agilefabric.fr.carrefour.com/pages/viewpage.action?pageId=66983245",
"title": "Listes de valeurs (List of Values)",
"space": "PHENIX Team"
}
},
"relevanceScore": 0.58030599355697632
}
}
The TRUE uri is in the structData part, but now the agent return the gs:// one. Totally useless...
(Same for the title, by the way ....)
So now, I have the choice between
- Only VertexAISearchTool agent which works correctly
- Multi tools agent whith broken search.
To Reproduce
No real streamlined way to reproduce it:
- Create a VertexAI Search environment in DOCUMENT mode to validate the CHUNKS mode fail
- Create a VertexAI Search environment in CHUNKS mode with structData as mentionned here https://cloud.google.com/generative-ai-app-builder/docs/prepare-data#storage-unstructured
Then
- Create an agent with a VertexAISearchTool
- Run the agent and validate the correct search with the 2 created search engines
- Create a multi-tool agent, for instance a root agent with your previous agent as sub-agent
- Re-run the previous tests on the 2 created search engines and validate my description
Expected behavior
A full support of discovery engine tool, even if the VertexAISeach tool disappear and only the new one live, with full configuration, and correct support of all options
Desktop (please complete the following information):
- OS: Not relevant
- Python version: 3.13.8
- ADK version: 1.16.0
Model Information:
Gemini 2.5 pro