This project demonstrates an Agent-to-Agent (A2A) conversation using LangGraph with the A2A protocol.
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
source venv/bin/activate # On macOS/Linux # or venv\Scripts\activate # On Windows
-
Copy the environment example file and configure:
cp .env.example .env
Edit
.envand add your required variables (e.g.,OPENAI_API_KEY). -
Install dependencies:
pip install -r python/requirements.txt
-
Start the first agent server:
cd python langgraph dev --port 2024Copy the
assistant_idfrom the output. -
In another terminal, start the second agent server:
cd python langgraph dev --port 2025Copy the
assistant_idfrom this output as well. -
Configure the assistant IDs: Add the following to your
.envfile:AGENT_A_ID=<assistant_id_from_port_2024> AGENT_B_ID=<assistant_id_from_port_2025> -
Run the conversation simulation:
python a2a_conversation.py
This will simulate a conversation between the two agents, with each agent responding to the other's messages.