Skip to content

ansharma0923/capability-discovery-protocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

CDP β€” Capability Discovery Protocol

Build Python License Version

Status: v0.1.0 β€” early reference implementation. APIs and wire format are subject to change before v1.0.

Intent-driven discovery layer for capabilities, skills, APIs, services, workflows, and agents.

CDP is a capability discovery plane for agentic and non-agentic systems. It solves the problem of how AI agents, applications, and humans can discover the right provider for any capability β€” using natural language intent rather than rigid query syntax.

Key Features

  • 🎯 Intent-driven: Natural language discovery requests
  • πŸ” 14-stage pipeline: Parse β†’ Filter β†’ Semantic Match β†’ Validate β†’ Rank β†’ Audit β†’ Respond
  • πŸ† Explainable ranking: Score breakdowns with human-readable explanations
  • 🌐 Federation: Query distributed CDP nodes
  • πŸ›‘οΈ Policy engine: Pluggable provider trust and compliance rules
  • πŸ“Š Audit logging: Full observability for every discovery
  • ⚑ 6 categories: product, service, agent, data, compute, api

Capability Discovery Plane (CDP) Context

The Gap

Current agentic ecosystems lack a structured layer for capability discovery. Agents can invoke tools and call APIs, but there is no standardized mechanism for an agent to express what it needs and receive a ranked, policy-filtered set of providers capable of fulfilling that need.

Agent registries list agents. Merchant catalogs list products. Neither resolves intent to the right provider in real time.

Role of CDP in the Stack

CDP operates as the capability discovery plane in a multi-layer agentic stack:

SIP  (Signal / Instruction Plane)    β€” intent originates here
 β”‚
CDP  (Capability Discovery Protocol) β€” capability discovery plane
 β”‚
A2A  (Agent-to-Agent)                β€” negotiation and contracting
 β”‚
UCP  (Unified Commerce Protocol)     β€” transaction and fulfillment
 β”‚
AP2  (Agentic Payment Protocol)      β€” payment and settlement

CDP sits between intent formation and negotiation. It does not execute tasks, manage payments, validate intent, enforce policy, generate execution plans, or handle post-discovery communication. Its sole function is to resolve a structured intent into a ranked set of matching providers and offerings β€” answering:

  • What capabilities exist?
  • Which ones match?
  • Which ones are best?

Interaction Flow

Intent β†’ Discovery (CDP) β†’ Negotiation β†’ Transaction
  1. Intent: A caller expresses a capability need in natural language with optional structured constraints.
  2. Discovery: CDP indexes capabilities and offerings, resolves the intent against registered providers, and returns a ranked result set scored on relevance, price, trust, and availability.
  3. Negotiation: The selected provider and caller negotiate terms (handled at the A2A layer).
  4. Transaction: The agreed capability is executed and settled (handled at UCP/AP2 layers).

How CDP Differs

Concept Description
Agent registry A static list of agents and their metadata. Does not resolve intent or rank results.
Merchant catalog A product listing optimized for human browsing. Does not support structured constraints or real-time resolution.
CDP A capability discovery plane that resolves natural language capability requests against indexed providers in real time, ranked by relevance, price, trust, and availability.

Design Principle

CDP moves the ecosystem from static catalog lookup to intent-driven capability discovery: providers index their capabilities and offerings; callers express intent; CDP resolves and ranks matches at request time.

See docs/cdp-context.md for the full protocol context document.

Architecture

DiscoveryIntent
      β”‚
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              14-Stage Pipeline                   β”‚
β”‚  1. parse_request      8. policy_filtering       β”‚
β”‚  2. normalize_intent   9. ranking                β”‚
β”‚  3. extract_constraints 10. explanation_gen      β”‚
β”‚  4. retrieve_candidates 11. federation_merge     β”‚
β”‚  5. deterministic_filter 12. deduplication       β”‚
β”‚  6. semantic_matching   13. audit_logging        β”‚
β”‚  7. capability_validation 14. response_gen       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚
      β–Ό
  DiscoveryResponse (ranked results + explanations)

Quick Start

Install

pip install -e ".[dev]"

Run Server

uvicorn cdp.main:app --reload --port 8000

First Query

curl -X POST http://localhost:8000/discover \
  -H "Content-Type: application/json" \
  -d '{
    "intent_text": "I need noise-canceling headphones under $300",
    "category": "product",
    "constraints": {"max_price": 300.0, "region": ["us-east"]}
  }'

Example Response

{
  "intent_id": "550e8400-e29b-41d4-a716-446655440000",
  "version": "0.1.0",
  "category": "product",
  "total_candidates": 3,
  "total_results": 2,
  "results": [
    {
      "offering_id": "off-elec-001",
      "provider_id": "11111111-1111-1111-1111-111111111111",
      "total_score": 0.8542,
      "score_breakdown": {
        "relevance": 0.27, "price": 0.15, "latency": 0.15,
        "availability": 0.149, "trust": 0.15, "freshness": 0.05
      },
      "explanation": {
        "summary": "Offering 'ProANC Headphones X1' scored 0.85",
        "matched_constraints": ["price <= $300.0", "region in ['us-east']"]
      }
    }
  ],
  "pipeline": {
    "stages_executed": ["parse_request", "...", "response_generation"],
    "duration_ms": 2.4,
    "federation_used": false
  }
}

Repository Structure

β”œβ”€β”€ cdp/              # Python implementation
β”‚   β”œβ”€β”€ intent/       # Intent parsing and models
β”‚   β”œβ”€β”€ registry/     # Provider and offering registry
β”‚   β”œβ”€β”€ matching/     # Filter, semantic, validator
β”‚   β”œβ”€β”€ ranking/      # Scorer and profiles
β”‚   β”œβ”€β”€ federation/   # Federated discovery client
β”‚   β”œβ”€β”€ policy/       # Policy enforcement engine
β”‚   β”œβ”€β”€ observability/# Audit logging
β”‚   β”œβ”€β”€ api/          # FastAPI routes and middleware
β”‚   └── service/      # Core discovery pipeline
β”œβ”€β”€ schema/           # JSON Schema Draft 7 definitions
β”œβ”€β”€ protocol-vectors/ # Canonical test fixtures
β”œβ”€β”€ data/             # Sample providers and offerings
β”œβ”€β”€ docs/             # Protocol documentation
β”œβ”€β”€ examples/         # Usage examples
β”œβ”€β”€ tests/            # Test suites
└── sdk/              # SDK stubs (Go planned)

Testing

# All tests
pytest tests/ -v

# By suite
pytest tests/unit/ -v
pytest tests/functional/ -v
pytest tests/schema_validation/ -v
pytest tests/protocol_vectors/ -v
pytest tests/interoperability/ -v

Contributing

See CONTRIBUTING.md and CODE_OF_CONDUCT.md.

License

Apache 2.0 β€” see LICENSE.

About

A protocol for intent-driven discovery of agents, services, and products.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors