# AgenThink Mesh — Protocol Specification ## NAN-RELAY/1.0 · NAN-HS/1.0 · Grounding Gate/1.0 **Status:** Draft v0.1 **Authors:** AgenThink Engineering **Date:** March 2026 --- ## 1. Overview The **National Agentic Network (NAN) Protocol** defines how AI agents discover, authenticate, and communicate with each other via the AgenThink Mesh orchestration layer. It answers three questions every multi-agent system must answer: 1. **Where is the right agent?** → Universal Agent Directory (UAD) 2. **What does the next agent need to know?** → State-Relay Protocol 3. **Is the agent's output trustworthy?** → Grounding Gate --- ## 2. NAN Address Scheme Every agent in the Mesh has a globally unique NAN address: ``` nan:///// Examples: nan://kw/finance/etf-allocator/2.1 nan://global/research/web-researcher/2.1 nan://ae/legal/adgm-compliance/1.0 ``` **Fields:** - `country` — ISO 3166-1 alpha-2 country code, or `global` - `domain` — functional category (`finance`, `legal`, `research`, `strategy`, `compliance`, `meta`) - `name` — kebab-case agent identifier - `version` — semantic version (major.minor) --- ## 3. State-Relay Protocol (NAN-RELAY/1.0) ### 3.1 State-Packet Structure ```json { "packet_id": "sp_8f3a92c1d", "mission_id": "msn_001", "sequence": 2, "from_agent": "nan://global/research/web-researcher/2.1", "to_agent": "nan://kw/legal/contract-analyst/1.5", "context": { "Research Agent": { "output": "...", "timestamp": "2026-03-01T09:14:22Z" }, "_summary": "Rolling mission summary..." }, "partial_output": "Agent A output here", "confidence": 0.91, "grounding": { "result": "passed", "sources_verified": ["https://source1.com", "https://source2.com"], "confidence_delta": 0.02 }, "is_rerouted": false, "expires_at": "2026-03-01T09:19:22Z", "mesh_signature": "NAN-SIG:sha256:7f2a...b4c9", "issued_by": "nan://mesh/orchestrator/core/1.0" } ``` ### 3.2 Relay Flow ``` Agent A Output │ ▼ ┌─────────────────────────────┐ │ Grounding Gate │ ← verifies claims via MCP web search │ (hallucination check) │ └─────────────────────────────┘ │ PASS │ FAIL → Rerouter evaluates failover ▼ ┌─────────────────────────────┐ │ State-Packet Factory │ ← merges A's output into context │ create_packet(...) │ └─────────────────────────────┘ │ ▼ ┌─────────────────────────────┐ │ Orchestrator Router │ ← selects next agent from pipeline │ relay_engine.relay(...) │ └─────────────────────────────┘ │ ▼ Agent B receives full State-Packet (no context loss, no re-onboarding) ``` --- ## 4. Grounding Gate (Grounding-Gate/1.0) ### 4.1 Trigger Conditions The Grounding Gate activates on every agent output that contains: - Numerical claims (years, percentages, financial figures) - Recency signals (`"current"`, `"latest"`, `"as of"`) - Attribution phrases (`"according to"`, `"reported by"`) - Legal/regulatory references ### 4.2 Verification Method Claims are verified via **MCP web search** (2026 standard): ```python # MCP tool call { "type": "web_search_20260101", "name": "web_search" } ``` ### 4.3 Pass/Fail Thresholds | Condition | Action | |---|---| | ≤ 2 claims fail verification | PASS | | > 2 claims fail verification | FAIL → trigger Rerouter | | No verifiable claims found | AUTO-PASS | | `require_grounding=False` | SKIP | --- ## 5. Dynamic Rerouting ### 5.1 Reroute Triggers | Trigger | Severity | Action | |---|---|---| | Agent unreachable | HIGH | Immediate reroute | | Grounding Gate FAIL | CRITICAL | Immediate reroute | | Confidence < 0.70 | MEDIUM | Reroute if alternative available | | Latency > 2× SLA | LOW | Log warning, continue | ### 5.2 Agent Scoring (for reroute selection) ``` score = (trust_tier_weight × 0.40) + (trust_score × 0.30) + (domain_match × 0.20) + (latency_score × 0.10) ``` ### 5.3 Trust Score Updates After every mission step, the Rerouter adjusts the agent's trust score: - `+0.02` on success - `+0.01` bonus for meeting latency SLA - `−0.05` on failure - `−0.03` additional penalty for severe latency breach (> 2× SLA) --- ## 6. Authentication (NAN-HS/1.0) All agent-to-mesh communication uses: - **mTLS** — mutual TLS with 15-minute rotating certificates - **JWT** — signed with Ed25519, 15-minute expiry - **Packet Signature** — SHA-256 HMAC on packet payload Production environments additionally require: - ADGM Digital Asset registry anchoring for T1_SOVEREIGN agents - PDPL-compliant data residency enforcement for Kuwait jurisdiction --- ## 7. Compatibility | Standard | Version | Notes | |---|---|---| | LangGraph | ≥ 0.2.0 | State machine orchestration | | PydanticAI | ≥ 0.0.14 | Schema validation | | MCP | ≥ 1.0.0 | Web search + tool calls | | FastAPI | ≥ 0.115.0 | Orchestrator API | | Python | ≥ 3.11 | Type system requirements | --- *AgenThink · Kuwait City · ADGM-Registered · MIT License*