DEV Community

Cover image for How to Make Agents Talk to Each Other (and Your App) Using A2A + AG-UI

How to Make Agents Talk to Each Other (and Your App) Using A2A + AG-UI

Bonnie on October 08, 2025

TL;DR In this guide, you will learn how to build full-stack Agent-to-Agent(A2A) communication between AI agents from different AI agent ...
Collapse
 
aaguirreb16 profile image
Jungleswapper

Hi

Collapse
 
the_greatbonnie profile image
Bonnie CopilotKit

What's up?

Collapse
 
iarxii profile image
Thabang Mposula

How many people have actually setup this project? Maybe I can get some help?

Collapse
 
the_greatbonnie profile image
Bonnie CopilotKit

Hey what's up.

What's issues are you facing while trying to setup the project?

I wouldn't mind helping.

Collapse
 
iarxii profile image
Thabang Mposula

Hi Bonnie. I am trying to follow this tutorial. I am on windows 11. I performed the initial steps in this article to setup copilotkit and the research agent. Unfortunately, the scripts that are called when running in dev caused errors where the agents inside the 'a2a-demo/agents' folder failed to run. After some prompting, the best advise I received was that:

  • to change the relative paths in the run commands to windows format (\) to absolute paths anchored to the directory where I invoke the npm run dev command via the special npm variable: INIT_CWD. This is to avoid relying on cd to chang directory into the agents directory, and it makes the command resilient across shells


"scripts": {
"dev": "concurrently --names \"UI,Orch,Research,Analysis\" --prefix-colors \"cyan,gray,green,blue\" \"npm run dev:ui\" \"npm run dev:orchestrator\" \"npm run dev:research\" \"npm run dev:analysis\"",
"dev:ui": "next dev --turbopack",
"dev:orchestrator": "cross-env PYTHONUTF8=1 \"%INIT_CWD%\\agents\\.venv\\Scripts\\python.exe\" \"%INIT_CWD%\\agents\\orchestrator.py\"",
"dev:research": "cross-env PYTHONUTF8=1 \"%INIT_CWD%\\agents\\.venv\\Scripts\\python.exe\" \"%INIT_CWD%\\agents\\research_agent.py\"",
"dev:analysis": "cross-env PYTHONUTF8=1 \"%INIT_CWD%\\agents\\.venv\\Scripts\\python.exe\" \"%INIT_CWD%\\agents\\analysis_agent.py\"",
"build": "next build",
"start": "next start",
"lint": "next lint"
}

This works and the ochestrator.py and research_agent.py now run, but the analysis_agent.py still has an error due to uses the fact that the analysis_agent.py script uses google.adk.runners.Runner(...), which calls _enforce_app_name_alignment() and derives the app name from the directory it considers the app root. Since I activated the venv inside the agents folder and the cd .. — the launch path ends up being .venv.

I built out a batch script to run the initialization commands as follows:
`
@echo off
ECHO Starting the A2A Demo development environment...
ECHO.

REM This script assumes it is run from the project root (a2a-demo).

REM Step 1: Activate the Python virtual environment.
ECHO Activating Python virtual environment from 'agents.venv'...
call agents.venv\Scripts\activate.bat

IF %ERRORLEVEL% NEQ 0 (
ECHO.
ECHO ERROR: Failed to activate the virtual environment.
ECHO Please ensure it has been created at 'agents.venv' by running the setup steps in the README.
GOTO :EOF
)
ECHO Virtual environment activated successfully.
ECHO.

REM Step 2: Run the main development command to start the UI and all agents.
ECHO Starting all services with 'npm run dev'...
npm run dev
`

Thread Thread
 
the_greatbonnie profile image
Bonnie CopilotKit • Edited

I have had the same issue too.

Set the google-adk version to 1.15.1 in the requirements.txt file then delete the .venv file and install the dependecies afresh.

Let me know if it fixes the issue.

Collapse
 
iarxii profile image
Thabang Mposula • Edited

Basically, I think the article needs a section on the considerations one should make for their development environment. It would be more confusing to switch to the docs to do a hard search, rather the info be part of this article to ensure that readers can follow along without environment setup issues.

Collapse
 
andrew0123 profile image
Andrew

How easy is this to set up? How long do you think it'll take me, Bonnie ?

Collapse
 
nathan_tarbert profile image
Nathan Tarbert CopilotKit

Hey, Andrew and Steven, I followed Bonnie's setup process, and it's solid- took me about 30 minutes.

If you just clone the repo and add your ENV's it'll take just a few minutes, install, run the server, and away you go, talking to multiple agents.

Would love to get your feedback.

Collapse
 
iarxii profile image
Thabang Mposula

Ive been trying to set this project up, unfortunately the instructions here have not helped me as I am getting errors and am making modifications to the project structure and npm scripts that need to be ran. The article does not spare some time to atleast talk to dev environments and considerations. I am on Windows 11 and the relative pathing seems to not work well with powershell or cmd. Is it worth using wsl instead and the how to are some of the additions this article needs. A lot of content but we should still look away from the article is inconvenient.

Collapse
 
the_greatbonnie profile image
Bonnie CopilotKit

Less than 5 minutes, Andrew.

Collapse
 
steven0121 profile image
Steven

+1

Collapse
 
the_greatbonnie profile image
Bonnie CopilotKit

That's awesome, Steven.

Collapse
 
damjan_akelj_be1aab4a715 profile image
Damjan Žakelj

Well all I can say, nice work—clean walkthrough and the agent handshake feels solid. A few tiny papercuts I hit: // … comments inside JSX (switch to {/* … */}) and a couple of unbalanced s. I also collapsed the 4 states into a reducer and lazy-loaded the card components so streaming stays smooth. Adding an aria-live="polite" on the results pane makes the stream accessible, and min-h-screen avoids the iOS viewport trap.
If helpful I can PR the small patch (imports tidy, reducer, lazy components, skeletons). Great job—this is a nice base for multi-agent travel UX.

Collapse
 
the_greatbonnie profile image
Bonnie CopilotKit

Thanks for the recommendations, Damjan.

Let me look into it.

Collapse
 
usman_awan profile image
MUHAMMAD USMAN AWAN

Nice Article 🙌

Collapse
 
the_greatbonnie profile image
Bonnie CopilotKit

Thanks, Muhammad.

Collapse
 
cuongnp profile image
cuongnp

Nice! I’m looking for a post to learn AI-Agents.

Collapse
 
the_greatbonnie profile image
Bonnie CopilotKit

Hi 👋,

Hope this post was helpful.

Collapse
 
henrywills22 profile image
Henry Willz

Niceee

Collapse
 
the_greatbonnie profile image
Bonnie CopilotKit

Thanks, Henry

Collapse
 
henryjohn21 profile image
henryjohn21

Cool stuff can't wait to try it myself. Thanks Bonnie

Collapse
 
the_greatbonnie profile image
Bonnie CopilotKit

I am happy to hear that.

Collapse
 
eli_discovers profile image
Eli Berman CopilotKit

Awesome I love this handshake and great tutorial Bonnie was super easy to follow. Just got it setup myself

Collapse
 
the_greatbonnie profile image
Bonnie CopilotKit

I am happy to hear that, Eli.

Collapse
 
dawoodkarim profile image
dawoodkarim

CopilotKit has been making big moves lately .. seems like they on a roll.
Nice job Bonnie for keeping up with them

Collapse
 
the_greatbonnie profile image
Bonnie CopilotKit

The team there have been doing a great job.

Collapse
 
balavaradhalingam profile image
Balasaranya Varadhalingam

AI may write the code, but understanding the logic behind it is what makes us true developers. The real skill now is guiding AI without losing our analytical edge.

Collapse
 
neha_kapoor_6a87df2b83e67 profile image
Neha Kapoor

nice

Collapse
 
the_greatbonnie profile image
Bonnie CopilotKit

Thanks, Neha

Collapse
 
nathan_tarbert profile image
Nathan Tarbert CopilotKit

Bonnie, this is so exciting!
A2A + AG-UI is pretty huge!

Collapse
 
the_greatbonnie profile image
Bonnie CopilotKit

I learned a lot working on this guide.

Collapse
 
james0123 profile image
James

Wow I've been waiting for this. Gonna try it out thanks Bonnie

Collapse
 
the_greatbonnie profile image
Bonnie CopilotKit

I am happy to hear that, James.

Feel free to let me know how you find it out once you try it.

Collapse
 
johny0012 profile image
Johny

Cool! Saved for later

Collapse
 
the_greatbonnie profile image
Bonnie CopilotKit

Thanks, Johny.