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-appservice$make help
Available commands:
--- Local Development ---
install - Install all dependencies for root, agents, and app
start - Start all services locally (alias for start-local)
stop - Stop all local services (alias for stop-local)
run - Start all services locally
status - Show status of local services
local - Show local service URLs
test - Run all tests (pytest)
lint - Run linting checks (ruff)
--- Azure ACI ---
deploy-aci - Deploy all services to Azure Container Instances (ACI)
destroy-aci - Delete ACI resources
status-aci - Show ACI status (alias: az-status)
endpoint-aci - Show ACI service endpoint (alias: endpoint)
test-e2e-aci - Run ACI E2E test
--- Shared Azure ---
az-login - Login to Azure CLI
acr-login - Login to ACR
acr-create - Create/Verify ACR and Resource Group
clean - Remove caches and logs
First check for local running agents:
xbill@penguin:~/gemini-cli-azure/multi-appservice$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-appservice$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-appservice$make status
Checking status of locally running agents and servers...
--- Network Status ---
tcp 0 0 0.0.0.0:8004 0.0.0.0:* LISTEN 8177/python3
tcp 0 0 0.0.0.0:8002 0.0.0.0:* LISTEN 7851/python3
tcp 0 0 0.0.0.0:8003 0.0.0.0:* LISTEN 7850/python3
tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN 8185/python3
tcp 0 0 0.0.0.0:8001 0.0.0.0:* LISTEN 7847/python3
tcp 0 0 0.0.0.0:5173 0.0.0.0:* LISTEN 8410/node
--- Process Status ---
The entire project can be linted and tested as unit:
>make lint
✦ I will run make lint to verify everything is clean.
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ Shell make lint │
│ │
│ ruff check . │
│ All checks passed! │
│ │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ The make lint check has passed successfully with no errors or warnings remaining in the codebase! Is there anything
else you would like to do?
And end to end tested:
✓ Shell Running the end-to-end tests for the project. │
│ │
│ Running end-to-end test against http://localhost:8000... │
│ {"type": "progress", "text": "\ud83d\ude80 Connected to backend, starting research..."} │
│ {"type": "progress", "text": "\ud83d\ude80 Starting the course creation pipeline..."} │
│ {"type": "progress", "text": "\ud83d\udd0d Research is starting..."} │
│ {"type": "progress", "text": "\ud83d\udd0d Researcher is gathering information..."} │
│ {"type": "progress", "text": "\u2696\ufe0f Judge is evaluating findings..."} │
│ {"type": "progress", "text": "\u2696\ufe0f Judge is evaluating findings..."} │
│ {"type": "progress", "text": "\u270d\ufe0f Building the final course content..."} │
│ {"type": "progress", "text": "\u270d\ufe0f Content Builder is writing the course..."} │
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 App Service
The project level Makefile has targets for managing the Agent deployment to serverless endpoints:
xbill@penguin:~/gemini-cli-azure/multi-appservice$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 App Service:
>make status-as
✦ I will run the make status-as command to show you the current status of your App Services.
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ Shell make status-as │
│ │
│ ./appservice/status-appservice.sh │
│ === Azure App Service Status === │
│ Resource Group: adk-rg-as │
│ Filtering for: adk-penguin-* │
│ --- adk-penguin-full --- │
│ State HostNames │
│ ------- ---------------------------------- │
│ Running adk-penguin-full.azurewebsites.net │
│ │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ The make status-as command confirms that your single-container deployment (adk-penguin-full) is currently Running.
You can then deploy the services:
>make deploy
✦ I am starting the deployment of the multi-agent microservices architecture to Azure App Service. This process builds
multiple containers and deploys several web apps, so it might take a few minutes.
And check the endpoint:
>make endpoint-as
The public endpoint for your application is:
https://adk-penguin-full.azurewebsites.net
The service will be visible in the Azure console:
Test End to End in App Service
The entire agent system is tested on the remote Azure endpoint:
✦ The make endpoint-appservice command has successfully retrieved and displayed the public URL for the Azure Container App.
>make e2e-test-appservice
│ E2E Test Completed successfully! │
│ make[1]: Leaving directory '/home/xbill/gemini-cli-azure/multi-appservice' │
│ Output too long and was saved to: │
│ /home/xbill/.gemini/tmp/multi-appservice/tool-outputs/session-7a0ea6eb-af02-462d-b737-692bcda1caa3/run_shell_comm │
│ and_w9nn9sur.txt │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ The End-to-End test against your Azure App Service deployment completed successfully! The multi-agent pipeline
successfully researched and generated a course on the history of the internet.
Running the Web Interface
Start a connection to the Cloud Run deployed app:
https://adk-penguin-full.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 App Service. 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.