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-aci$ 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:
> make status
✦ I will run the make status command to check the status of your local services.
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ Shell Running 'make status' to check local services. │
│ │
│ 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. │
│ │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ No local services are currently running.
Then all the agents can be started together:
make start
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ Shell Starting all local services in the background. │
│ │
│ 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 │
│
make status
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ Shell Checking status of local services. │
│ │
│ ... first 22 lines hidden (Ctrl+O to show) ... │
│ dge/.well-known/agent-card.json; \ export CONTENT_BUILDER_AGENT_CARD_URL=http://localhost:8003/a2a/content_builder/.well-known/agent-card.jso │
│ n; \ /home/xbill/.pyenv/shims/python3 -m shared.adk_app --host 0.0.0.0 --port 8004 agents/orchestrator" │
│ xbill 14269 9.3 3.1 248416 148664 ? S 20:27 0:02 /home/xbill/.pyenv/versions/3.13.13/bin/python3 -m shared.adk_app --host 0.0 │
│ .0.0 --port 8004 agents/orchestrator │
│ xbill 14273 0.0 0.0 2584 1668 ? S 20:27 0:00 /bin/sh -c /bin/bash -c "source .env 2>/dev/null || true; \ export AGENT_SER │
│ VER_URL=http://localhost:8004; \ export AGENT_NAME=orchestrator; \ export PORT=8000; \ cd app && /home/xbill/.pyenv/shims/python3 main.py" │
│ xbill 14275 0.0 0.0 6940 3312 ? S 20:27 0:00 /bin/bash -c source .env 2>/dev/null || true; export AGENT_SERVER_URL=http:/ │
│ /localhost:8004; export AGENT_NAME=orchestrator; export PORT=8000; cd app && /home/xbill/.pyenv/shims/python3 main.py │
│ xbill 14278 8.4 3.1 1345296 144520 ? Sl 20:27 0:02 /home/xbill/.pyenv/versions/3.13.13/bin/python3 main.py │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ The local agents and the backend server are running and listening on ports 8000-8004. The Vite dev server (port 5173) is still not appearing in the
network status.
The entire project can be linted and tested as unit:
> make lint
✦ I will run the make lint command to confirm that all linting checks pass.
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ Shell Run linting checks to confirm they pass. │
│ │
│ ruff check . │
│ All checks passed! │
│ │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ make lint completed successfully with no errors.
> make test
✦ I will run the project's test suite using make test.
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ Shell Run all tests using pytest. │
│ │
│ ... first 41 lines hidden (Ctrl+O to show) ... │
│ agents/orchestrator/agent.py:294 │
│ /home/xbill/gemini-cli-azure/multi-aci/agents/orchestrator/agent.py:294: UserWarning: [EXPERIMENTAL] RemoteA2aAgent: ADK Implementation for │
│ A2A support (A2aAgentExecutor, RemoteA2aAgent and corresponding supporting components etc.) is in experimental mode and is subject to breaki │
│ ng changes. A2A protocol and SDK are themselves not experimental. Once it's stable enough the experimental mode will be removed. Your feedbac │
│ k is welcome. │
│ content_builder = RemoteA2aAgent( │
│ │
│ -- Docs: [https://docs.pytest.org/en/stable/how-to/capture-warnings.html](https://docs.pytest.org/en/stable/how-to/capture-warnings.html) │
│ ====================================================== 30 passed, 4 warnings in 7.71s ======================================================= │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ make test passed all 30 tests successfully.
And end to end tested:
✓ShellRunningtheend-to-endtestsfortheproject.││││Runningend-to-endtestagainsthttp://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 ACI
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:
xbill@penguin:~/gemini-cli-azure/multi-aci$ make status-aci
./aci/status-aci.sh
Checking Azure Container Instances status in adk-rg-aci...
(ResourceGroupNotFound) Resource group 'adk-rg-aci' could not be found.
Code: ResourceGroupNotFound
Message: Resource group 'adk-rg-aci' could not be found.
make: *** [Makefile:202: status-aci] Error 3
You can then deploy the services:
xbill@penguin:~/gemini-cli-azure/multi-aci$ make deploy
./aci/deploy-aci.sh
=== Azure ACI Deployment ===
Azure Location: westus2
Resource Group: adk-rg-aci
ACR Name: adkacrpenguin
=============================
Ensuring Resource Group exists...
Location Name
---------- ----------
westus2 adk-rg-aci
Ensuring ACR exists...
✦ I have successfully rebuilt the ACI deployment by consolidating the microservices into a single Azure Container
Group and enabling Log Analytics integration.
Once the containers are deployed- you can then get the endpoint:
And check the endpoint:
│ ✓ Shell make aci-status │
│ │
│ ./aci/status-aci.sh │
│ Checking Azure Container Instances status in adk-rg-aci... │
│ Name FQDN IP │
│ -------------------- ------------------------------------------------------ -------------- │
│ course-creator-group course-creator-group-penguin.westus2.azurecontainer.io 172.179.100.61 │
│
xbill@penguin:~/gemini-cli-azure/multi-aci$ make endpoint
./aci/endpoint-aci.sh
--- Azure ACI Endpoint ---
http://course-creator-group-penguin.westus2.azurecontainer.io:8080/
xbill@penguin:~/gemini-cli-azure/multi-aci$
The service will be visible in the Azure console:
Test End to End in ACI
The entire agent system is tested on the remote Azure endpoint:
✦ The make endpoint-aci command has successfully retrieved and displayed the public URL for the Azure Container App.
> make e2e-test-aci
✦ The end-to-end test against the newly deployed Azure Container Group was successful. The system correctly
orchestrated the research, evaluation, and content generation phases, producing a structured course on the
history of the internet.
Running the Web Interface
Start a connection to the Cloud Run deployed app:
http://course-creator-group-penguin.westus2.azurecontainer.io:8080/
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:
✦ I have successfully rebuilt the ACI deployment by consolidating the microservices into a single Azure Container
Group and enabling Log Analytics integration.
Summary of Actions
- Cleanup: Destroyed the five individual container instances to transition to a grouped deployment.
- Image Rebuild: Built and pushed new versions of all five microservice images (researcher, judge,
content-builder, orchestrator, and course-creator) to the Azure Container Registry with the latest tag.
- Logging Configuration: Successfully retrieved the workspace ID and primary key for the existing
adk-log-workspace Log Analytics workspace.
- Group Deployment: Deployed the course-creator-group container group using the generated
aci-container-group.yaml, ensuring all containers share the same network and lifecycle while streaming logs
to Azure Monitor.
Deployment Details
- Container Group Name: course-creator-group
- Resource Group: adk-rg-aci
- Region: westus2
- Public URL: http://course-creator-group-penguin.westus2.azurecontainer.io:8080
(http://course-creator-group-penguin.westus2.azurecontainer.io:8080)
- Logging: Integrated with Log Analytics workspace adk-log-workspace.
Key Achievements
- Container Group Deployment: The multi-agent system is now running efficiently as a single container group in
ACI, reducing overhead and simplifying inter-agent communication via localhost.
- Integrated Logging: Log Analytics is active, providing centralized monitoring for all microservices.
- Verified Functionality: The e2e-test-aci confirmed that the orchestrator can successfully communicate with
the sub-agents and the main application remains fully functional in the Azure environment.
The deployment is now fully optimized and verified.
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 ACI. 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.