OpenClaw Plugin

Axiom Protocol
for OpenClaw

Multi-model AI consensus through φ-convergence. Query multiple LLMs, measure divergence, achieve mathematically guaranteed agreement.

Core Algorithm

D(n) = D(0) × (1/φ)n

Each iteration reduces disagreement by the golden ratio.
After 7 iterations, only 3.4% disagreement remains.

How φ-Convergence Works

The Axiom Protocol uses the golden ratio to mathematically guarantee consensus between AI models in a finite number of iterations.

01

Query Models

Send a question to 2+ LLM models simultaneously via OpenRouter (GPT, Claude, Gemini).

02

Measure D-Score

Compute the divergence score D between model responses. D = 0 means perfect consensus, D = 1 means total disagreement.

03

Iterate with φ

Each iteration narrows disagreement by the golden ratio (1/φ ≈ 0.618). Models refine their positions toward convergence.

04

Consensus Reached

When D drops below threshold (default 0.05), consensus is achieved. Confidence = (1 - D) × 100%.

Convergence after 7 iterations

D(0)
3.4%

D(7) = D(0) × (1/φ)&sup7; ≈ 0.034 × D(0)

Two Powerful Tools

The plugin exposes two tools for OpenClaw: full multi-model consensus and single-claim fact verification.

Full Consensus

axiom_consensus

Run multi-model AI consensus. Send a query to multiple LLMs and achieve verified agreement through iterative phi-convergence.

Parameters

querystringrequiredThe question or statement
modelsstring[]Model identifiers (min 2, default: GPT + Claude + Gemini)
structureenumfugue | sonata | concert (default: fugue)
max_iterationsnumber1–7 (default: 7)
axiom_consensus query="What is the capital of France?"
  models=["openai/gpt-5.4-mini",
          "anthropic/claude-haiku-4-5",
          "google/gemini-2.5-flash"]
  structure="fugue"
  max_iterations=7

Fact Verification

axiom_verify

Verify a factual claim via multi-model consensus. Uses sonata structure (thesis → antithesis → synthesis) with 5 fixed iterations.

Parameters

claimstringrequiredStatement to verify
modelsstring[]Model identifiers (min 2)
axiom_verify claim="Python was created by
  Guido van Rossum in 1991"
  models=["openai/gpt-5.4","anthropic/claude-sonnet-4-6"]

Consensus Structures

Choose the right musical pattern for your consensus task. Each structure shapes how models interact during the convergence process.

Fugue

Deep Layered Analysis

Models build on each other’s responses in layers, creating a complex polyphonic analysis. Best for nuanced, multi-faceted questions where depth matters.

Best for:Complex questions
Examples:Science debates, philosophy, technical architecture decisions
structure="fugue"

Sonata

Thesis → Antithesis → Synthesis

Structured dialectic: one model proposes, another challenges, then models synthesize. Ideal for debates and controversial topics.

Best for:Debates & conflicts
Examples:Policy analysis, ethical dilemmas, competing approaches
structure="sonata"

Concert

Leader + Ensemble

One model leads the direction while others refine and harmonize. Perfect for creative tasks where coherent vision matters.

Best for:Creative tasks
Examples:Content generation, brainstorming, creative writing
structure="concert"

D-Score Reference

The divergence score D measures disagreement between models. D = 0 means perfect consensus, D = 1 means total disagreement.

0
1
StrongHighModerateLowNone
D-Score RangeLevelConfidence
0.00 – 0.05Strong Consensus95–100%
0.05 – 0.20High Confidence80–95%
0.20 – 0.40Moderate60–80%
0.40 – 0.60Low Confidence40–60%
0.60 – 1.00No Consensus0–40%

Default consensus threshold: dThreshold = 0.05 (strong consensus required)

Setup & Configuration

Get the Axiom Protocol plugin running in your OpenClaw instance in minutes.

Running OpenClaw Instance

An OpenClaw installation with plugin support enabled.

OpenRouter API Key

Get your key at openrouter.ai. Set as OPENROUTER_API_KEY environment variable or pass directly in config.

Axiom Protocol Worker

Deploy the consensus worker from ACP-PROJECT or use a hosted endpoint.

openclaw.plugin.json
{
  "workerUrl": "https://your-worker.workers.dev",
  "apiKey": "sk-or-v1-...",
  "defaultModels": [
    "openai/gpt-5.4-mini",
    "anthropic/claude-haiku-4-5",
    "google/gemini-2.5-flash"
  ],
  "maxIterations": 7,
  "structure": "fugue",
  "dThreshold": 0.05
}
Configuration Parameters
workerUrlstringrequired

Axiom Protocol consensus worker endpoint

apiKeystringrequired

OpenRouter API key (or use OPENROUTER_API_KEY env)

defaultModelsstring[]

Default model list (min 2). Defaults: GPT-4o-mini, Claude 3 Haiku, Gemini Pro

maxIterationsnumber

1–7. Default: 7 (≈ 3.4% remaining disagreement)

structureenum

fugue | sonata | concert. Default: fugue

dThresholdnumber

0–1. D-score below this = consensus reached. Default: 0.05

Error Handling

The plugin provides structured error codes for every failure scenario. No retry on auth errors (401/403) or client errors (4xx). Server errors (5xx) are retried automatically up to 2 times.

Error CodeDescriptionResolution
MISSING_WORKER_URLWorker URL is requiredSet workerUrl in plugin config
MISSING_API_KEYAPI key is requiredSet OPENROUTER_API_KEY env or apiKey in config
EMPTY_QUERYQuery cannot be emptyProvide a non-empty query string
INSUFFICIENT_MODELSAt least 2 models requiredAdd more models to the request or defaultModels config
AUTH_FAILEDInvalid API key (401/403)Check your OpenRouter API key
RATE_LIMITEDRate limited (429)Wait and try again later
SERVER_ERRORServer error (500)Check worker logs for details
RETRY_EXHAUSTEDAll retries failedUp to 2 retries with 1s+ delay. Check network and worker health
Timeout is configurable via timeoutMs (default: 120,000ms / 2 minutes). Network failures produce a connection error with the target URL.

Links & Resources