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.
Query Models
Send a question to 2+ LLM models simultaneously via OpenRouter (GPT, Claude, Gemini).
Measure D-Score
Compute the divergence score D between model responses. D = 0 means perfect consensus, D = 1 means total disagreement.
Iterate with φ
Each iteration narrows disagreement by the golden ratio (1/φ ≈ 0.618). Models refine their positions toward convergence.
Consensus Reached
When D drops below threshold (default 0.05), consensus is achieved. Confidence = (1 - D) × 100%.
Convergence after 7 iterations
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_consensusRun multi-model AI consensus. Send a query to multiple LLMs and achieve verified agreement through iterative phi-convergence.
Parameters
querystringrequiredThe question or statementmodelsstring[]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=7Fact Verification
axiom_verifyVerify a factual claim via multi-model consensus. Uses sonata structure (thesis → antithesis → synthesis) with 5 fixed iterations.
Parameters
claimstringrequiredStatement to verifymodelsstring[]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.
structure="fugue"Sonata
Thesis → Antithesis → Synthesis
Structured dialectic: one model proposes, another challenges, then models synthesize. Ideal for debates and controversial topics.
structure="sonata"Concert
Leader + Ensemble
One model leads the direction while others refine and harmonize. Perfect for creative tasks where coherent vision matters.
structure="concert"D-Score Reference
The divergence score D measures disagreement between models. D = 0 means perfect consensus, D = 1 means total disagreement.
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.
{
"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
}workerUrlstringrequiredAxiom Protocol consensus worker endpoint
apiKeystringrequiredOpenRouter API key (or use OPENROUTER_API_KEY env)
defaultModelsstring[]Default model list (min 2). Defaults: GPT-4o-mini, Claude 3 Haiku, Gemini Pro
maxIterationsnumber1–7. Default: 7 (≈ 3.4% remaining disagreement)
structureenumfugue | sonata | concert. Default: fugue
dThresholdnumber0–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.
MISSING_WORKER_URLWorker URL is requiredSet workerUrl in plugin configMISSING_API_KEYAPI key is requiredSet OPENROUTER_API_KEY env or apiKey in configEMPTY_QUERYQuery cannot be emptyProvide a non-empty query stringINSUFFICIENT_MODELSAt least 2 models requiredAdd more models to the request or defaultModels configAUTH_FAILEDInvalid API key (401/403)Check your OpenRouter API keyRATE_LIMITEDRate limited (429)Wait and try again laterSERVER_ERRORServer error (500)Check worker logs for detailsRETRY_EXHAUSTEDAll retries failedUp to 2 retries with 1s+ delay. Check network and worker healthtimeoutMs (default: 120,000ms / 2 minutes). Network failures produce a connection error with the target URL.