Skip to content

Conversation

10Ala10
Copy link
Contributor

@10Ala10 10Ala10 commented Aug 30, 2025

Summary

Enhanced Vertex AI Search functionality to support multiple datastores while maintaining full backward compatibility. Previously only supported single datastore strings, now supports both single strings and lists of datastore IDs for cross-knowledge-base search capabilities.

Key changes:

  • Updated vertexai_search_datastore type from Optional[str] to Optional[Union[str, List[str]]]
  • Refactored validation and tool creation logic to handle multiple datastores cleanly
  • Each datastore is now added as a separate tool, enabling the model to search across multiple knowledge bases simultaneously

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Improvement
  • Model update
  • Other:

Checklist

  • Code complies with style guidelines
  • Ran format/validation scripts (./scripts/format.sh and ./scripts/validate.sh)
  • Self-review completed
  • Documentation updated (comments, docstrings)
  • Examples and guides: Relevant cookbook examples have been included or updated (if applicable)
  • Tested in clean environment
  • Tests added/updated (if applicable)

Additional Notes

Usage Examples:

Single Datastore (Backward Compatible):

Gemini(
    vertexai_search=True,
    vertexai_search_datastore="projects/project/locations/location/collections/collection/dataStores/datastore"
)

Multiple Datastores (New Feature):

Gemini(
    vertexai_search=True,
    vertexai_search_datastore=[
        "projects/project/locations/location/collections/collection/dataStores/datastore1",
        "projects/project/locations/location/collections/collection/dataStores/datastore2",
        "projects/project/locations/location/collections/collection/dataStores/datastore3"
    ]
)

Technical Implementation:

  • Each datastore becomes a separate VertexAISearch tool
  • Maintains full backward compatibility with existing single datastore usage

Files Modified:

  • libs/agno/agno/models/google/gemini.py: Main implementation and documentation

This enhancement enables users to leverage multiple Vertex AI Search datastores in a single agent, greatly expanding the knowledge base search capabilities while keeping the API simple and intuitive.

- Updated `vertexai_search_datastore` to accept a single string or a list of strings for datastore IDs.
- Added validation and logging for datastore entries.
- Improved documentation to clarify usage of the `vertexai_search_datastore` parameter.

This change allows the model to search across multiple knowledge bases, enhancing its functionality.
@10Ala10 10Ala10 requested a review from a team as a code owner August 30, 2025 11:14
Copy link
Contributor

@dirkbrnd dirkbrnd left a comment

Choose a reason for hiding this comment

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

Thanks for this! Would you mind adding a cookbook example? Or even better, a test.

@10Ala10
Copy link
Contributor Author

10Ala10 commented Sep 1, 2025

Yes for sure , I'll add it!

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.

3 participants