An open-source, AI-powered fact-checking bot for Reddit. When a user replies to a claim with !FactCheck, the bot analyses the claim and responds with a clear verdict: True, False, Misleading, Unverified, or Opinion — along with a confidence score and explanation.
Built by Liveupx.com | Powered by GROQ (Llama 3.3 70B)
A user sees a suspicious claim on Reddit and replies:
!FactCheck The Great Wall of China is visible from space
The bot replies within seconds:
## [FALSE] Verdict: FALSE
**Confidence:** 96%
**Claim analyzed:**
> The Great Wall of China is visible from space with the naked eye
**Analysis:**
This is a widely debunked myth. Multiple astronauts, including Chris Hadfield,
have confirmed the Wall is not visible from low Earth orbit without aid. At ~6
metres wide, it is far too narrow to resolve with the naked eye from orbital
altitude (~400 km). NASA has also published official statements confirming this.
---
I am a bot developed by Liveupx.com | Powered by GROQ AI
User comment with "!FactCheck"
|
v
┌─────────────┐
│ bot.py │ Reddit comment stream (PRAW)
│ main loop │ Detects trigger, extracts context
└──────┬───────┘
│
v
┌─────────────┐ ┌──────────────┐
│ checker.py │────>│ search.py │ Optional: Serper.dev web search
│ pipeline │ └──────────────┘
└──────┬───────┘
│
v
┌─────────────┐
│ groq_client │ GROQ API (Llama 3.3 70B)
│ with model │ Extracts claim + analyses in one call
│ fallback │ Falls back through 4 models automatically
└──────┬───────┘
│
v
┌─────────────┐
│ database.py │ SQLite: deduplication + audit trail
└──────┬───────┘
│
v
Reply posted to Reddit
- Single-trigger activation — Only responds when a user explicitly tags
!FactCheck. Never posts unsolicited comments. - Decisive verdicts — Uses the LLM's training knowledge as the primary source. Does not default to "Unverified" on well-known claims.
- Model fallback chain — Automatically tries 4 GROQ models (
llama-3.3-70b-versatile→llama3-70b-8192→llama-3.1-70b-versatile→mixtral-8x7b-32768) if one is unavailable. - Rate limiting — Configurable max replies per hour and minimum interval between replies.
- Deduplication — SQLite database prevents duplicate replies to the same comment.
- Auto-reconnect — Recovers from Reddit API stream disconnections automatically.
- Bot disclosure — Every reply includes a footer identifying the account as a bot with a link to this source code.
- Optional web search — Serper.dev integration adds web sources to verdicts (not required — works perfectly without it).
- Python 3.9 or higher
- A Reddit account for the bot (username should clearly indicate it is a bot)
- A GROQ API key (free at console.groq.com)
- A Reddit "script" app (create at reddit.com/prefs/apps)
git clone https://github.com/liveupx/factcheckbot.git
cd factcheckbot
pip install -r requirements.txt
cp .env.example .envEdit .env with your credentials:
REDDIT_CLIENT_ID=your_client_id
REDDIT_CLIENT_SECRET=your_secret
REDDIT_USERNAME=YourBotUsername
REDDIT_PASSWORD=your_password
GROQ_API_KEY=gsk_your_groq_keyAll configuration options are documented in .env.example.
Before running the full bot, verify the fact-checking engine works:
python -m tests.test_checkerExpected output — all five test claims should return correct, confident verdicts:
Claim : The Great Wall of China is visible from space
Expected: FALSE
Verdict : FALSE (96%) [PASS]
Claim : Water boils at 100 degrees Celsius at sea level
Expected: TRUE
Verdict : TRUE (97%) [PASS]
Results: 5 passed, 0 failures out of 5
python bot.pyFor production deployment (keeps running after SSH disconnect):
screen -S factcheckbot
python bot.py
# Press Ctrl+A then D to detach
# Reconnect later: screen -r factcheckbotfactcheckbot/
├── bot.py # Entry point — Reddit stream + reply logic
├── src/
│ ├── config.py # All settings (loaded from .env)
│ ├── checker.py # Fact-checking pipeline
│ ├── groq_client.py # GROQ API client with model fallback
│ ├── search.py # Optional Serper.dev web search
│ └── database.py # SQLite tracking + deduplication
├── tests/
│ └── test_checker.py # Smoke tests for the pipeline
├── data/ # Created at runtime (db + logs)
├── .env.example # Template for environment variables
├── requirements.txt
├── LICENSE # MIT
└── README.md
| Variable | Required | Default | Description |
|---|---|---|---|
REDDIT_CLIENT_ID |
Yes | — | Reddit app client ID |
REDDIT_CLIENT_SECRET |
Yes | — | Reddit app client secret |
REDDIT_USERNAME |
Yes | — | Bot Reddit username |
REDDIT_PASSWORD |
Yes | — | Bot Reddit password |
GROQ_API_KEY |
Yes | — | GROQ API key |
GROQ_MODEL |
No | llama-3.3-70b-versatile |
Primary GROQ model |
SERPER_API_KEY |
No | — | Serper.dev key for web search |
TRIGGER |
No | !FactCheck |
Comment trigger phrase |
SUBREDDITS |
No | all |
Subreddits to monitor (comma-separated or all) |
MAX_REPLIES_PER_HOUR |
No | 30 |
Rate limit |
MIN_REPLY_INTERVAL |
No | 30 |
Seconds between replies |
LOG_LEVEL |
No | INFO |
Python log level |
This bot is designed to comply with Reddit's Bottiquette and API Terms:
- Bot disclosure: Every reply includes a footer identifying the account as automated.
- Opt-in only: The bot never comments unless explicitly triggered by a user.
- Rate limiting: Configurable limits prevent excessive posting.
- No data collection: Only stores comment IDs (for deduplication). No user data is collected, stored, or shared.
- No vote manipulation: The bot does not vote on any content.
- No advertising: Replies contain no ads or affiliate links.
- Moderator cooperation: The bot is designed to operate only in subreddits where moderators have granted explicit approval.
- Appropriate user agent: Identifies itself with a descriptive user agent string per API guidelines.
| Platform | Cost | Notes |
|---|---|---|
| DigitalOcean Droplet | $4/mo | Recommended. 1 vCPU, 512MB is sufficient. |
| Oracle Cloud | Free | Always-free tier (1 vCPU, 1GB RAM). |
| Railway | Free tier | Easy deploy, may sleep on free tier. |
| Your own machine | $0 | Works if it stays on 24/7. |
Bot returns UNVERIFIED on everything: Your GROQ API key is invalid or expired. Run python -m tests.test_checker to verify.
"RATELIMIT" errors from Reddit: Your bot account is too new or has insufficient karma. Build karma manually first.
Bot doesn't detect triggers: Ensure SUBREDDITS is set correctly in .env. Using all monitors all public subreddits.
Stream disconnections: Expected behaviour — Reddit's streaming API occasionally drops. The bot auto-reconnects after 30 seconds.
Contributions are welcome. Please open an issue first to discuss what you'd like to change.
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes
- Push to the branch
- Open a pull request
MIT — Liveupx.com