Local Testing for Multi-Agent Systems on Google Cloud

Local Testing for Multi-Agent Systems on Google Cloud

Dev Signal, a multi-agent system designed to convert raw community signals into actionable technical guidance, is making strides in enhancing the developer experience on Google Cloud. This article focuses on the local testing phase of the system, ensuring all components work harmoniously before deployment.

Prior to migrating to Google Cloud Run, it is vital to confirm that the agent's specialized components function correctly on a local workstation. This local testing phase allows developers to validate trend discovery, technical grounding, and creative drafting, optimizing the development process.

Setting Up the Environment

To begin, create a .env file in the project root. This file contains variables for local development that will later be replaced by Terraform or Secret Manager in production. The GOOGLE_CLOUD_LOCATION should be set to global, as it is where certain features are supported.

Helper Utilities

Establish a new directory for application utilities. This module will help standardize how the agent discovers the active Google Cloud Project and Region, facilitating a smooth transition between development environments.

Local Testing Script

The Google ADK includes a built-in Web UI for visualizing agent logic. However, to test long-term memory integration, utilize the test_local.py script, which initializes the VertexAiMemoryBankService. This script connects to the real Vertex AI Agent Engine in the cloud for memory storage while using an in-memory session service for local chat history.

Running the Test

Before executing the test, ensure that Application Default Credentials are set up. Run the test_local.py script to initiate a chat loop with the agent, allowing for interaction and testing of memory retrieval.

Test Scenario Overview

The test scenario encompasses the complete lifecycle of the agent, from discovery and research to content creation and long-term memory retrieval.

Phase 1: Teaching & Multimodal Creation

  1. Discovery: Ask the agent to find trending topics related to Cloud Run.
  2. Research: Instruct the agent to research a specific topic.
  3. Personalization: Request a blog post with a specific stylistic preference.
  4. Image Generation: Generate an image illustrating the blog's main ideas.

Phase 2: Long-Term Memory Recall

  1. Start a fresh session by typing new in the console.
  2. Inquire about stored preferences to test the Vertex AI memory bank.
  3. Verify that the agent retrieves the correct preferences from the cloud.

Finally, request a new blog on a different topic to ensure it is written in the preferred style without prompting.

Conclusion

This guide highlighted the importance of local testing for the multi-agent system, confirming that core functionalities are integrated before cloud deployment. By setting up local secrets and utilizing environment-aware utilities, developers can ensure that the agent retrieves preferences accurately from the cloud-based memory bank.

This editorial summary reflects Google and other public reporting on Local Testing for Multi-Agent Systems on Google Cloud.

Reviewed by WTGuru editorial team.