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

Agent Builder App with Multiple Datastore

In the agent builder tool, is it possible to configure a data source that combines both documents and website data? If so, could you provide an overview of how to set up such a combined data source, including any best practices or considerations to ensure seamless integration and optimal performance?

1 1 241
1 REPLY 1

Hi @nrohan988,

Welcome to Google Cloud Community!

No, Vertex AI Agent Builder doesn't directly support combining document and website data sources into a single, unified data source within the tool itself. The data connectors are largely separated. You can connect to document stores (like Cloud Storage) and website data through web scraping or APIs, but you can't merge these into a single "data source" object within the Agent Builder's interface.

To achieve a combined data source effect, you need a pre-processing step outside of Agent Builder. This involves fetching data from both sources, processing it, and then feeding the combined processed data to Agent Builder through a supported data connector (like a structured database or a document store).

Here's a breakdown of how you could approach this:

  1. Data Acquisition and Preprocessing:
  • Document Data: Use a connector within Agent Builder (like Cloud Storage) to ingest documents. These documents would need to be processed into a structured format (e.g., extracting key-value pairs, summarizing content) using tools like:
    • Vertex AI Document AI: Excellent for extracting information from various document types.
    • Custom Python scripts: Provide more control over the data extraction and transformation process. You might use libraries like langchain for this.
  • Website Data: You'll likely need a custom solution here:
    • Web scraping: Use libraries like Beautiful Soup and Scrapy in Python to extract relevant data from websites. This requires careful consideration of website terms of service and robots.txt.
    • APIs: If the website offers an API, this is the preferred method as it's more robust and less likely to break due to website changes.
  • Data Transformation and Integration: Once you've extracted data from both sources, you need to unify it into a consistent format. This often involves:
    • Data cleaning: Handling missing values, inconsistencies, and errors.
    • Data standardization: Ensuring that data from both sources uses the same format and units.
    • Data merging: Combining the data from documents and websites into a single dataset. This could be a structured database (e.g., Cloud SQL), a large language model (LLM) friendly format like JSON, or a vector database (e.g., Pinecone, Weaviate) if you need semantic search capabilities.
  1. Feeding the Combined Data to Agent Builder:

After preprocessing, you'll upload your unified dataset to a data connector supported by Agent Builder. Common options include:

  • Cloud Storage: Store your data in a structured format (e.g., JSONL, CSV) and point Agent Builder to this location. Agent Builder may not be able to handle extremely large files directly, so consider chunking your data if necessary.
  • Cloud SQL: If your data is relational, a database like Cloud SQL provides better scalability and query performance.
  • Document AI's knowledge connector: If your data is highly structured after processing, the Document AI connector might be the most efficient method.
  1. Best Practices and Considerations:
  • Data Quality: The quality of your combined data directly impacts the performance of your agent. Invest time in data cleaning and validation.
  • Scalability: Design your data processing pipeline to handle large datasets efficiently. Consider using cloud-based solutions for scalability and reliability.
  • Error Handling: Implement robust error handling in your data processing scripts to prevent failures.
  • Regular Updates: If your data sources are dynamic (e.g., websites that frequently update), you'll need to regularly update your combined dataset.
  • Security: Securely store and manage your data, especially sensitive information extracted from websites.
  • Cost Optimization: Be mindful of the costs associated with data storage, processing, and cloud services.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.