langchain-ai / agent-protocol

https://langchain-ai.github.io/agent-protocol/api.html
MIT License
123 stars 4 forks source link

Add Support for Agent-to-Agent Communication #5

Open ravediamond opened 1 week ago

ravediamond commented 1 week ago

Problem

The current Agent Protocol specification focuses solely on human-agent interactions through threads and runs. But I think many applications will require many specialized agents working together. Currently, there's no specified way for:

Proposed Solution

Add new endpoints that enable agent discovery and communication:

# Agent Registry
GET /agents
Response:
{
  "agents": [{
    "id": "agent-123",
    "name": "Research Assistant",
    "capabilities": {
      "tasks": ["research", "summarize"],
      "input_types": ["text", "pdf"],
      "output_types": ["text", "json"]
    },
    "status": "active"
  }]
}

# Agent Communication
POST /threads/{thread_id}/messages
{
  "from_agent": "agent_id",
  "to_agent": "agent_id",
  "content": {},
  "type": "request|response"
}

# Agent Task Delegation
POST /threads/{thread_id}/delegate
{
  "delegate_to": "agent_id",
  "permissions": ["read", "write", "execute"],
  "task": {
    "type": "task_type",
    "input": {},
    "constraints": {}
  }
}

# Agent Shared State Creation 
POST /threads/{thread_id}/shared_state
{
  "namespace": "shared_namespace",
  "access": ["agent_id1", "agent_id2"],
  "state": {}
}

This solution would provide:

  1. A registry where agents can publish their capabilities and discover others
  2. Standard message formats for agent-to-agent communication. I think this would need a specific format optimized for agent-to-agent communication.
  3. Integration with existing thread model for conversation history

What do you think ?

markokraemer commented 6 days ago

I dont think this should be part of it yet! Most multi agent systems dont work reliabely in prod. The Agent To Agent comm can be just a tool. And often is just abstracted in SDK´s although its just a tool call under the hood.

So a more general, better approach would be having a call tool as api Tool API schema defined here.