langchain - ✅(Solved) Fix langchain-a2a-adapters [1 pull requests, 4 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langchain-ai/langchain#35724Fetched 2026-04-08 00:24:57
View on GitHub
Comments
4
Participants
2
Timeline
16
Reactions
2
Timeline (top)
commented ×4labeled ×3mentioned ×3subscribed ×3

Fix Action

Fixed

PR fix notes

PR #36367: feat(a2a): add initial langchain-a2a-adapters MVP

Description (problem / solution / changelog)

Fixes #35724

Summary

Adds an initial MVP implementation of a langchain-a2a adapters package.

What’s included

  • New partner package under libs/partners/a2a
  • MultiAgentA2AClient for interacting with A2A agents
  • get_tools() to expose A2A agents as LangChain tools
  • Basic unit tests for imports and tools

Notes

  • This is a minimal, stateless implementation intended as a starting point
  • No real network calls yet (stubbed behavior)
  • Designed to mirror existing partner package patterns

How I tested

  • Ran unit tests locally for the new package

Changed files

  • libs/langchain/uv.lock (modified, +2/-2)
  • libs/partners/a2a/LICENSE (added, +21/-0)
  • libs/partners/a2a/README.md (added, +3/-0)
  • libs/partners/a2a/langchain_a2a/__init__.py (added, +9/-0)
  • libs/partners/a2a/langchain_a2a/client.py (added, +37/-0)
  • libs/partners/a2a/langchain_a2a/py.typed (added, +0/-0)
  • libs/partners/a2a/langchain_a2a/tools.py (added, +36/-0)
  • libs/partners/a2a/pyproject.toml (added, +58/-0)
  • libs/partners/a2a/tests/__init__.py (added, +0/-0)
  • libs/partners/a2a/tests/integration_tests/__init__.py (added, +0/-0)
  • libs/partners/a2a/tests/unit_tests/__init__.py (added, +0/-0)
  • libs/partners/a2a/tests/unit_tests/test_imports.py (added, +10/-0)
  • libs/partners/a2a/tests/unit_tests/test_tools.py (added, +8/-0)

Code Example

from langchain_a2a_adapters.client import MultiAgentA2AClient
from langchain.agents import create_agent

client = MultiAgentA2AClient(
    {
        "research_agent": {
            "url": "http://localhost:9999/",
        },
        "coding_agent": {
            "url": "http://localhost:8888/",
            "headers": {"Authorization": "Bearer TOKEN"},
        }
    }
)

tools = await client.get_tools()
agent = create_agent("anthropic:claude-sonnet-4-20250514", tools)

response = await agent.ainvoke(
    {"messages": [{"role": "user", "content": "Research quantum computing trends"}]}
)

---

def research_agent(message: str) -> str:
    """Research agent that can analyze topics and synthesize information.

    Skills:

topic_research: Deep research on any topic
summarization: Synthesize findings into reports
    
    Args:
        message: The task or question to send to the agent.

    Returns:
        The agent's response.
    """

---

def research_agent(message: str, task_id: str | None = None) -> str:
    """Research agent that can analyze topics and synthesize information.

    Args:
        message: The task or question to send to the agent.
        task_id: Optional. Continue an existing A2A task instead of creating a new one.

    Returns:
        The agent's response.
    """
RAW_BUFFERClick to expand / collapse

Checked other resources

  • This is a feature request, not a bug report or usage question.
  • I added a clear and descriptive title that summarizes the feature request.
  • I used the GitHub search to find a similar feature request and didn't find it.
  • I checked the LangChain documentation and API reference to see if this feature already exists.
  • This is not related to the langchain-community package.

Package (Required)

  • langchain
  • langchain-openai
  • langchain-anthropic
  • langchain-classic
  • langchain-core
  • langchain-model-profiles
  • langchain-tests
  • langchain-text-splitters
  • langchain-chroma
  • langchain-deepseek
  • langchain-exa
  • langchain-fireworks
  • langchain-groq
  • langchain-huggingface
  • langchain-mistralai
  • langchain-nomic
  • langchain-ollama
  • langchain-openrouter
  • langchain-perplexity
  • langchain-qdrant
  • langchain-xai
  • Other / not sure / general

Feature Description

I would like LangChain to provide a langchain-a2a-adapters package that wraps remote A2A agents as LangChain tools — mirroring the langchain-mcp-adapters pattern.

langchain-mcp-adapters solved the tool integration problem with a simple dict-based config. Enterprises now need the same for agents — the A2A protocol is the emerging standard for agent-to-agent communication, backed by Google and 150+ organizations.

While LangGraph Platform offers A2A support, there's no open-source adapter for self-hosted deployments.

Use Case

Enterprises are adopting A2A to enable multi-vendor agent interoperability. Teams building with LangChain need to call agents built with other frameworks (AutoGen, CrewAI, Google ADK) as tools within their LangChain agents.

Proposed Solution

A langchain-a2a-adapters package following the same pattern as langchain-mcp-adapters:

from langchain_a2a_adapters.client import MultiAgentA2AClient
from langchain.agents import create_agent

client = MultiAgentA2AClient(
    {
        "research_agent": {
            "url": "http://localhost:9999/",
        },
        "coding_agent": {
            "url": "http://localhost:8888/",
            "headers": {"Authorization": "Bearer TOKEN"},
        }
    }
)

tools = await client.get_tools()
agent = create_agent("anthropic:claude-sonnet-4-20250514", tools)

response = await agent.ainvoke(
    {"messages": [{"role": "user", "content": "Research quantum computing trends"}]}
)

Generated Tool Signature

Each A2A agent tool would have a clear signature:

def research_agent(message: str) -> str:
    """Research agent that can analyze topics and synthesize information.

    Skills:

topic_research: Deep research on any topic
summarization: Synthesize findings into reports
    
    Args:
        message: The task or question to send to the agent.

    Returns:
        The agent's response.
    """

Session/Task Management

The adapter handles A2A task lifecycle internally:

Stateless by default (like langchain-mcp-adapters): Each tool.invoke(message="...") creates a new A2A task, waits for completion, returns the result Stateful sessions (optional): For multi-turn conversations, the tool can accept an optional task_id parameter. If provided, it continues an existing A2A task instead of creating a new one. The task_id would be stored in LangGraph state:

def research_agent(message: str, task_id: str | None = None) -> str:
    """Research agent that can analyze topics and synthesize information.

    Args:
        message: The task or question to send to the agent.
        task_id: Optional. Continue an existing A2A task instead of creating a new one.

    Returns:
        The agent's response.
    """

The returned ToolMessage artifact could include the task_id for the agent to persist in state if multi-turn is needed.

Alternatives Considered

LangGraph Platform A2A endpoint — requires platform deployment, not available for self-hosted open-source users Custom implementations — works but requires manual A2A client management

Additional Context

Related issues:

#32645 (closed — pointed to LangGraph Platform, no open-source adapter)

References:

A2A Protocol: https://google.github.io/A2A/specification/ [lang](https://google.github.io/A2A/specification/)chain-mcp-adapters: https://github.com/langchain-ai/langchain-mcp-adapters A2A Agent Card schema: https://google.github.io/A2A/specification/#agent-card

extent analysis

Problem Summary

Feature Request: langchain-a2a-adapters package for wrapping remote A2A agents as LangChain tools.

Root Cause Analysis

The root cause is the lack of an open-source adapter for self-hosted deployments of A2A agents.

Fix Plan

Step 1: Create langchain-a2a-adapters package

Create a new package langchain-a2a-adapters with the following structure:

langchain-a2a-adapters/
client.py
tools.py
__init__.py

Step 2: Implement MultiAgentA2AClient class

In client.py, implement the MultiAgentA2AClient class to handle A2A client management:

from langchain_a2a_adapters.client import MultiAgentA2AClient

class MultiAgentA2AClient:
    def __init__(self, config):
        self.config = config

    async def get_tools(self):
        tools = []
        for agent_name, agent_config in self.config.items():
            tools.append(await self.get_tool(agent_name, agent_config))
        return tools

    async def get_tool(self, agent_name, agent_config):
        # Implement A2A client logic to get the tool
        pass

Step 3: Implement Tool class

In tools.py, implement the Tool class to represent an A2A agent tool:

from langchain_a2a_adapters.tools import Tool

class Tool:
    def __init__(self, name, signature):
        self.name = name
        self.signature = signature

    async def invoke(self, message):
        # Implement A2A agent logic to invoke the tool
        pass

Step 4: Implement research_agent function

In tools.py, implement the research_agent function as an example tool:

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING