OPEN SOURCE · MIT LICENSED

Multi-Agent AI
Forecasting Engine

Predict markets. Simulate crowds. Find your edge.

12 AI agents with distinct personas debate in real-time — powered by 26 mathematical methods
including Dempster-Shafer evidence theory, MCMC sampling, Shapley attribution, copula modeling — informed by 23 live data feeds.

Star on GitHub Get Started Documentation
12AI Agents
23Data Feeds
26Mathematical Methods
LLM Providers
Claude·GPT-4o·Llama·Mistral·Ollama·Any LLM
FORECAST

Binary Probability

Ask any yes/no question. Get a calibrated probability with confidence intervals, Bayesian posterior, extremized estimate, and edge vs market odds.

$ python main.py forecast "Will BTC hit $100k?" --odds 0.42

Weighted:  48.7% | Bayesian: 46.2%
Extremized: 51.3% | LogOP: 47.8%
95% CI: [38.1%, 57.3%]
MC median: 47.5% | Entropy: 0.998 bits
Market: 42% → Edge: +6.7%
SCENARIO

Crowd Simulation

Feed any event. Watch 12 personas react in real-time — sentiment shifts, price impact, crowd narrative, second-order effects.

$ python main.py scenario "Fed cuts rates 50bps"

BULLISH | Sentiment: +0.52 | Impact: +8.3%
"Risk assets rally as liquidity expectations
 shift. BTC leads, alts follow with lag."
→ Funding rates spike within 30 min
→ Shorts liquidated across major pairs

Beyond Simple Averages

Seven aggregation methods. Game theory. Information theory. Peer-reviewed science.

Bayesian Updating

Each agent's estimate is treated as evidence. Beliefs update via Bayes' theorem with KL-divergence weighting. More surprising estimates carry more information.

P(H|E) = P(E|H)·P(H) / P(E)

Monte Carlo Simulation

5,000 simulations treating each agent as a beta distribution parameterized by probability and confidence. Produces percentiles, skew, and threshold probabilities.

P(>50%) = 0.63 | Skew: -0.12

Extremized Aggregation

Based on Satopää/Tetlock IARPA research. Transforms to log-odds space and applies extremizing factor d to correct systematic under-confidence in crowd averages.

logit(p_ext) = d · mean(logit(p_i))

Surprisingly Popular

Prelec (2017, Nature). The correct answer is often more popular than people predict. Exploits private information agents leak through meta-predictions.

SP = actual_mean - predicted_mean

Log Opinion Pool

Multiplicative combination in log space. Satisfies external Bayesianity — if agents are independent Bayesians with shared likelihood, recovers the correct posterior.

p_log = Π(p_i^w_i) / Z

Cooke's Classical Model

Performance-based weighting from expert elicitation theory. Weights by calibration AND informativeness. Unqualified agents are pruned from the pool.

w_i = calibration_i × info_i

Bootstrap Confidence Intervals

Resample agent estimates 1,000 times to produce 95% confidence intervals. Quantifies uncertainty in the swarm's consensus.

95% CI: [38.1%, 57.3%]

Herding Detection

HHI-based clustering analysis detects when agents converge suspiciously. Flags contrarian signals when the herd is wrong.

Herding: 0.72 → contrarian signal

Information Cascades

Tracks how beliefs shift between debate rounds. Detects when agents flip sides, who moved most, and whether convergence was genuine.

Convergence: 78% | 2 agents flipped

Nash Equilibrium

Checks if the consensus is stable — would any agent benefit from deviating? Unstable equilibria signal low-confidence forecasts.

Stability: 0.92 → consensus holds

Jensen-Shannon Divergence

Pairwise agreement matrix between all agents. Identifies most aligned and most divergent pairs to surface hidden consensus patterns.

Most divergent: Skeptic | Native

Brier Score Calibration

Every forecast is tracked. When markets resolve, per-agent Brier scores update. Better-calibrated agents automatically gain more weight over time.

Brier: 0.12 → weight: 1.38x

Built Different

12 Distinct Agents

Macro analyst, quant trader, crypto native, skeptic, options trader — each with documented biases that create genuine disagreement.

Multi-Round Debate

Agents see each other's reasoning and update beliefs. Weak arguments collapse. Strong ones survive. Information cascades are tracked.

23 Live Data Feeds

Funding rates, options flow, DeFi TVL, on-chain metrics, social sentiment, prediction market odds — fetched in parallel.

Self-Calibrating

Brier scores per agent, updated on resolution. Better agents gain weight over time. The swarm improves automatically.

Any LLM

Claude, GPT-4o, Llama, Mistral, Ollama — swap with one env var. Run fully local and private.

REST API + CLI

FastAPI server with interactive docs. Typer CLI for terminal. Docker for deployment. Integrate into any pipeline.

The 12 Agents

Every agent brings a different lens. That's the point.

Macro AnalystFed, rates, DXY, liquidity
Crypto NativeOn-chain, funding, narrative
Quant TraderBase rates, vol surface
RetailPrice action, Reddit, FOMO
SkepticTail risks, crowded trades
On-ChainWhale flows, reserves
InstitutionalETF flows, regulatory
EventsFOMC, halvings, catalysts
DeFiTVL, yields, governance
OptionsIV, skew, gamma
GeopoliticalRegulation, sanctions
SocialReddit, Twitter, Trends

Real Data. Not Vibes.

23 free APIs, fetched in parallel, no API keys required.

Market & Derivatives

  • Binance spot (BTC, ETH, SOL)
  • Funding rates (6 assets)
  • Open interest
  • Long/short ratios
  • Top trader positions
  • Liquidation data

On-Chain & DeFi

  • Deribit options + put/call
  • DeFi Llama TVL + protocols
  • Stablecoin supply
  • BTC mempool + fees
  • BTC hashrate
  • ETH gas prices

Sentiment & Markets

  • Fear & Greed (7-day)
  • Reddit r/cryptocurrency
  • CoinGecko trending
  • CryptoPanic headlines
  • Polymarket odds
  • Manifold Markets

60 Seconds to First Forecast

terminal
# Install
$ git clone https://github.com/defidaddydavid/polyswarm.git
$ cd polyswarm && pip install -r requirements.txt
$ cp .env.example .env  # add your API key

# Forecast
$ python main.py forecast "Will BTC hit $100k?" --odds 0.45

# Simulate
$ python main.py scenario "SEC bans crypto staking"

# API server
$ python main.py serve  # → localhost:8000/docs

Standing on Giants

Built on peer-reviewed forecasting science.

IARPA ACE

Satopää et al. (2014) — Extremized aggregation corrects the systematic under-confidence found in averaged probability forecasts.

Nature 2017

Prelec et al. — The "Surprisingly Popular" algorithm exploits meta-cognitive information to find truth even when majorities are wrong.

Cooke 1991

Classical Model for expert elicitation — weight forecasters by empirical calibration and informativeness, not just confidence.

Genest & Zidek

Logarithmic opinion pools satisfy external Bayesianity — theoretically optimal when agents share likelihoods.

Ready to find your edge?

MIT Licensed. Open source. Run locally or in the cloud.

View on GitHub Read the Docs