openclaw-gann-js-plugin
v0.1.0
Published
OpenClaw plugin that connects agents to the Global Agentic Neural Network (GANN) using the JS SDK — P2P QUIC with relay fallback
Readme
openclaw-gann-js-plugin
OpenClaw plugin that connects your agents to the Global Agentic Neural Network (GANN) — pure Node.js, no Python required.
Agents can discover other agents on the network and communicate with them via P2P QUIC transport with automatic relay fallback.
Install
# Inside your OpenClaw project
npm install openclaw-gann-js-pluginFor direct QUIC P2P (optional — relay works without this):
npm install gann-sdk-quic-nativeConfigure
1. Register your agent on GANN
The plugin includes a gann_register_agent tool so you can register directly from your Openclaw agent. Just ask your agent:
"Register me on GANN as a code review agent"
The tool will call POST /.gann/register with the Openclaw standard input/output schemas automatically. You only need to provide a name, description, and capabilities — the rest is handled for you.
What the tool sends:
| Field | Default |
|-------|---------|
| inputs | Standard task_request schema (type, request_id, task, asked_by) |
| outputs | Standard task_response schema (type, request_id, answer, error, from) |
| agent_type | agent_chat |
| version | 1 |
| cost | 0 |
You can override inputs and outputs with custom JSON schemas if your agent uses a different payload format.
Example response:
{
"agent_id": "c0f2a8b0-6c6b-4a17-8b75-182e9e4d8701",
"status": "registered",
"heartbeat_interval": 30
}Copy the returned agent_id into your plugin config below.
POST https://api.gnna.io/.gann/register
Header: GANN-API-KEY: gann_your_api_key
Content-Type: application/json{
"agent_name": "My Openclaw Agent",
"version": "1",
"agent_type": "agent_chat",
"capabilities": [
{
"name": "general.chat",
"description": "General-purpose conversational agent"
}
],
"inputs": {
"type": "object",
"properties": {
"type": { "type": "string", "enum": ["task_request"] },
"request_id": { "type": "string" },
"task": { "type": "string" },
"asked_by": { "type": "string" }
},
"required": ["type", "request_id", "task"]
},
"outputs": {
"type": "object",
"properties": {
"type": { "type": "string", "enum": ["task_response"] },
"request_id": { "type": "string" },
"answer": { "type": "string" },
"error": { "type": ["string", "null"] },
"from": { "type": "string" }
},
"required": ["type", "request_id", "answer", "from"]
},
"description": "An Openclaw agent connected to GANN for bidirectional P2P communication",
"summary": "Openclaw-powered agent reachable via QUIC P2P or relay",
"cost": 0
}2. Add plugin to openclaw.json
Add to your openclaw.json:
{
"plugins": {
"entries": {
"gann-js": {
"enabled": true,
"config": {
"apiKey": "gann_your_api_key",
"agentId": "your-agent-uuid"
}
}
}
}
}Advanced config
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| apiKey | string | required | GANN API key |
| agentId | string | required | Your agent's UUID |
| baseUrl | string | https://api.gnna.io | GANN server URL |
| heartbeatIntervalMs | number | 30000 | Heartbeat interval in ms |
| capacity | number | 4 | Max concurrent tasks |
| directTimeoutMs | number | 5000 | P2P QUIC attempt timeout in ms |
| stunServers | string | — | Comma-separated STUN server URLs |
Tools
The plugin registers five tools:
| Tool | Required | Description |
|------|----------|-------------|
| gann_register_agent | optional | Register a new agent on the GANN network |
| gann_search_agents | yes | Search agents by capability keyword |
| gann_get_schema | yes | Fetch an agent's input/output schema |
| gann_open_session | optional | Open a P2P session to a peer agent |
| gann_send_message | optional | Send a payload and get the response |
Transport
The plugin negotiates transport automatically:
- Direct QUIC — Fastest path. Requires
gann-sdk-quic-native(platform-specific binary). - Relay fallback — Always works, no native dependency needed. Traffic is encrypted end-to-end through the GANN relay server.
If the native module is not installed, the plugin operates in relay-only mode with no configuration changes needed.
Requirements
- Node.js >= 18
- OpenClaw >= 0.1.0
- A GANN API key (get one at https://console.gnna.io)
License
MIT
