Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Agent builder.

TNT
Bronze 5
Bronze 5

Hello Communtiy , is this possible or the best way is to do this via the GUI without writing any code? 

Motivation

create a python code to handle all aspects of creating a generic search agent on vertex search AI.

1. create an app
2. create data store
3. query the app and get the answer via code
4. document internally

detailed steps

1. use agent builder to create a search app :

2. use agent builder to create a data store from gcs bucket:
for this task we are going to use a gcs bucket containing data set in TXT files.

Notice the ingestion is limited to 100 files. so just take small number of files which are easily loaded.

3. query via the UI " what is the status of ukraine war ?"
 

0 2 309
2 REPLIES 2

Hi @TNT,

Welcome to Google Cloud Community!

It's possible to create a search agent on Vertex AI Search using a combination of the UI and code. However, relying entirely on the UI for this level of complexity may be limiting. 

Here's a breakdown of approach using a blend of UI and Python code:

  1. Creating the Search App and Data Store
  • Agent Builder UI:
    • Create Search App: This step is best handled through the Agent Builder UI. It provides a user-friendly interface for defining the basic structure of your search app and connecting it to your data.
    • Define Indexing Schemas: Specify the structure of your data (e.g., fields, types, etc.) within the UI. This will guide the indexing process.
  • Python (Code):
    • Data Loading: Use the Vertex AI Search API to load your data from the GCS bucket. This allows you to manage larger data sets and implement custom file handling logic beyond the 100 file limit.
    • Data Preprocessing: Apply any necessary data transformations or cleaning before indexing. 
    • Index Data: Using the Vertex AI Search API, index your preprocessed data into the search app created in the UI.
  1. Querying the App and Retrieving Results
  • Agent Builder UI:
    • Query via UI: You can test queries using the Agent Builder's built-in search interface. This is helpful for initial exploration and debugging.
  • Python (Code):
    • Query Using API: For programmatic queries, use the Vertex AI Search API to execute queries and retrieve results. This provides maximum flexibility and allows you to integrate search into your applications.
    • Result Processing: Parse the results from the API and format them for your specific needs.
  1. Internal Documentation
  • Code Documentation: Use docstrings within your Python code to clearly document functions, classes, and the purpose of each section. This makes your code understandable for yourself and others.
  • Additional Documentation: Consider creating a separate documentation file to explain the overall architecture of your search agent, how to set it up, and how to use it.

Here are some additional essential factors to keep in mind:

  • Data Size: For very large data sets, consider using Vertex AI Search's batch indexing capabilities to optimize the indexing process.
  • Query Performance: Fine-tune your search parameters to achieve optimal query performance.
  • Security: Implement appropriate access control measures to protect your search app and data.

I hope the above information is helpful.

TNT
Bronze 5
Bronze 5

Thank you so much