辛普莱克斯,一个分布式代理之间的语义协商开源协议。
Symplex, an open-source protocol semantic negotiation between distributed agents

原始链接: https://github.com/olserra/symplex

## 代理语义协议:赋能人工智能代理通信 代理语义协议 (ASP) 是模型上下文协议 (MCP) 的一个轻量级扩展,专为人工智能代理网络设计。目前正在积极开发中(v0.1 版本稳定),ASP 允许代理基于*意义*而非严格的 API 模式进行通信。它通过交换“意图向量”来实现这一点——目标的紧凑数值表示,从而实现协商、委托和协作,而无需预定义的 API。 主要特性包括:通过余弦相似度排序进行自发协商,使用基于 TTL 的注册表进行动态能力发现,以及通过去中心化标识符 (DID) 和 Ed25519 密钥对建立联合信任。ASP 利用点对点 (P2P) libp2p 网络进行传输,从而实现分布式工作流程和语义路由。 与 MCP 和 Google 的 A2A 相比,ASP 提供了动态能力发现、自发协商以及强大的身份/信任机制。该项目是开源的(MIT 许可证),并提供了握手和协商演示示例,以及 Go 导入说明。未来的开发重点是 QUIC/WebRTC 传输、签名验证以及具有多语言 SDK 的稳定线路格式。 有关详细规范、实施计划和贡献指南,请访问项目的 GitHub 仓库:[https://github.com/agent-semantic-protocol-protocol/agent-semantic-protocol](https://github.com/agent-semantic-protocol-protocol/agent-semantic-protocol)。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Symplex,一个开源协议,用于分布式代理之间的语义协商 (github.com/olserra) 6 分,来自 olserra 1小时前 | 隐藏 | 过去 | 收藏 | 2 评论 帮助 dbmikus 30分钟前 | 下一个 [–] 我认为 README 可以使用一些实际用例示例。我从抽象意义上理解它,但不确定它相对于纯文本通信的好处是什么,除了节省token消耗。回复 olserra 1小时前 | 上一个 [–] Symplex v0.1 现在具有每条消息的 Ed25519 签名! 每个 IntentMessage 和 NegotiationResponse 都会进行加密签名,从而提高 p2p 工作流程的安全性与信任度。 所有测试都通过了——里程碑达成。 #Symplex #Ed25519 #安全 #GoLang 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请YC | 联系 搜索:
相关文章

原文

Semantic Interoperability Layer for AI Agents — a lightweight extension of MCP (Model Context Protocol) built for the era of agentic AI meshes.

Go Report Card CI License: MIT

Status: Active development — v0.1 core is stable. See docs/plans/ for the current implementation roadmap.


What Is Agent Semantic Protocol?

Agent Semantic Protocol enables AI agents to communicate by meaning, not schema. Instead of exchanging rigid JSON tool calls, agents share semantic intent vectors — compact float32 embeddings that describe goals in a shared latent space. Any agent that understands the vector space can negotiate, delegate, and collaborate — without pre-registered APIs.

Concept Description
Intent Vector A []float32 embedding (e.g. 384-dim sentence-transformer) that encodes the semantic goal of a request
Spontaneous Negotiation Agents advertise capabilities and bid on intents without a central broker
Dynamic Discovery A TTL-based capability registry lets agents appear/disappear at runtime
Federated Trust (DIDs) Each agent has a did:agent-semantic-protocol:<sha256(pubkey)> identifier backed by an Ed25519 key-pair
Distributed Workflows Accepted intents unfold into ordered workflow steps, dispatched across capable peers via libp2p

Comparison: Agent Semantic Protocol vs. MCP vs. A2A

Feature MCP (Anthropic) Google A2A Agent Semantic Protocol
Message format JSON-RPC 2.0 JSON (task objects) Protobuf wire + intent vectors
Capability model Static tool registry Static skill cards Dynamic, TTL-based discovery
Negotiation None (direct call) None Spontaneous cosine-similarity ranking
Identity / trust None None Ed25519 DIDs, federated trust graph
Transport HTTP/SSE HTTP libp2p (TCP/QUIC/WebRTC)
Peer topology Client–server Client–server P2P mesh
Semantic routing No No Yes (vector similarity)
Distributed workflows No Task delegation only Yes (multi-step, multi-agent)

agent-semantic-protocol/
├── proto/agent-semantic-protocol.proto          # Protobuf message definitions (reference)
├── core/
│   ├── types.go                 # Go struct definitions
│   ├── encoding.go              # Protobuf wire encode/decode (no codegen required)
│   ├── did.go                   # DID generation, verification, trust graph
│   ├── handshake.go             # Cryptographic handshake protocol
│   ├── negotiation.go           # Intent negotiation + cosine ranking
│   ├── discovery.go             # Capability discovery registry
│   ├── encoding_test.go         # Unit tests (encoding, DID, cosine, discovery)
│   └── signing_test.go          # Unit tests (per-message Ed25519 signing)
├── p2p/
│   ├── host.go                  # libp2p AgentHost wrapper
│   ├── host_test.go             # Integration tests (handshake, intent, announce)
│   └── protocol.go              # WorkflowOrchestrator, convenience helpers
├── picoclaw/
│   └── client.go                # Adapter for Picoclaw AI assistant API
├── examples/
│   ├── simple-handshake/main.go # Two agents handshake over TCP
│   └── negotiation-demo/main.go # Full intent → negotiation → workflow loop
├── docs/
│   ├── spec.md                  # Protocol specification
│   └── plans/                   # Versioned implementation plans
└── .github/workflows/ci.yml    # GitHub Actions CI

git clone https://github.com/agent-semantic-protocol-protocol/agent-semantic-protocol
cd agent-semantic-protocol

go mod download   # fetch all dependencies (including libp2p)

# Run the handshake demo
go run ./examples/simple-handshake/main.go

# Run the negotiation + workflow demo
go run ./examples/negotiation-demo/main.go

Expected output (handshake demo)

╔══════════════════════════════════════════════╗
║     Agent Semantic Protocol v0.1 — Simple Handshake Demo     ║
╚══════════════════════════════════════════════╝

✓ Agent Alpha started
  Peer ID : 12D3KooW...
  DID     : did:agent-semantic-protocol:3a7f...
  Caps    : [nlp reasoning intent-parsing]

✓ Agent Beta started
  ...

── Performing Agent Semantic Protocol Handshake ─────────────────────────────────────
[Beta] ← Handshake from "agent-alpha"  caps=[nlp reasoning intent-parsing]

[Alpha] ✓ Handshake complete!
  Peer caps  : [code-generation math vector-search storage]
  Protocol   : 1.0.0
make test
# or: go test -v -race ./...

Using Agent Semantic Protocol in Your Go Project

import (
    "github.com/agent-semantic-protocol-protocol/agent-semantic-protocol/core"
    "github.com/agent-semantic-protocol-protocol/agent-semantic-protocol/p2p"
)

// 1. Create an agent identity
agent, _ := core.NewAgent("my-agent", []string{"nlp", "summarisation"})

// 2. Start a P2P host
host, _ := p2p.NewHost(ctx, agent)

// 3. Register intent handler
host.OnIntent(func(peerID peer.ID, intent *core.IntentMessage) *core.NegotiationResponse {
    h := core.DefaultNegotiationHandler(agent)
    resp, _ := h(intent)
    return resp
})

// 4. Send an intent to a known peer
intent, _ := core.CreateIntent(agent,
    []float32{0.8, 0.2, 0.9}, // embedding
    []string{"summarisation"},
    "Summarise this document",
)
resp, _ := host.SendIntent(ctx, targetPeerID, intent)
bus := core.NewNegotiationBus()
bus.Register("agent-b", core.DefaultNegotiationHandler(agentB))

intent, _ := core.CreateIntent(agentA, vector, []string{"code-generation"}, payload)
resp, _ := bus.Negotiate("agent-b", intent)
client := picoclaw.NewClient("https://api.picoclaw.io",
    picoclaw.WithAPIKey("pk_..."),
    picoclaw.WithAgentID("my-picoclaw-agent"),
)
// Register as a Agent Semantic Protocol negotiation handler
bus.Register("picoclaw", client.AsNegotiationHandler())

Regenerate Protobuf Bindings (Optional)

The core/ package uses protowire directly and does not require generated code. If you want the generated *.pb.go files for gRPC or reflection:

make proto   # requires protoc + protoc-gen-go

  1. Fork the repo and create a feature branch.
  2. Run make test and make lint — all must pass.
  3. Open a Pull Request with a clear description of the change.
  4. Follow conventional commits (feat:, fix:, docs:, …).

Please read docs/spec.md before proposing wire-format changes — backward compatibility is critical.


Version Feature Status
v0.1 Core protocol, handshake, negotiation, discovery, p2p transport
v0.1 Capability announcement handling in P2P (MsgCapability → DiscoveryRegistry)
v0.1 P2P integration tests (handshake, intent accept/reject, announce)
v0.1 Per-message Ed25519 signing (IntentMessage, NegotiationResponse)
Version Feature
v0.2 QUIC transport (pending quic-go TLS session-ticket fix), WebRTC support
v0.2 Signature verification on receive (currently signed but not verified on inbound)
v0.3 Federated DID resolution (DID document over DHT), zk-SNARK capability proofs
v1.0 Stable wire format, MCP gateway adapter, multi-language SDKs (Python, TypeScript)

See docs/plans/ for detailed implementation plans with exact file paths and test commands.


MIT — see LICENSE.

联系我们 contact @ memedata.com