Copied to Clipboard
Multi Agent Design
The multi-agent deployment consists of 5 agents:
- Researcher
- Judge
- Orchestrator
- Content Builder
- Course Builder
An overview of the multi-agent system can be found here:
Multi-Agent A2A with the Agent Development Kit(ADK), Cloud Run, Agent Skills, and Gemini CLI
Running/Testing/Debugging Locally
The main Makefile has been extended with extensive targets for managing the agents on the local development environment.
The key targets include:
xbill@penguin:~/gemini-cli-azure/multi-functions$make help
✦ The available make commands are:
┌────────────────────┬────────────────────────────────────────────────────┐
│ Command │ Description │
├────────────────────┼────────────────────────────────────────────────────┤
│ install │ Install all dependencies for root, agents, and app │
│ start, run │ Start all services locally │
│ stop │ Stop all local services │
│ status │ Show status of local services and Azure Functions │
│ local │ Show local service URLs │
│ test │ Run all tests (pytest) │
│ e2e-test │ Run E2E test against local environment │
│ e2e-test-functions │ Run E2E test against Azure Functions endpoint │
│ deploy │ Deploy all-in-one container to Azure Functions │
│ destroy │ Delete Azure Functions resources │
│ endpoint │ Show Azure Functions endpoint │
│ lint │ Run linting checks (ruff) │
│ clean │ Remove caches and logs │
└────────────────────┴────────────────────────────────────────────────────┘
First check for local running agents:
xbill@penguin:~/gemini-cli-azure/multi-functions$make status
Checking status of locally running agents and servers...
--- Network Status ---
No services listening on expected ports (8000-8004, 5173).
--- Process Status ---
No matching processes found.
Then all the agents can be started together:
xbill@penguin:~/gemini-cli-azure/multi-functions$make start
Stopping any existing agent and server processes...
Starting all agents in background...
Waiting for sub-agents to start...
All agents started. Logs: researcher.log, judge.log, content_builder.log, orchestrator.log
Starting App Backend in background...
Starting Frontend dev server in background...
All services started. Logs: researcher.log, judge.log, content_builder.log, orchestrator.log, backend.log, frontend.log
Frontend: http://localhost:5173
Backend: http://localhost:8000
xbill@penguin:~/gemini-cli-azure/multi-functions$
make status
Checking status of locally running agents and servers...
--- Network Status ---
tcp 0 0 0.0.0.0:5173 0.0.0.0:* LISTEN 10245/node
tcp 0 0 0.0.0.0:8001 0.0.0.0:* LISTEN 9690/python3
tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN 10031/python3
tcp 0 0 0.0.0.0:8003 0.0.0.0:* LISTEN 9696/python3
tcp 0 0 0.0.0.0:8002 0.0.0.0:* LISTEN 9695/python3
tcp 0 0 0.0.0.0:8004 0.0.0.0:* LISTEN 10019/python3
--- Process Status ---
xbill 9687 0.0 0.0 2584 1628 pts/1 S 21:03 0:00 /bin/sh -c /bin/bash -c "source .env 2>/dev/null || true; \ /home/xbill/.pyenv/shims/python3 -m shared.adk_app --host 0.0.0.0 --port 8001 --a2a agents/researcher"
The entire project can be linted and tested as unit:
xbill@penguin:~/gemini-cli-azure/multi-functions$make lint
ruff check .
All checks passed!
>make test
✦ The test suite ran successfully. All 30 tests passed with 5 experimental feature warnings.
And end to end tested:
make e2e-test
│ E2E Test Completed successfully! │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ The end-to-end test ran successfully. The orchestrator coordinated with the researcher, judge, and content builder
agents to generate a full Markdown course about the history of the internet, and streamed the result back over the API
endpoint.
Then connect to the local front end:
And the entire agent system will run in the local environment:
Local Logging / Debugging
Gemini CLI has full access to the local agent logs for debugging and troubleshooting:
✦ I've analyzed the logs from your e2e run. All agents (researcher, judge, content_builder, orchestrator) and both frontend and backend services
started successfully. The course creation pipeline ran as expected: the orchestrator initiated the "history of the internet" course, the researcher
gathered information, the judge approved it, and the content builder generated the course content.
Deploying to Azure Functions
The project level Makefile has targets for managing the Agent deployment to serverless endpoints:
xbill@penguin:~/gemini-cli-azure/multi-aci$az login
A web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.
A utility script check the deployment to Azure ACI:
✦ I ran make status (as make status-functions isn't a defined target in the Makefile, but make status achieves the same
goal).
Here is the status of your Azure Functions deployment:
Azure Functions Status:
* Name: adk-penguin-func
* Location: West US 2
* State: Running
* ResourceGroup: adk-rg-functions
* DefaultHostName: adk-penguin-func.azurewebsites.net
* AppServicePlan: adk-plan-penguin
The function app is currently up and running. If you want to get the direct URL to the endpoint, you can use make
endpoint.
You can then deploy the services:
make deploy
Full Log Output: │
│ ./single-container/deploy.sh │
│ === Azure Functions All-in-One Deployment === │
│ Resource Group: adk-rg-functions │
│ ACR Name: adkacrpenguinx4ocqm │
│ Storage Name: adkstoragepenguinx4ocqm │
│ Function Name: adk-penguin-func │
│ ============================= │
Once the containers are deployed- you can then get the endpoint:
>make status
Remote Environment (Azure):
- Function App adk-penguin-func is Running in the adk-rg-functions resource group.
- The default hostname is adk-penguin-func.azurewebsites.net.
And check the endpoint:
>make endpoint
✦ The deployed Azure Function App endpoint is:
https://adk-penguin-func.azurewebsites.net
Test End to End in A
The entire agent system is tested on the remote Azure endpoint:
The end-to-end test against the Azure Function App completed successfully!
The system correctly executed the following steps:
1. Orchestrator Selection: The updated AGENT_NAME=orchestrator setting ensured the full pipeline was invoked.
2. Research Phase: The Researcher agent gathered comprehensive information on the history of the internet, including
early concepts like packet switching and ARPANET.
3. Judge Phase: The Judge agent evaluated the research findings for quality and completeness.
4. Content Builder Phase: The Content Builder agent transformed the validated research into a well-structured,
multi-module Markdown course.
The final course, titled "The History and Impact of the Internet", is now available and verified on the cloud
environment.
Running the Web Interface
Start a connection to the Cloud Run deployed app:
https://adk-penguin-func.azurewebsites.net
Then connect to the app :
Then use online course generator:
Final Gemini CLI Code Review
As a final step — Gemini CLI was used for a full code review of the project:
Overall Code Review Summary
After reviewing the app and agents directories, I can say this is an exceptionally well-engineered multi-agent system.
High-Level Architecture:
The architecture is sophisticated and effective. The use of a main orchestrator to manage a pipeline of specialized agents (researcher, judge,
content_builder) is a strong and scalable pattern. The inclusion of a research-and-refine loop with the judge agent is a standout feature that
significantly enhances the quality of the final output.
Key Strengths:
1. Expert ADK Usage: The project demonstrates a deep understanding of the Google ADK, using advanced features like SequentialAgent, LoopAgent,
RemoteA2aAgent, structured Pydantic outputs, and agent callbacks to their full potential.
2. Excellent Prompt Engineering: The instruction prompts for all agents are clear, specific, and well-crafted. This is the foundation of the
system's success.
3. Robust State Management: The custom StateCapturer agent is a brilliant, reusable utility that cleanly handles the flow of information between
agents.
4. Production-Ready Features: The system includes production-grade features like environment-aware authentication for service-to-service calls,
robust error handling, and detailed logging.
Summary
The Agent Development Kit (ADK) was used to build a multi-agent system with A2A support using the Gemini Flash LLM Model. This application was tested locally with Gemini CLI and then deployed to Azure Functions. Several key take-aways and lessons learned were summarized from debugging and testing the multi-agent system- including deep log reviews. Finally, Gemini CLI was used for a complete project code review.