Inside MiroFish (87k★): How an Open-Source Swarm of AI Agents Simulates Future Events
Two sentences in, most "AI prediction" demos are just one LLM wearing a trench coat: a single prompt asked to imagine the future, with no population, no dissent, and no memory of what it said last round. MiroFish takes the opposite bet — spawn thousands of cheap, opinionated agents, wire them into
Two sentences in, most "AI prediction" demos are just one LLM wearing a trench coat: a single prompt asked to imagine the future, with no population, no dissent, and no memory of what it said last round. MiroFish takes the opposite bet — spawn thousands of cheap, opinionated agents, wire them into a social graph, and let the disagreement produce the forecast.
TL;DR: MiroFish ( 666ghj/MiroFish ) is a swarm-intelligence prediction engine: seeded personas + persistent memory + graph-mediated interaction, rolled forward over discrete rounds, then aggregated into a scenario report. It is a hypothesis generator, not a calibrated probability oracle. Pair it with amazon-science/chronos-forecasting when the question has a numeric time series attached — Chronos gives you quantiles you can actually score.
Ask a frontier model "will this policy trigger backlash in week 3?" and you get a fluent essay conditioned on one implicit persona: the median internet commenter as imagined by an RLHF process. Three concrete failure modes I keep hitting:
Swarm simulation attacks all three by making the population the unit of computation.
┌──────────────┐ ┌────────────────┐ ┌──────────────────┐ │ Event seed │──▶│ Ingest + parse │──▶│ Entity/event │ │ news, docs, │ │ chunk, dedupe │ │ graph (nodes/ │ │ CSV series │ │ embed │ │ edges, stances) │ └──────────────┘ └────────────────┘ └────────┬─────────┘ │ ┌─────────────────────────▼──────────┐ │ Persona factory │ │ role, bias, risk tolerance, memory │ │ budget, network degree │ └─────────────────────────┬──────────┘ │ ┌──────────────────────────────────────────────▼───────────────────┐ │ ROUND LOOP t = 1..R │ │ scheduler (degree-weighted, batched) │ │ ├─ retrieve: short-term scratchpad + vector recall │ │ ├─ observe: neighbor messages from t-1 (graph edges) │ │ ├─ act: post / reply / stay silent / shift stance │ │ └─ write: append memory, update belief vector, decay │ └──────────────────────────────────────────────┬───────────────────┘ │ ┌─────────────────────┐ ┌──────────▼──────────┐ │ Chronos (numeric │───────▶│ Aggregator │ │ prior + quantiles) │ │ stance clustering, │ └─────────────────────┘ │ cascade detection │ └──────────┬──────────┘ ▼ scenario report + traces Enter fullscreen mode Exit fullscreen mode Component notes that matter in practice:
Cost math, so nobody is surprised: 1,000 agents × 12 rounds × ~1.5k tokens ≈ 18M tokens per run. Route hubs to a strong model and the periphery to a small one and you can cut that by 5–10× with modest fidelity loss.
git clone https://github.com/666ghj/MiroFish.git cd MiroFish python -m venv.venv && source.venv/bin/activate pip install -r requirements.txt # or: uv sync cp.env.example.env # check the repo README for exact var names Enter fullscreen mode Exit fullscreen mode #.env — OpenAI-compatible endpoint works with most local gateways LLM_API_KEY=sk-... LLM_BASE_URL=https://api.openai.com/v1 LLM_MODEL=gpt-4o-mini EMBEDDING_MODEL=text-embedding-3-small Enter fullscreen mode Exit fullscreen mode Start small. A 60-agent, 6-round smoke test costs cents and surfaces config bugs fast:
# config/smoke.yaml simulation: agents: 60 rounds: 6 activation: degree_weighted peripheral_stride: 3 memory: scratchpad_turns: 4 recall_top_k: 5 decay: 0.85 output: traces: true # keep per-agent logs; you will need them Enter fullscreen mode Exit fullscreen mode python main.py --config config/smoke.yaml --seed data/event_seed.md Enter fullscreen mode Exit fullscreen mode Then add the numeric backbone:
pip install chronos-forecasting torch Enter fullscreen mode Exit fullscreen mode import torch, pandas as pd from chronos import BaseChronosPipeline pipe = BaseChronosPipeline. from_pretrained ( "amazon/chronos-bolt-base", device_map = "cpu", torch_dtype = torch. float32 ) ctx = torch. tensor ( pd. read_csv ( "series.csv" ) [ "value" ]. values, dtype = torch. float32 ) q, mean = pipe. predict_quantiles ( context = ctx, prediction_length = 14, quantile_levels = [ 0.1, 0.5, 0.9 ] ) print ( q [ 0,:, 0 ]. tolist ( ), q [ 0,:, - 1 ]. tolist ( ) ) # p10 / p90 band Enter fullscreen mode Exit fullscreen mode Chronos tokenizes scaled values into a fixed vocabulary and forecasts autoregressively, so sampling gives you a real predictive distribution. Use its p10–p90 band as a sanity envelope: if your swarm's narrative implies a trajectory outside it, that's a signal to inspect, not to publish.
🧠 Daily drops, not hype. I post breakdowns like this in VibeNode AI on Telegram → t.me/vibenode_ai. Alongside the repo notes: Claude Code hooks and ready-to-import n8n JSON workflows. Search #Drop07 in the channel for the swarm-simulation + Chronos pairing assets.
One question I genuinely don't have a clean answer to: when you run a multi-agent simulation twice with the same seed corpus but different persona shuffles, how much stance-distribution drift do you accept before calling the result noise? If you've built a stability metric you trust, I'd like to steal it.