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 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.
The Problem With Current AI Workflows
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:
- No population structure. Real outcomes are driven by who talks to whom. A single context window cannot represent a hub-and-spoke network where 5% of nodes generate 60% of the reach.
- No state across time. Chain-of-thought is not memory. An agent that "changes its mind" in paragraph 4 has no persistent belief it can defend, contradict, or revert to in round 9.
- No disagreement to aggregate. One sample = one narrative. You cannot compute a distribution over futures from a single greedy decode, and temperature-jittering the same prompt is not an ensemble — it's the same prior with noise.
Swarm simulation attacks all three by making the population the unit of computation.
How the Architecture Actually Works
┌──────────────┐ ┌────────────────┐ ┌──────────────────┐ │ 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 Component notes that matter in practice:
- Persona factory is where quality is won or lost. Personas derived from the ingested corpus (real stakeholder roles, real stated positions) behave very differently from "imagine 1000 random users." Diversity of priors, not of names.
- Memory is two-tier. A rolling scratchpad for the current round plus vector recall for older events. Without decay, every agent anchors on round 1 and the swarm freezes; with aggressive decay, you get incoherent flip-flopping. Treat decay rate as a first-class hyperparameter.
- The scheduler is your cost lever. Full N×R synchronous updates are wasteful. Degree-weighted activation (hubs every round, peripheral nodes every k-th round) preserves cascade dynamics at a fraction of the tokens.
- Aggregation, not narration. The useful output is a stance distribution over rounds plus detected cascade thresholds — not a paragraph. If your report step is a single "summarize this" call, you have thrown away the simulation.
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.
Quick Start (Copy-Paste Setup)
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 # .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 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 python main.py --config config/smoke.yaml --seed data/event_seed.md Then add the numeric backbone:
pip install chronos-forecasting torch 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 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.
Real-World Use Cases & Honest Trade-Offs
Wins
- Policy / pricing pre-mortems. Seed with real stakeholder statements, run 20 rounds, and read which objection cascades. You get the argument you'll face, in its native vocabulary, before launch.
- Narrative stress-testing for comms. Inject a rumor at a single low-degree node and watch whether the graph amplifies it. Cheap red-teaming of your own messaging.
- Scenario sets for quantitative models. Use the swarm to generate plausible regime shifts, then score each with Chronos quantiles. Qualitative breadth, quantitative discipline.
Limitations
- LLM agents are not calibrated agents. Shared pretraining priors cause opinion collapse — the swarm can converge to a consensus that reflects the base model, not the world. Always run a shuffled-persona control and multiple seeds; report the spread, never a point estimate.
- No ground truth for novel events. You can backtest Chronos with rolling-origin evaluation and get honest MASE/quantile loss. You cannot backtest "will this scandal blow up" without leakage — the model has read the news. Treat swarm output as structured hypothesis, and log Brier scores only on genuinely forward-dated questions.
🧠 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
#Drop07in the channel for the swarm-simulation + Chronos pairing assets.
Direct Links & Daily Open-Source Drops
- MiroFish — universal swarm-intelligence prediction engine: https://github.com/666ghj/MiroFish
- Chronos — pretrained probabilistic time-series foundation models: https://github.com/amazon-science/chronos-forecasting
- VibeNode AI (daily open-source AI drops): https://t.me/vibenode_ai
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.