This project demonstrates inter-agent communication using the A2A protocol between an agent built with Google's Agent Development Kit (ADK) and another built with LangGraph. It uses real MCP tool endpoints and Google Cloud Secret Manager for API key handling.
- LangGraph YouTube Agent: Finds YouTube video IDs based on channel/date or playlist ID using specific MCP tool URLs. Runs an A2A server.
- ADK Summary Agent: Coordinates the summarization process. It receives a user request, delegates video finding to the YouTube Agent via A2A, receives the video IDs, calls specific MCP tool URLs to summarize each video, combines the summaries using another MCP tool URL, and returns the final result (streaming updates). Runs an A2A server.
- Python 3.11+
- uv (recommended Python package manager)
- Google Cloud Project with Secret Manager API enabled.
- A secret stored in Google Cloud Secret Manager containing your Google AI (Gemini) API Key.
- URLs for four running MCP servers (or fewer if tools are hosted together):
get_playlist_videostool endpoint.get_youtube_videos_for_channel_datetool endpoint.get_youtube_video_summarytool endpoint.generate_final_summarytool endpoint.
- (Optional) Service account JSON files if your MCP servers require authentication.
a2a-sampleslibrary installed orcommondirectory copied from thegoogle-a2arepository.
-
Clone the repository (or run the creation script):
cd adk-langgraph-a2a-youtube-summarizer -
Install Dependencies:
uv venv source .venv/bin/activate # Ensure a2a-samples is installed or common dir setup in pyproject.toml uv pip install -e . # Install root package and workspace members
-
Configure Environment Variables:
- Fill in the placeholders in
langgraph_youtube_agent/.env. RemoveGOOGLE_API_KEY. AddSECRET_PROJECT_IDandGOOGLE_API_KEY_SECRET_ID. AddMCP_URL_GET_PLAYLISTandMCP_URL_GET_CHANNEL. - Fill in the placeholders in
adk_summary_agent/.env. RemoveGOOGLE_API_KEY. AddSECRET_PROJECT_IDandGOOGLE_API_KEY_SECRET_ID. AddMCP_URL_SUMMARIZEandMCP_URL_COMBINE. EnsureYOUTUBE_AGENT_A2A_URLis correct. Replace placeholders.
- Fill in the placeholders in
-
Authentication: Ensure your environment is authenticated to Google Cloud with permissions to access the specified secret in Secret Manager (e.g., run
gcloud auth application-default login).
-
Start the MCP Servers: Ensure your MCP servers are running and accessible at the URLs specified in the
.envfiles. -
Start the LangGraph YouTube Agent A2A Server: (Terminal 1)
# From the root directory, activate venv uv run langgraph_youtube_agent --port 10003 -
Start the ADK Summary Agent A2A Server: (Terminal 2)
# From the root directory, activate venv uv run adk_summary_agent --port 10004 -
Interact using an A2A Client: (Terminal 3) Use an A2A client pointed at the ADK Summary Agent's URL (
http://localhost:10004).# Example using the sample CLI # cd <path_to_google_a2a>/samples/python/hosts/cli # Activate venv if needed # uv run . --agent http://localhost:10004 --stream
Enter prompts like:
Summarize videos from channel <channel_id> on <YYYY-MM-DD>Give me a summary for playlist <playlist_id>
Observe logs and streaming output.