SemDHT: Certified Semantic Discovery for Peer-to-Peer Agent Networks over Exact-Key DHTs
Organizations: Shenzhen University · Guangzhou University · The Chinese University of Hong Kong
Abstract
Agents may need capabilities exposed through external agent endpoints or service APIs. When a requester is not already bound to a provider, it must discover advertised capabilities matching its task and interface requirements. Over exact-key distributed hash tables (DHTs), broad retrieval transfers large candidate lists, whereas selective retrieval may miss relevant providers or require more replication and lookups. Open publication also lets providers inflate their exposure unless publication bounds are enforceable. We present SemDHT, a certified semantic index for discovering agent-accessible capabilities over exact-key DHTs. A two-layer semantic sketch uses coarse cells to group nearby descriptors and residual codes to narrow candidate selection. Providers publish at a bounded set of derived keys, while requesters probe precision keys before broader recall keys within a lookup budget. Anchor committees certify each descriptor's publication-key set, enabling storage services and requesters to enforce descriptor-to-key consistency. On real API descriptors and task queries, SemDHT achieves recall@10 of 0.955 against exact embedding-space neighbors and 0.947 against ToolBench relevance labels. On a corpus with controlled density augmentation, it matches the candidate exposure of tuned locality-sensitive hashing (LSH) over a DHT at recall 0.95 with 7.7x fewer lookups and reduces publication fan-out from 16 to 10. A Go/libp2p prototype deployed on same-region and cross-region 200-peer cloud overlays replays 299 Internet queries. With parallel probes and cold certificate caches, SemDHT achieves mean completion-time speedups of 3.64x and 4.11x over LSH, respectively.
Figures & tables
| recall target | recall | exposure | fan-out | |
|---|---|---|---|---|
| 0.90 | 0.902 | 62.6% | 15 | |
| 0.95 | 0.950 | 72.8% | 8 | |
| 0.97 | 0.970 | 80.1% | 9 |
| Deployment | Region | VMs | Peers/VM | vCPU | RAM |
|---|---|---|---|---|---|
| Same-region | Frankfurt | 8 | 25 | 4 | 8 GB |
| Cross-region | Eight regions | 8 | 25 | 4 | 8 GB |
| Requester | Frankfurt | 1 | – | 8 | 16 GB |
| Placement | System | Lookups | RPCs | MiB |
|---|---|---|---|---|
| Same | SemDHT | 32.59 | 130.91 | 2.913 |
| Same | LSH | 256.00 | 777.85 | 2.945 |
| Cross | SemDHT | 32.59 | 130.91 | 2.913 |
| Cross | LSH | 256.00 | 777.85 | 2.945 |
| Placement | System | Cache | Mean difference [95% CI] (s) | P95 difference [95% CI] (s) |
|---|---|---|---|---|
| Same | SemDHT | Cold | 0.157 [0.075, 0.235] | 1.118 [-0.948, 2.124] |
| Same | SemDHT | Warm | -0.091 [-0.139, -0.045] | -0.127 [-0.246, 0.291] |
| Same | LSH | Cold | -0.067 [-0.175, 0.044] | 0.014 [-0.618, 0.742] |
| Same | LSH | Warm | 0.000 [-0.118, 0.116] | -0.064 [-0.521, 0.809] |
| Cross | SemDHT | Cold | 2.679 [2.540, 2.834] | 4.133 [2.315, 5.101] |
| Cross | SemDHT | Warm | 2.259 [2.114, 2.409] | 0.854 [-0.478, 3.830] |
| Validation path | Mean (ms) | 95% CI (ms) |
|---|---|---|
| Cold certificate | 10.6496 | [10.5570, 10.7422] |
| Verified certificate cached | 0.0487 | [0.0471, 0.0504] |
| CPU (%) | RSS (MiB) | ||||
|---|---|---|---|---|---|
| Scheduler | Cache | SemDHT | LSH | SemDHT | LSH |
| Parallel | Cold | 0.326 | 0.394 | 52.17 | 52.85 |
| Parallel | Warm | 0.291 | 0.440 | 52.16 | 53.00 |
| Stage-barrier | Cold | 0.336 | 0.410 | 52.50 | 52.68 |
| Stage-barrier | Warm | 0.294 | 0.431 | 51.68 | 52.89 |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Transition | Certified change and publication action |
|---|---|
| Lease renewal | Keep the epoch and certified state identity; extend the lease and replace postings with newly signed posting bodies. |
| Version update | Advance the epoch by one; certify the successor and publish at its publication keys. |
| Revocation | Advance the epoch by one; issue a tombstone and disseminate it through the stable anchor and prior publication keys. |
| Placement | System | Schedule | Cache | Mean [95% CI] (s) | P95 [95% CI] (s) | RPC errors |
|---|---|---|---|---|---|---|
| Same | SemDHT | Parallel | Cold | 3.819 [3.490, 4.156] | 10.289 [8.949, 12.742] | 1 |
| Same | SemDHT | Parallel | Warm | 3.009 [2.725, 3.315] | 8.879 [7.339, 10.099] | 0 |
| Same | SemDHT | Barrier | Cold | 3.977 [3.618, 4.334] | 11.407 [9.195, 13.323] | 0 |
| Same | SemDHT | Barrier | Warm | 2.918 [2.634, 3.215] | 8.751 [7.630, 9.779] | 0 |
| Same | LSH | Parallel | Cold | 13.897 [13.628, 14.157] | 19.721 [18.591, 20.157] | 0 |
| Same | LSH | Parallel | Warm | 13.565 [13.301, 13.843] | 18.929 [18.141, 19.786] | 0 |
| Encoded object | Bytes |
|---|---|
| Posting body | 253 |
| Provider signature | 64 |
| Membership certificate | 266 |
| Committee signature | 103 |
| Certificate with committee signature | 372 |
| Merkle inclusion proof | 143 |
| SemDHT | LSH-on-DHT | |
|---|---|---|
| recall target | exposure/probes | exposure/probes |
| 0.80 | 47.5% / 30.6 | 47.1% / 102.1 |
| 0.90 | 62.1% / 33.7 | 61.6% / 173.2 |
| 0.95 | 72.7% / 32.9 | 72.7% / 253.5 |
| 0.97 | 79.0% / 65.2 | 83.5% / 110.2 |
| Schedule | Lookups | Recall | |
|---|---|---|---|
| Clean | Attacked | ||
| One entry | 59.1 | 0.9500 | 0.7957 |
| Two, full prefix | 118.3 | 0.9500 | 0.9191 |
| Two, fixed cost | 59.1 | 0.8553 | 0.8273 |
| Read-repair | Stale-exposure integral | p95 time | Messages |
|---|---|---|---|
| Off | 3.037 | 17.96 | 0 |
| On | 1.288 | 8.95 | 1,538 |
| CPU (%) | RSS (MiB) | |||||
|---|---|---|---|---|---|---|
| System | Scheduler | Cache | Baseline | Query phase [range] | Baseline | Query phase [range] |
| SemDHT | Parallel | Cold | 0.399 | 0.326 [0.323, 0.328] | 51.87 | 52.17 [52.09, 52.25] |
| SemDHT | Parallel | Warm | 0.411 | 0.291 [0.288, 0.296] | 52.25 | 52.16 [51.76, 52.44] |
| SemDHT | Stage-barrier | Cold | 0.414 | 0.336 [0.326, 0.354] | 52.12 | 52.50 [52.29, 52.62] |
| SemDHT | Stage-barrier | Warm | 0.416 | 0.294 [0.284, 0.307] | 51.76 | 51.68 [51.47, 51.87] |
| LSH | Parallel | Cold | 0.409 | 0.394 [0.382, 0.408] | 52.44 | 52.85 [52.58, 53.11] |
Semantic Search
Semantic search retrieves information by meaning, matching queries and documents even when they use different words.
See all 42 papers