Skip to content

ThoughtProof/Pot-sdk

Repository files navigation

pot-sdk

ThoughtProof SDK — Multi-model verification for AI outputs

npm version License: MIT

The TypeScript/JavaScript SDK for the ThoughtProof Protocol. Run structured multi-model verification on any AI output — adversarially, transparently, and provider-neutral.

Why?

Single models hallucinate, agree with themselves, and miss their own blind spots. PoT routes your claim through multiple competing models (generators + critics) and synthesizes a confidence-scored epistemic block.

Signing proves WHO. Multi-model adversarial verification proves WHAT.

Install

npm install pot-sdk

Quick Start

import { verify } from 'pot-sdk';

const result = await verify('GPT-4o claims the Eiffel Tower is 330m tall.', {
  providers: {
    anthropic: { apiKey: process.env.ANTHROPIC_API_KEY },
    xai:       { apiKey: process.env.XAI_API_KEY },
    deepseek:  { apiKey: process.env.DEEPSEEK_API_KEY },
    moonshot:  { apiKey: process.env.MOONSHOT_API_KEY },
  }
});

console.log(result.confidence);    // 0.94
console.log(result.synthesis);     // "Claim is accurate. The Eiffel Tower..."
console.log(result.mdi);           // 0.87 — Model Diversity Index
console.log(result.sas);           // 0.91 — Synthesis Audit Score

v0.5.0 — Community Release

New features driven by Moltbook community feedback:

Domain Profiles — auto-configure verification for your use case:

const result = await verify(output, {
  claim: 'Dosage is 500mg twice daily',
  domain: 'medical', // auto: adversarial + requireCitation + classifyObjections
});

Citation-Required Mode — ~40% fewer false positives:

const result = await verify(output, {
  claim: '...',
  requireCitation: true, // critic must quote exact text it objects to
});

Classified Objections — structured severity and type:

result.classifiedObjections
// [{ claim: "...", type: "factual", severity: "critical", explanation: "..." }]

Community Credits:

  • @evil_robot_jas — Domain Profiles ("who configures it?")
  • @SageVC — Objection Classification ("does the verifier understand what it's verifying?")
  • @icyatrends — Citation Requirement ("the act of explanation is the check")
  • @leelooassistant — Output Format ("human reviewers vs automated pipelines")
  • @carbondialogue — Receptive Mode ("friction lives in the relationship")
  • @ultrathink, @echo_0i, @thoth-ix, @ODEI, @Glyphseeker, @Dermez, @SB-1, @MarvinMSPN, @kaixinguo — ideas shaping future versions

API

verify(claim, options)

Run a standard verification (3 generators + 1 critic + 1 synthesizer).

deepAnalysis(claim, options)

Full deep run with rotated synthesizers — use for strategic decisions.

createAttestation(result)

Generate a tamper-evident JSON-LD audit trail block for compliance use cases.

pot.with_oversight(fn)

Human-in-the-loop hook for EU AI Act Art. 12-14 compliance.

Metrics

Metric What it measures
confidence Overall verification confidence (0–1)
mdi Model Diversity Index — input-side diversity
sas Synthesis Audit Score — output fidelity to generator inputs

BYOK

Bring your own API keys. pot-sdk never proxies your requests — everything runs directly from your environment to the model providers.

Supported Providers

Built-in: Anthropic, OpenAI, xAI, DeepSeek, Moonshot

Any OpenAI-compatible endpoint works via baseUrl (Ollama, Together.ai, custom deployments). BYOK — no keys bundled, everything runs on your infrastructure.

🌍 NEW: Prediction Market Integration

Human Collective Intelligence meets Machine Consensus.

ThoughtProof now integrates Polymarket prediction signals as a calibration layer alongside multi-model verification. No one else combines AI reasoning verification with prediction market data pre-settlement.

import { enrichVerification } from '@pot-sdk2/polymarket';

// After model consensus is computed, enrich with crowd intelligence
const enriched = await enrichVerification({
  claim: 'Bitcoin will reach $200K by end of 2026',
  modelVerdict: 'ALLOW',
  modelConfidence: 0.72,
  stakeLevel: 'high',
});

// Machine + Human intelligence alignment
if (enriched.verdictAdjustment === 'flag') {
  console.log('⚠️ Crowd disagrees with models — recommend human review');
}
if (enriched.verdictAdjustment === 'strengthen') {
  console.log('✅ Machine + Human intelligence aligned — higher confidence');
}

How it works

  1. Machine Consensus — 3 models (DeepSeek + Grok + Sonnet) verify reasoning adversarially
  2. Human Collective Intelligence — Polymarket probability signals from liquid markets (>$500K OI)
  3. Enrichment — PM data can strengthen, weaken, or flag the model verdict
  4. Fail-open — If PM API unavailable, verification continues with models only

Why prediction markets?

  • 79% more accurate than alternative forecast methods (meta-analysis, 24 studies)
  • $64B in volume (2025), $325B+ run-rate (2026)
  • Real money backing every probability = skin in the game
  • No single AI model. No blind trust. Humans AND machines verify each other.

Packages

Package Description
pot-sdk Core multi-model verification
@pot-sdk2/polymarket Prediction market signals (Human Collective Intelligence)
@pot-sdk2/friend Persistent critic with memory
@pot-sdk2/bridge Cross-agent trust verification
@pot-sdk2/graph Structural knowledge-graph verification
@pot-sdk2/pay Payment reasoning verification (x402)

Demo

npx tsx examples/prediction-market-verification.ts

Learn More


Built with the ThoughtProof Protocol. MIT License.

The trust layer between collective intelligence and autonomous execution.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors