Skip to content

Add misinformation spread model: LLM-powered agents vs rule-based com…#420

Open
Harsh-617 wants to merge 2 commits intomesa:mainfrom
Harsh-617:add-misinformation-spread-example
Open

Add misinformation spread model: LLM-powered agents vs rule-based com…#420
Harsh-617 wants to merge 2 commits intomesa:mainfrom
Harsh-617:add-misinformation-spread-example

Conversation

@Harsh-617
Copy link

Adds a new example model demonstrating mesa-llm features through a misinformation spread simulation.

What this model does

12 agents with unique personas (teacher, doctor, journalist, shopkeeper, etc.) are placed on a grid and react to a rumor about water contamination. LLM-powered agents use ReAct reasoning to decide whether to spread or challenge the rumor based on their personality and conversations with neighbors.

A rule-based comparison model with the same agents and setup uses simple mathematical rules instead of LLMs, allowing direct comparison of the two approaches.

Features demonstrated

  • mesa-llm LLMAgent with ReAct reasoning
  • Custom tools (@tool decorator): check_neighbors, spread_rumor, challenge_rumor, update_belief
  • Inter-agent communication via send_message
  • Memory system for tracking conversations
  • DataCollector for tracking belief dynamics
  • Rule-based vs LLM agent comparison

Files

  • misinformation_spread/agents.py — CitizenAgent (LLM) and RuleBasedAgent
  • misinformation_spread/model.py — MisinformationModel and RuleBasedModel
  • misinformation_spread/tools.py — Custom agent tools
  • run.py — Runs LLM simulation (requires Ollama)
  • run_comparison.py — Runs rule-based simulation (no LLM needed)
  • readme.md — Documentation and findings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant