人工智能时代的记忆通信基础设施协议。
从物理帧到语义应用,七层完整规范,
任意 AI × 任意数据库,高度一致,无限进化。
The memory communication infrastructure protocol for the AI era.
From physical frames to semantic application — 7 complete layers,
any AI × any database, highly consistent, infinitely evolving.
现有协议——MCP、SMP 及所有类似框架——本质上是语义层的君子协定。 它们没有二进制帧格式,没有状态机约束,没有因果时钟,没有端侧固化规范。 协议违规时没有强制断开,知识更新时没有一致性保证,冷启动时没有确定性调度。 Existing protocols — MCP, SMP, and all similar frameworks — are essentially gentleman's agreements at the semantic layer. No binary frame format, no state machine constraints, no causal clocks, no edge solidification spec. No forced disconnect on violation, no consistency guarantee on update, no deterministic scheduling on cold boot.
AMCP 的出发点是:AI 是无状态的,但世界是有状态的。 HTTP 解决了无状态网络传递有状态文档的问题,TCP 解决了不可靠网络传递可靠数据的问题。 AMCP 解决的是:无记忆 AI 节点如何可靠地共享、进化、持久化知识。 AMCP starts from: AI is stateless, but the world is stateful. HTTP solved stateless networks carrying stateful documents. TCP solved unreliable networks carrying reliable data. AMCP solves: how memoryless AI nodes reliably share, evolve, and persist knowledge.
每一层对上层提供服务,对下层屏蔽实现。任意厂商可独立实现任意层,只须符合该层接口规范。Each layer provides services to the layer above and hides implementation from below. Any vendor can independently implement any layer, as long as it conforms to that layer's interface spec.
所有 AMCP 节点通过 amcp:// URI 唯一标识,并在连接时发送能力声明。
// 节点地址格式 amcp://{node_type}.{vendor}.{capability_fingerprint}.{region} // 示例 amcp://ai.anthropic.claude-sonnet-4-6.fp-a3c9f2.us-east-1 amcp://db.stepmind.sqlite-wal-v3.fp-7d2e11.local amcp://gateway.stepmind.hub-v1.fp-abcdef.global // 能力声明 (连接时 MUST 发送) { "amcp_version": "1.0.0", "node_type": "ai", "capabilities": { "memory_read": true, "memory_write": true, "amql_query": true, "max_context_tokens": 200000, "supported_amf_versions": ["1.0"] }, "trust_level": "verified" }
AI 不再手动管理上下文。CSE 自动计算每条记忆的 ROI,确定性地填充上下文窗口。
// Memory ROI = (relevance × confidence × recency_factor) / token_cost relevance = cosine_similarity(task_vector, memory_vector) // 0.0–1.0 confidence = amf.core.confidence // 0.0–1.0 recency = 1.0 / (1 + decay_rate × days_since_access) // KT-FACT = 1.0 token_cost = estimated_tokens(serialized_amf) // 上下文窗口分配 (200K tokens 示例) RESERVED = 1% → 2K // 协议头, 不可驱逐 CORE_PRINCIPLES= 4% → 8K // KT-FACT + KT-PITFALL, 不可驱逐 HIGH_ROI = 25% → 50K // 当前任务最相关 MEDIUM_ROI = 15% → 30K // 关联历史 WORKING_MEMORY = 45% → 90K // 当前对话 OVERFLOW_BUFFER= 10% → 20K // 动态压缩缓冲
// 语义搜索 RECALL * WHERE semantic_match('止损策略') AND type IN [KT-FACT, KT-PITFALL] AND confidence > 0.8 LIMIT tokens(10000) // 因果查询 (HTTP 做不到的) RECALL * WHERE caused_by = session_id('S-20260313-143022-abc') OR referenced_by = qef_signal_id('QEF-001-20260313') // 跨项目教训查询 RECALL * WHERE type = KT-PITFALL AND tags CONTAINS 'api_integration' AND project != current_project() ORDER BY confidence DESC LIMIT rows(20) // 写入知识 REMEMBER {amf_object} // 失效知识 (不是删除) FORGET knowledge_id REASON "OKX API major version change"
所有 AMCP 通信 MUST 使用此帧格式。大端字节序。总 Header 50 字节。All AMCP communication MUST use this frame format. Big-endian byte order. Total header: 50 bytes.
0x0001 COLD_BOOT_REQUEST AI 节点启动,请求记忆加载 0x0002 COLD_BOOT_RESPONSE DB 节点返回冷启动记忆包 0x0010 MEMORY_READ 读取记忆请求 0x0012 MEMORY_WRITE 写入记忆 0x0014 MEMORY_INVALIDATE 失效记忆(非删除) 0x0020 SYNC_PUSH 主动推送记忆更新 0x0030 QEF_SIGNAL 量化进化信号 0x0060 SESSION_BEGIN 会话开始 0x0061 SESSION_END 会话结束 0x00FE ERROR 应用层错误(可恢复) 0x00FF PROTOCOL_VIOLATION 协议违规 → 强制断开,不可恢复
INIT ──────────────→ HANDSHAKING ──────────→ COLD_BOOTING
↑ 能力协商 ↓ 冷启动完成
│ ACTIVE ←──────┐
│ ↓ ↑ │
│ SYNCING │
│ ↓ │
│ SUSPENDED ───────┘
│ ↓
│ TERMINATING
│ ↓
└───────── ANY ────→ TERMINATED
↑
0x00FF PROTOCOL_VIOLATION
// 禁止的转换 → 立即触发 PROTOCOL_VIOLATION
INIT → ACTIVE // 跳过握手
TERMINATED → ANY // 已终止会话不可复活
COLD_BOOTING → SYNCING // 冷启动未完成就同步
AMF 是 AMCP 的知识编码标准。核心陈述 MUST 使用结构化三元组(subject-predicate-object), 而非自然语言,以确保跨 AI 的语义一致性。自然语言仅作为人类可读注释。
{
"knowledge_id": "K-a3f9c2e1b4d87a60f2e8c1b9d3a5f7e2...",
"amf_version": "1.0",
"type": "KT-PITFALL",
"core": {
"subject": "OKX.API.Order.TP_SL",
"predicate": "REQUIRES", // 结构化谓词,跨AI语义一致
"object": "attachAlgoOrds",
"condition": "when: tp_sl_needed = true",
"confidence": 0.99,
"evidence": ["session:S-20260310-143022", "incident:PROD-2026-03-10"]
},
"meta": {
"created_at": "2026-03-10T14:35:00Z",
"created_by": "amcp://ai.anthropic.claude-sonnet-4-6.fp-a3c9f2.us-east-1",
"project_scope": ["StepQuant", "OKX-integration"],
"decay_model": { "type": "event_triggered", "invalidation_events": ["OKX.API.MAJOR_VERSION_CHANGE"] }
},
"distribution": {
"locality": "local",
"sync_priority": "immediate", // 写入后500ms内广播
"access_tier": "hot"
},
"causal": {
"caused_by": [],
"hlc": "2026-03-10T14:35:00.123Z-0001-node_abc" // 混合逻辑时钟
},
"annotation": {
"natural_language": "OKX TP/SL必须通过attachAlgoOrds,直接用tpTriggerPx会被静默忽略",
"tags": ["okx", "api", "tp_sl", "critical"]
},
"integrity": {
"checksum": "sha256:e3b0c44298fc1c149afbf4c8996fb924...",
"tamper_evident": true
}
}
声称实现 AMCP 的节点 MUST 通过 Level-1 测试。Level-3 通过者可申请官方参考实现认证。Any node claiming AMCP compliance MUST pass Level-1 tests. Level-3 passers may apply for official reference implementation certification.
阶跃九思 · 无限进化 · StepMind CommunityNine Steps, Infinite Evolution · StepMind Community
AMCP 是开放协议,任何个人或组织均可自由实现。 通过 Level-1 一致性测试的实现可在 StepMind AMCP Registry 注册。 第一个通过 Level-3 的实现将成为官方参考实现。 AMCP is an open protocol, freely implementable by any individual or organization. Implementations passing Level-1 conformance tests may register in the StepMind AMCP Registry. The first implementation to pass Level-3 will become the official reference implementation.