LDP: LLM Delegate Protocol
An identity-aware communication protocol for multi-agent LLM systems.
LDP extends service-oriented agent protocols (like A2A and MCP) with AI-native primitives: rich delegate identity, progressive payload modes, governed sessions, structured provenance, and trust domains.
Install: pip install ldp-protocol · Website: ldp.sunilprakash.com · Paper: arXiv:2603.08852 · PDF
Why LDP?
A2A handles agent-to-agent communication. MCP handles agent-to-tool integration. LDP adds the delegation intelligence layer on top — the layer that decides which agent to route to, how to encode the payload, and whether to trust the result.
┌──────────────────────────────────────────┐
│ Delegation Intelligence — LDP │
│ (identity, routing, provenance, trust) │
├──────────────────────────────────────────┤
│ Agent Communication — A2A │
├──────────────────────────────────────────┤
│ Tool Integration — MCP │
└──────────────────────────────────────────┘
LDP extends agent protocols with AI-native primitives:
- Rich delegate identity — model family, quality scores, reasoning profiles, cost/latency hints
- Progressive payload modes — negotiate encoding efficiency (37% token reduction with semantic frames)
- Governed sessions — persistent context eliminates re-transmitting conversation history
- Structured provenance — every response carries who produced it, confidence, and verification status
- Trust domains — protocol-level security boundaries beyond transport-level auth
Quick Start
See it in action — Smart vs Blind Routing
Discovered 3 delegates:
Fast Agent gemini-2.0-flash quality=0.60 cost=$0.001 p50=200ms
Balanced Agent claude-sonnet-4-6 quality=0.82 cost=$0.008 p50=1200ms
Deep Agent claude-opus-4-6 quality=0.95 cost=$0.025 p50=3500ms
Round 1: Blind Routing (skill-name only)
Task (easy ) -> Deep Agent cost=$0.025 latency=3496ms <- overkill
Task (medium) -> Deep Agent cost=$0.025 latency=3493ms <- expensive
Task (hard ) -> Deep Agent cost=$0.025 latency=3755ms <- correct
Total: $0.075 | 10,744ms | Avg quality: 0.95
Round 2: LDP Routing (identity-aware)
Task (easy ) -> Fast Agent cost=$0.001 latency=200ms <- right-sized
Task (medium) -> Balanced Agent cost=$0.008 latency=1108ms <- right-sized
Task (hard ) -> Deep Agent cost=$0.025 latency=3582ms <- right-sized
Total: $0.034 | 4,890ms | Quality matched to task complexity
Cost savings: 55% ($0.075 -> $0.034)
Latency savings: 54% (10,744ms -> 4,890ms)
Provenance (LDP exclusive):
produced_by: ldp:delegate:deep-01
model: claude-opus-4-6
confidence: 0.91
verified: True
payload_mode: semantic_frame (37% fewer tokens than text)
Create a delegate
return , 0.95 # (output, confidence)
=
# requires: pip install ldp-protocol[server]
Discover and invoke
= await
= await
# who produced it, confidence, verified
Multi-delegate routing
await
# Route by quality, cost, latency, or balanced score
= await
Protocol Overview
1. Delegate Identity Cards
Every LDP delegate publishes a rich identity card at GET /ldp/identity:
This enables metadata-aware routing: send easy tasks to fast, cheap models and hard tasks to capable, expensive models — decisions impossible with skill-name-only matching.
2. Progressive Payload Modes
| Mode | Name | Status | Description |
|---|---|---|---|
| 0 | Text | Implemented | Natural language. Universal fallback. |
| 1 | Semantic Frame | Implemented | Typed structured JSON. 37% fewer tokens than text. |
| 2 | Embedding Hints | Specified | Vector representations for semantic routing. |
| 3 | Semantic Graph | Specified | Structured relationship representations. |
| 4 | Latent Capsules | Future | Compressed machine-native semantic packets. |
| 5 | Cache Slices | Future | Execution-state transfer between compatible models. |
Delegates negotiate the richest mutually supported mode during session establishment. If a mode fails, the protocol automatically falls back: Mode N -> Mode N-1 -> ... -> Mode 0.
3. Governed Sessions
Unlike stateless protocols, LDP sessions maintain persistent context:
HELLO -> CAPABILITY_MANIFEST -> SESSION_PROPOSE -> SESSION_ACCEPT
-> TASK_SUBMIT / TASK_UPDATE / TASK_RESULT (within session context)
-> SESSION_CLOSE
Sessions eliminate re-transmitting conversation history, reducing token overhead that grows quadratically with conversation length.
4. Structured Provenance
Every task result carries provenance metadata:
Downstream consumers can weight outputs by source reliability. Critically, provenance includes verification status — unverified confidence signals can be harmful (see research findings).
5. Trust Domains
Security boundaries enforced at the protocol level:
- Message level: Per-message signatures, nonces, replay protection
- Session level: Trust domain compatibility checks during establishment
- Policy level: Capability scope, jurisdiction compliance, cost limits
HTTP API
| Endpoint | Method | Description |
|---|---|---|
/ldp/identity |
GET | Delegate's identity card |
/ldp/capabilities |
GET | Capability manifest |
/ldp/messages |
POST | Send/receive LDP protocol messages |
Message Types
| Type | Direction | Purpose |
|---|---|---|
HELLO |
-> | Initiate handshake with supported modes |
CAPABILITY_MANIFEST |
<- | Declare capabilities |
SESSION_PROPOSE |
-> | Propose session with config |
SESSION_ACCEPT |
<- | Accept with negotiated mode |
SESSION_REJECT |
<- | Reject with reason |
TASK_SUBMIT |
-> | Submit task within session |
TASK_UPDATE |
<- | Progress update |
TASK_RESULT |
<- | Result with provenance |
TASK_FAILED |
<- | Failure with error |
TASK_CANCEL |
-> | Cancel in-flight task |
SESSION_CLOSE |
<-> | Terminate session |
SDKs
Python (primary)
The Python SDK includes: pydantic models for all protocol types, async client with session management, delegate base class with optional Starlette server, and multi-strategy router.
See sdk/python/ for full documentation.
Rust (reference implementation)
The Rust crate serves as the reference implementation — useful for production deployments and native integration with the JamJet agent runtime.
Standalone adapter
use ;
use ;
use json;
let adapter = new;
// Discover a remote delegate
let caps = adapter.discover.await?;
println!;
// Submit a task
let handle = adapter.invoke.await?;
With a protocol registry
use ;
use ProtocolRegistry;
let mut registry = new;
register_ldp;
// ldp:// URLs are now routed to the LDP adapter
let adapter = registry.adapter_for_url.unwrap;
let caps = adapter.discover.await?;
JamJet integration
Enable the jamjet feature to plug LDP into JamJet's runtime alongside MCP and A2A:
[]
= { = "0.1", = ["jamjet"] }
use register_ldp_jamjet;
let mut registry = new;
// MCP, A2A registered by JamJet...
register_ldp_jamjet; // LDP plugged in
// Now ldp:// URLs route through LDP with full session management
Project Structure
ldp-protocol/
├── sdk/python/ # Python SDK (primary)
│ ├── src/ldp_protocol/ # Package source
│ │ ├── types/ # Pydantic models (identity, capability, etc.)
│ │ ├── client.py # Async HTTP client
│ │ ├── delegate.py # Delegate base class
│ │ └── router.py # Multi-strategy routing
│ └── tests/ # 29 tests
├── src/ # Rust reference implementation
│ ├── protocol.rs # Standalone protocol abstractions
│ ├── adapter.rs # ProtocolAdapter implementation
│ ├── client.rs # LDP HTTP client
│ ├── server.rs # LDP server
│ ├── session_manager.rs # Session lifecycle
│ └── types/ # Protocol type definitions
├── examples/
│ ├── demo_smart_routing.py # Killer demo: smart vs blind routing
│ └── python_sdk/ # Additional Python examples
├── tests/
│ └── ldp_integration.rs # Rust integration tests (17 tests)
└── docs/
├── RFC.md # Protocol specification
└── DESIGN.md # Architecture documentation
Documentation
- Protocol Specification (RFC) — Formal protocol specification
- Python SDK — Python package documentation
- Design Document — Architecture and integration docs
- Research Paper — arXiv:2603.08852
- Experiment Code — Reproduce the empirical evaluation
Research
LDP is backed by empirical research comparing it against A2A and random baselines. Key findings:
- Routing: Identity-aware routing achieves ~12x lower latency on easy tasks through delegate specialization
- Payload: Semantic frames reduce token count by 37% (p=0.031) with no observed quality loss
- Provenance: Noisy confidence signals degrade quality below the no-provenance baseline — verification matters
- Sessions: Governed sessions eliminate quadratic token overhead in multi-round delegation
Related
- DCI (Deliberative Collective Intelligence) — arXiv:2603.11781 · DCI provides the reasoning layer; LDP provides the delegation protocol
- Why Multi-Agent AI Systems Need Identity-Aware Routing
- From Debate to Deliberation: When Multi-Agent Reasoning Needs Structure
Citation
License
Apache-2.0