Skip to content

Conversation

@ankitlade12
Copy link

Summary

This PR adds native support for Google's Agent-to-Agent (A2A) protocol to LangGraph, enabling LangGraph agents to communicate with agents from other frameworks.

Motivation

The A2A protocol is emerging as a standard for agent interoperability in 2025-2026. This feature allows LangGraph agents to:

  • Be discovered by other agents via Agent Cards
  • Receive and process standardized task requests
  • Respond using A2A-compliant message formats

Changes

New Module: langgraph/a2a/

File Description
capabilities.py A2ACapabilities class for defining agent skills
card.py AgentCard and AgentEndpoint for discovery
message.py A2AMessage, A2ARequest, A2AResponse types
protocol.py A2AProtocolHandler for wrapping LangGraph agents

Tests

  • Added 46 comprehensive test cases in tests/test_a2a.py
  • All tests passing
  • All linting checks passing (ruff, mypy)

Example Usage

from langgraph.graph import StateGraph
from langgraph.a2a import A2ACapabilities, A2AProtocolHandler

capabilities = A2ACapabilities(
    name="research-agent",
    description="Performs web research",
    skills=("search", "summarize"),
)

graph = StateGraph(MyState)
# ... build graph
compiled = graph.compile()

handler = A2AProtocolHandler(graph=compiled, capabilities=capabilities)
card = handler.get_agent_card()  # For discovery
response = handler.handle_request(request)  # Handle A2A requests

- Add A2ACapabilities for defining agent skills and discovery
- Add AgentCard and AgentEndpoint for A2A-compliant agent discovery
- Add A2A message types (A2AMessage, A2ARequest, A2AResponse)
- Add A2AProtocolHandler for wrapping LangGraph agents with A2A support
- Add comprehensive test suite (46 tests)

This enables LangGraph agents to communicate with agents from other
frameworks using Google's emerging A2A protocol standard.

The A2A protocol enables:
- Agent discovery via Agent Cards
- Standardized task routing and execution
- Capability negotiation between agents
- JSON-RPC 2.0 compatible message format
@vercel
Copy link

vercel bot commented Jan 4, 2026

@ankitlade12 is attempting to deploy a commit to the LangChain Team on Vercel.

A member of the Team first needs to authorize it.

- Import _DC_KWARGS from langgraph.types
- Replace hardcoded dataclass params with **_DC_KWARGS
- Ensures consistency with project standards
@ankitlade12 ankitlade12 requested a review from hinthornw January 8, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants