Test your campaign on 10,000 AI agents before you spend a dollar on the launch.
๐ Quick Start ยท โจ Features ยท ๐ฏ Use Cases ยท ๐ Comparison ยท ๐ Docs ยท ๐ค Contributing
git clone https://github.com/showjihyun/prophet.git
cd prophet && docker compose up -d
open http://localhost:5173That's it. 5 minutes from clone to your first simulation. No API keys required to start โ Prophet runs fully locally on a laptop.
Focus groups lie โ 10 humans in a room cannot tell you how a message spreads through a community. A/B tests are too late โ by the time you have data, you're already paying for the launch. Brand-lift studies take 6 weeks, cost $50K, and tell you nothing about why a message failed.
Every discipline that ships things at scale โ aerospace, civil engineering, software โ gets to simulate before it builds. Marketing doesn't. Until now.
You take your campaign. You drop it into a virtual society of 10,000 AI agents organized into the communities you actually care about. You watch what happens.
|
Each agent perceives, remembers, feels, cognizes, decides, and influences โ powered by LLM cognition with persistent per-agent memory. |
3-tier inference (80% local SLM + 10% heuristic + 10% elite LLM) keeps 10K-agent simulations radically cheap. A naive GPT-4 run costs ~$15K. |
Hybrid Watts-Strogatz + Barabรกsi-Albert generator produces realistic clustering, power-law influencers, and cross-community bridges. |
|
Real-time 3D WebGL graph (three.js) with orbit / zoom / pan controls, community-colored nodes, and cascade highlighting. |
Viral cascades, polarization, echo chambers, collapse, slow adoption โ detected and timeline-marked as the simulation runs. |
Ollama, Claude, OpenAI, Gemini, + 2026 Chinese flagships (DeepSeek, Qwen, Moonshot Kimi, Zhipu GLM) out of the box. |
|
Pause any time, Inject Event (controversy / endorsement / regulation), or Replay from step N to branch the timeline and try a different shock. |
Dial the SLM / LLM ratio while the simulation is paused. Trade cost for reasoning depth without restarting from step 0. |
Run the same campaign with one variable changed. Compare view puts adoption / sentiment / cascades side by side. Clone any run in one click. |
docker compose -f docker-compose.yml -f docker-compose.gpu.yml up -d
docker compose exec ollama ollama pull llama3.1:8bOn an RTX 4070-class GPU, llama3.1:8b runs at ~75 tok/s โ sub-second per agent tick.
docker compose up -d
export OLLAMA_DEFAULT_MODEL=llama3.2:1b SLM_MODEL=llama3.2:1b
docker compose up -d --force-recreate backend
docker compose exec ollama ollama pull llama3.2:1b| Service | URL |
|---|---|
| ๐ฅ๏ธ Frontend | http://localhost:5173 |
| โ๏ธ Backend API | http://localhost:8000 |
| ๐ API Docs (Swagger) | http://localhost:8000/docs |
Open localhost:5173 โ Projects โ create a scenario with a campaign message โ click Run All. Watch the 3D graph spread in real time.
# Backend
cd backend && uv sync && uv run uvicorn app.main:app --reload
# Frontend
cd frontend && npm install && npm run devProphet is not just an engine โ it's a workspace. Here's the loop you actually click through:
- Set up. Projects โ New Scenario โ Campaign Setup. You name the campaign, write the message, dial in novelty / controversy / utility, set the budget, pick which communities it lands on, and choose how many steps to run (default 50).
- Run. Run All for the whole sweep, or Step to advance one tick at a time and watch the 3D graph spread. Pause any time.
- Intervene mid-run. While paused you can:
- Inject Event โ drop a sudden shock (Controversy / Celebrity Endorsement / Regulatory Change / etc.) targeting all or specific communities. Takes effect on the next step.
- Engine Control โ change the SLM / LLM ratio live. Trade cost for reasoning depth without restarting.
- Replay from step N โ branch the simulation at any past step and try a different intervention from there.
- Read the result. When it completes you get a Summary Report (adoption curve, sentiment, top community, scrollable Key Events timeline) and the dedicated Analytics page with deep deltas, cascade timeline, and shareable deep links.
- Drill into why. Opinions lets you go scenario โ community โ individual conversation thread. Top Influencers ranks who actually moved the needle. Agent Interview asks any single agent why it decided what it did.
- Compare. Run the same campaign with one variable changed (different message, different intervention, different population) and the Compare view shows them side by side. Clone any scenario in one click to start the next variant.
This is the loop. Most decisions get made between steps 3 and 6 โ set it up once, run it many ways.
๐ง Pre-test a product launch
A beverage brand was about to spend $1.2M launching a sustainability product. Ran the message against 5,000 agents (15% skeptics, 60% mainstream, 20% early adopters, 5% influencers). Prophet showed the message polarized skeptics and adoption stalled at 13%. They reframed and hit 78% by the same step in the second simulation.
๐ Pre-screen public health messages
A health agency tested 3 vaccine messages against a 5K-agent virtual population. Strategy B caused near-zero adoption in skeptical communities (no viral cascade events in the first 4 steps). Strategy C triggered three positive cascades through influencer nodes by step 4. They picked C โ adoption lift was 312ร at the early-step horizon.
๐ข Stress-test internal communications
A Fortune 500 ran their RTO mandate through a synthetic employee population (4,500 engineering-heavy agents). Prophet predicted complete stall + slide into negative sentiment (mean_belief = -0.23, zero cascades). Restructured with carve-outs: same population hit 94% adoption with +0.68 sentiment โ a +91-point swing from restructuring alone.
๐จ Stress-test crisis response (mid-run shock injection)
A consumer brand wanted to know how a sudden negative PR event would derail an ongoing campaign. Ran the campaign normally for 20 steps (adoption climbing toward 64%), then mid-run injected Controversy + "battery explosion in 47 units" + 0.9 via the Inject Event modal targeting only the skeptic community. The next 8 steps showed adoption stall at 41% and sentiment crash from +0.42 to -0.31, with two negative cascade events on the timeline. They tested two response messages on top: "transparent recall + free replacement" recovered to 58% by step 30; "deny and deflect" drove a third cascade and stalled at 19%. Crisis playbook went from gut-feel to rehearsed.
๐ฌ Computational social science research
Open-source. Reproducible. Runs on a laptop. Built-in cascade detection. If you've been wanting to do agent-based diffusion research without renting a GPU cluster, Prophet is for you.
Reproducible. Every claim above is verified end-to-end against the current engine in
docs/USE_CASE_PILOTS.md, with raw per-step JSON indocs/pilot_results/. Re-run any pilot withuv run python backend/scripts/run_use_case_pilot.py --case <name>.
| Prophet | OASIS (academic) | AnyLogic | Focus groups | |
|---|---|---|---|---|
| ๐ต 10K-agent simulation cost | under $5 | free | $15K+ license | $30K+ |
| โฑ๏ธ Time to first result | 5 minutes | hours | days | 6 weeks |
| ๐ง LLM-driven agent cognition | โ | โ | โ | n/a |
| ๐จ Real-time 3D visualization | โ | โ | โ | โ |
| ๐ Cascade / echo chamber detect | โ | โ | โ | โ |
| ๐ Marketing-specific metrics | โ | โ | partial | โ |
| ๐ Open source | MIT | MIT | โ | n/a |
| ๐ป Runs on a laptop | โ | โ | โ | n/a |
Numbers are rough order-of-magnitude based on public pricing and running comparable workloads. Your mileage will vary.
Screenshots not rendering? They live in
docs/assets/screenshots/โ a fresh clone may be missing them while we record the next batch.
Prophet isn't a "vibes" simulator. Every layer is a published, peer-reviewed model โ wired together so you can change one knob and see the rest react. This section names the techniques and the academic lineage so reviewers, grad students, and skeptical CMOs can audit it.
Every claim below cites the source file. Search the repo for
SPEC:docstrings to trace each technique back to its formal contract.
| Technique | What it does in Prophet | Source |
|---|---|---|
| Watts-Strogatz small-world | Per-community local clustering with rewiring p โ captures the "friend of a friend" structure of real social ties |
network/community_graph.py |
| Barabรกsi-Albert preferential attachment | Generates the influencer/hub layer with a power-law degree distribution โ a few accounts hold most of the reach | network/influencer_layer.py |
| Hybrid hub-merging + bridge edges | BA hubs are spliced into WS communities; cross-community bridges are degree-weighted (preferential) so brokers form realistically | network/generator.py |
| Personality homophily | Edge weights boosted by Manhattan-distance similarity across 5 traits โ likes attract, but not exclusively | network/generator.py:390 |
| Validation: clustering coefficient ยท modularity ยท degree assortativity | Generated networks are rejected unless 0.2 โค CC โค 0.6 and modularity is non-trivial โ guarantees real-network character |
network/generator.py:486 |
Why this matters: random graphs (Erdลs-Rรฉnyi) systematically underestimate cascade behavior because they have no clustering and no hubs. Prophet's hybrid generator is calibrated to reproduce the structural signatures of empirical online communities (Watts 1998; Barabรกsi-Albert 1999; Newman 2003).
Deffuant bounded-confidence model โ agents only listen to neighbors whose belief is within an "open mind" radius
belief_i(t+1) = belief_i(t) + ฮผ ยท (belief_j(t) โ belief_i(t)) only if |belief_i โ belief_j| < ฮต (default ฮต = 0.3, ฮผ = 0.5).
This is the canonical mechanism that allows polarization to emerge endogenously โ without it, every model collapses to consensus. (Deffuant, Neau, Amblard, Weisbuch 2000.) โ opinion_dynamics.py
Friedkin-style stubbornness โ convergence rate is dampened by an agent's stubbornness trait
ฮผ' = ฮผ ยท (1 โ stubbornness) so loyal-to-prior agents barely move even when exposed to contrary views. Generalizes Friedkin-Johnsen by tying anchor weight to a trait. โ opinion_dynamics.py:36
Expert influence (sentiment shift) โ credentialed agents nudge community sentiment with a configurable ฮฑ
E_community(t+1) = clamp(E_community(t) + ฮฑ ยท O_expert) with ฮฑ = 0.3. Lets you study the asymmetry between official sources and grassroots voices. โ sentiment_model.py:64
| Technique | Implementation |
|---|---|
| SIR-inspired state machine | Agents transition SUSCEPTIBLE โ EXPOSED โ ADOPTED/REJECTED โ the canonical epidemic model adapted for information goods |
| Calibrated propagation probability | P = max(0.1, I)ยทTยทฯ(โ4ยทE)ยทMS where I=influence, T=trust, E=emotion, MS=message strength โ a logistic-modulated multiplicative form |
| RecSys-inspired exposure | Two-phase candidate-gen + ranking: score = wโยทrecency + wโยทsocial_affinity + wโยทinterest_match + wโยทengagement + wโ
ยทad_boost โ diversity_penalty (top-K feed). Mirrors industry recommender-system practice |
| Negative-cascade amplification | Negative events trigger asymmetric (โค 0) sentiment deltas โ operationalizes the "bad-news-travels-faster" finding (Vosoughi, Roy, Aral 2018) |
| Reddit-style hot score (optional) | `h = sign(net) ยท logโโ(max( |
Five auto-detectors fire as the simulation runs and surface on the timeline:
| Event | Trigger formula | File |
|---|---|---|
| Viral cascade | adoption_rate โฅ 0.15 in one step OR step-delta โฅ 0.15 |
cascade_detector.py:109 |
| Slow adoption | adoption_rate < 0.02 for โฅ 5 consecutive steps (fires once, resets on recovery) |
cascade_detector.py:155 |
| Polarization | community sentiment_variance > 0.05 (sample variance, nโ1 Bessel correction) |
cascade_detector.py:210 |
| Collapse | adoption drops โฅ 20% over 3 steps | cascade_detector.py:235 |
| Echo chamber | internal_links / external_links > 10 (returns max ratio across communities) |
cascade_detector.py:275 |
| Aggregate | Formula | File |
|---|---|---|
| Viral probability | fraction of N runs that fire โฅ 1 viral cascade | simulation/monte_carlo.py:149 |
| Expected reach | mean final adoption across runs | line 152 |
| P5 / P50 / P95 reach | sorted-index percentile lookup (no interpolation โ stable for small N) | line 154 |
Each MC run replays the same SimulationConfig with seed = base_seed + run_id ร 1000 for full reproducibility.
Phase 1: experts โช {agents with influence > 0.7} โช critical-decision agents โ Tier 3 (Elite LLM)
Phase 2: {influence > 0.5} โช {skeptic_skepticism > 0.7} โ Tier 2 (heuristic + LLM blend)
Otherwise โ Tier 1 (local SLM)
Caps: max_tier3_ratio โค 10%, max_tier2_ratio โค 10%
This is what keeps a 10K-agent run under $5 while keeping the high-leverage decisions on a frontier model. โ agent/tier_selector.py
Prophet is, in academic terms, an agent-based model (ABM) of opinion dynamics on a generative social network with calibrated viral-diffusion mechanics. Three traditions converge:
- Bounded-confidence opinion dynamics (Deffuant 2000, Hegselmann-Krause 2002) โ the "open-minded radius" mechanism that produces clustering rather than consensus.
- Generative network models (Watts-Strogatz 1998, Barabรกsi-Albert 1999) โ the structural backbone that lets micro-rules produce macro-patterns matching real platforms.
- Computational diffusion (Kempe-Kleinberg-Tardos 2003 cascade models, plus modern RecSys-augmented exposure) โ the pipeline a message follows from impression to adoption.
|
๐ For researchers
|
๐ฃ For practitioners
|
|
๐๏ธ For policy & public health
|
๐งช For social-science pedagogy
|
Prophet is a model โ and all models are wrong, some are useful. Things to be honest about:
- Calibration is structural, not empirical. Network statistics (clustering, modularity) are validated against ranges from the literature โ not against your specific platform's logs.
- LLM agents inherit LLM biases. Tier 3 cognition uses general-purpose LLMs; their persona play is consistent but is not a substitute for actual human focus-group data.
- Bounded-confidence dynamics are a theory, not a measurement. Different opinion-dynamics models (DeGroot, voter, Hegselmann-Krause) produce different predictions; we picked Deffuant for its empirical track record on polarization, but reasonable researchers disagree.
- Five emergent-behavior detectors do not exhaust the space. We picked the five most common in the diffusion literature; novel patterns will need custom detectors (PRs welcome).
In other words: use Prophet to generate hypotheses, narrow your search space, and rule out obvious failure modes โ not to replace empirical validation on real audiences.
1. Generate โ 10K agents in 5 communities (early adopters, mainstream,
skeptics, experts, influencers) with realistic clustering,
scale-free degree, and bridge nodes
2. Inject โ Your campaign / message / policy
3. Simulate โ Each agent runs the 6-layer loop
(perception โ memory โ emotion โ cognition โ decision โ influence)
4. Detect โ Viral cascades, polarization, echo chambers, collapse,
slow adoption โ auto-marked on the timeline
5. Visualize โ 3D WebGL graph with orbit / zoom / pan,
community-colored nodes and edges, WebSocket live updates
6. Decide โ Compare scenarios, export JSON / CSV, share links
| Layer | Stack |
|---|---|
| ๐ผ๏ธ Frontend | React 18 ยท TypeScript ยท Vite ยท Tailwind ยท react-force-graph-3d (three.js) ยท Cytoscape.js |
| ๐งต State | Zustand ยท TanStack Query ยท native WebSocket |
| โ๏ธ Backend | Python 3.12 ยท FastAPI (async) ยท SQLAlchemy 2.0 ยท Pydantic v2 |
| ๐ค LLM | Ollama (local SLM) ยท Claude ยท OpenAI ยท Gemini ยท DeepSeek ยท Qwen ยท Moonshot Kimi ยท Zhipu GLM |
| ๐๏ธ Database | PostgreSQL 16 + pgvector |
| โก Cache | Valkey |
| ๐งช Testing | pytest (1,031) ยท Vitest (736) ยท Playwright (E2E) |
| ๐ฆ Package | uv (Python) ยท npm (Node) |
- โ 6-layer agent engine with LLM-driven cognition
- โ 3-tier inference keeping 10K-agent simulations under $5
- โ Real-time 3D WebGL graph that scales to 5K+ nodes
- โ Cascade, echo chamber, polarization auto-detection from real network topology
- โ WebSocket live streaming with pause / resume / step / run-all
- โ 8 LLM providers first-class โ Ollama, Claude, OpenAI, Gemini + 4 Chinese flagships (2026)
- โ 1,767+ automated tests with Playwright E2E coverage
๐ก In progress: hosted Cloud Starter tier, scenario template library, validation studies ๐ฎ Planned: plugin SDK, Segment / mParticle / HubSpot integrations, multi-language agents
Full history โ CHANGELOG.md ยท Roadmap discussion โ ROADMAP.md
- ๐ API Docs โ http://localhost:8000/docs (Swagger UI when running)
- ๐ ๏ธ Contributing Guide โ setup under 10 minutes
- ๐ค Code of Conduct
- ๐ Security Policy
- ๐ Changelog
- ๐บ๏ธ Roadmap
- ๐ฟ Git Branch Strategy
If Prophet is useful to you, a star is the fastest way to help others find it.
We need help. Specifically:
- ๐ Bug reports with reproduction steps
- ๐ Documentation improvements (typos, clarity, examples)
- ๐งช Test cases for edge cases you find
- ๐ฑ
good first issuepicks โ small, clearly-scoped tasks for newcomers - ๐ก Use cases โ tell us what you're trying to simulate; we may already support it
Start here:
- Read
CONTRIBUTING.md - Browse
good first issue - Open a Discussion before any large change
- Open a PR โ we aim to respond within 48 hours
Maintainers are active. First-time contributors get a thank-you and a fast review. We label every issue, keep the roadmap public, and publish what we ship.
- ๐ฌ GitHub Discussions โ questions, ideas, show-and-tell
- ๐ GitHub Issues โ bugs and feature requests
If you build something cool with Prophet, we want to see it. Open a Discussion and post a screenshot.
Prophet stands on the shoulders of many other projects.
MiroFish โ biggest architectural influence
MiroFish combined OASIS (academic agent simulator) with GraphRAG and Zep Cloud for long-term memory. It proved LLM-driven agents with persistent memory could be assembled into a coherent pipeline. Prophet takes that idea, opens it up, makes it cheaper through tiered inference, and adds the marketing-specific layer (cascade detection, viral metrics, real-time viz) that MiroFish doesn't focus on.
Other prior art we learned from
- OASIS โ academic foundation for large-scale agent-based social simulation
- GraphRAG (Microsoft Research) โ hybrid vector + graph retrieval pattern
- NetworkX โ hybrid WS+BA generator would have taken months instead of days without it
- three.js / react-force-graph-3d โ 3D rendering; instanced sphere rendering scales to thousands of nodes
- Cytoscape.js โ EgoGraph 2D force-directed layout
- Ollama โ local SLM inference makes the 3-tier cost model possible
- Hugging Face / open-weight LLM community โ proved small models are good enough for agent reasoning
- NetLogo and MASON โ showed decades ago that simulating a society is a tractable engineering problem
If you contributed to any of these and feel we should credit you more specifically, open a PR โ we'll fix it.
MIT โ see LICENSE.
Use it commercially. Fork it. Modify it. Embed it. We just ask you to keep the license file and not pretend you wrote it from scratch.
If Prophet helps your research, please cite:
@software{prophet_2026,
title = {Prophet: A simulation engine for marketing campaign diffusion},
author = {Prophet Contributors},
year = {2026},
url = {https://github.com/showjihyun/prophet}
}Built because marketing deserves a wind tunnel. Open-sourced because everyone deserves one.
Made with โก and way too much coffee ยท โฌ back to top



