AWS Builder Center

Factify: Building an AI Misinformation Detector for WhatsApp-Era India

How I built a real-time fact-checking tool using LLMs to catch scam forwards, fake job offers, and viral misinformation — and what I learned deploying it, from AWS architecture to graceful AI fallbacks.

🚀 The Problem

Misinformation doesn't spread through newsrooms anymore — it spreads through WhatsApp forwards, "urgent" job offers promising ₹5000/day, and fake giveaways demanding you forward to 10 friends before a deadline hits. Most people have 10 seconds to decide: forward it, or don't. Factify exists to give them a second opinion in those 10 seconds.

🛠️ What I Built

Factify is a Streamlit-based verification desk where a user pastes any text — a forward, a job posting, a news snippet — and gets back a structured verdict: Likely True / Needs Verification / Likely Misleading, a risk level, a confidence score, and a plain-language explanation of why.
Under the hood:
  • LLM reasoning layer: Calls open-weight models (starting with  nex-agi/nex-n2.5-mini:free ) via OpenRouter with a prompt engineered specifically for regional social-media patterns — urgency bait, forward-baiting, fake authority claims, and Hinglish code-switching.
  • Graceful degradation: If the API is rate-limited or unreachable, Factify doesn't crash — it falls back to a lightweight heuristic engine so the user always gets some signal, clearly labeled as offline mode rather than silently pretending to be the AI.
  • Multi-model retry chain: If one free model is rate-limited, Factify automatically retries the next candidate model before giving up.

🐛 What I Learned Debugging It

The most valuable lesson wasn't in the LLM prompt — it was in observability. Early on, my app was silently falling back to the heuristic engine without telling me, so every result looked legitimate but was actually a canned template. I fixed this by surfacing the active engine ( Live AI  vs  Fallback ) directly in the UI, plus a debug panel showing the exact API error (rate limit, bad key, model deprecation) instead of swallowing it. That one change turned a confusing "why does this feel generic" bug into a 30-second diagnosis.

☁️ Cloud Roadmap (AWS)

Currently Factify runs locally; here's the AWS-native architecture I'm moving it to next:
  1. Compute: Containerized on ECS Fargate (or a t2.micro EC2 free-tier instance for the MVP), fronted by an ALB for TLS termination.
  1. Secrets: API keys migrated from  .env  to AWS Secrets Manager, pulled at runtime — no keys baked into images.
  1. Networking: A security group restricting inbound to 443/80 only, with 8501 kept internal behind the load balancer.
  1. Observability: CloudWatch logs wired to the same debug-error surfacing I built for the UI, so failures are visible in ops dashboards too.

💡 Takeaway

Building Factify taught me that in AI products, the unglamorous part — clear error surfacing, honest fallback labeling, retry logic — matters more than the prompt itself. A confident wrong answer is worse than an honest "I couldn't verify this."
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article