Skip to content
SaudSatopayPublic

About

Kasauti - the touchstone for WhatsApp forwards. Evidence-first misinformation checker for India, powered by SerpApi. SerpApi India Hackathon 2026.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

เค•เคธเฅŒเคŸเฅ€ Kasauti โ€” Gold is tested on a touchstone. So are forwards.

The touchstone for WhatsApp forwards.

In India, gold is tested by streaking it across a kasauti โ€” a black touchstone. Kasauti does the same to the messages in your family group: streak any forward across live evidence from the entire web, and read the mark.

Check karo, phir forward karo. ยท Verify before you amplify.


Tests CI Python Evidence by SerpApi License

SerpApi India Hackathon 2026 ยท Track: Knowledge & Public Interest (news literacy)

The problem ยท What it does ยท Quickstart ยท SerpApi usage ยท Architecture ยท Guardrails ยท Four doors ยท Tests ยท Hackathon notes

A WhatsApp forward arrives, its chain-forward markers light up, and a FALSE stamp slams down โ€” then a polite reply appears.

Paste a forward. Watch it get assayed.

  • ๐Ÿซ† Forward Fingerprint โ€” offline heuristics catch chain-message DNA in English, Hinglish and Devanagari
  • ๐ŸŒ Live evidence via SerpApi โ€” Google Search, Google News, a sweep of 8 Indian fact-check desks, Google Lens
  • โš–๏ธ Credibility-weighted โ€” Alt News, BOOM, PIB outrank blogs; satire gets flagged as satire
  • ๐Ÿ›๏ธ Guarded verdicts โ€” the LLM proposes, deterministic code caps what it may claim
  • ๐Ÿ–ผ๏ธ Old-photo detection โ€” "yesterday's floods" turns out to be the 2004 tsunami
  • ๐Ÿ“ฑ A reply you can actually send โ€” warm, receipts attached, in the forward's own language

๐Ÿ‡ฎ๐Ÿ‡ณ The problem

India is the world's largest WhatsApp market, and the family group is where misinformation lives its best life: the UNESCO "best national anthem" award that never existed, free-recharge phishing links dressed up as government schemes, miracle cures "doctors don't want you to know", and โ€” most common of all โ€” real photos from old tragedies recycled as today's news.

Fact-checkers debunk these daily. But their work sits on websites, while the hoax sits in your pocket, twelve forwards deep, in Hinglish, demanding to be sent to ten more groups. The gap between the debunk exists and your uncle sees the debunk is where Kasauti lives.

โœจ What Kasauti does

Paste a forward (text, image URL, or both โ€” Hindi, Hinglish, English, sab chalega). Kasauti runs a six-stage verification pipeline and returns an assay certificate: a verdict, calibrated confidence, credibility-ranked evidence with links โ€” and a polite, ready-to-paste reply for the group.

Kasauti's assay certificate: a FALSE stamp, evidence-confidence streak, forward-fingerprint gauge, claims with rationale, and credibility-ranked evidence.

Stage What happens
๐Ÿซ† Forward Fingerprint Instant, offline heuristics score the message 0โ€“100 on chain-forward markers: forwarding pleas, "media is hiding this", miracle cures, free-gift bait, emoji storms โ€” in English, Hinglish and Devanagari.
๐Ÿ” Claim extraction An LLM splits the forward into atomic, checkable claims and drafts diverse search queries. A rule-based fallback works with no LLM at all.
๐ŸŒ Evidence retrieval Four retrieval strategies on three SerpApi engines, in parallel โ€” see How Kasauti uses SerpApi.
โš–๏ธ Credibility weighting Every result is scored by a transparent source registry: fact-check desks (Alt News, BOOM, Factly, Vishvas Newsโ€ฆ) and official domains (PIB, *.gov.in) outrank ordinary sites; unknown blogs count for little; satire sites get flagged as satire.
๐Ÿ›๏ธ Verdict + guardrails An LLM judge reads the numbered evidence table โ€” then deterministic guardrails cap what it may claim. The model is never allowed to be more confident than the evidence.
๐Ÿ“ฑ Reply for the group The hardest part of fact-checking is telling your uncle. Kasauti drafts a warm, non-preachy correction in the language of the forward, receipts attached.

๐Ÿ–ผ๏ธ Real photo. Fake caption.

The single biggest misinformation format in India isn't fabricated images โ€” it's genuine photos relabelled as breaking news. Attach an image URL and Kasauti runs it through Google Lens via SerpApi, maps the image's other lives across the web, and reads the years its match titles keep citing even when no page carries a machine-readable date.

A forward with a photo always carries one more claim โ€” "this photo genuinely shows the event described" โ€” judged on the Lens evidence alone. So a true caption on a recycled photo still comes back OUTDATED: the cyclone below is real; the photo is the 2004 tsunami.

The image check: the text claim about the cyclone is true, but Google Lens finds the photo on 20 other pages whose titles repeatedly reference 2004 โ€” the photo claim is OUTDATED and so is the forward.

๐Ÿš€ Quickstart

git clone https://github.com/SaudSatopay/kasauti && cd kasauti
python -m venv .venv && .venv\Scripts\activate      # Windows
# python -m venv .venv && source .venv/bin/activate   # macOS / Linux
pip install -e .

cp .env.example .env     # put your SERPAPI_API_KEY inside
kasauti serve            # โ†’ http://127.0.0.1:7860  (landing)  ยท  /app  (the checker)

The only required key is a free SerpApi key (250 searches/month). An LLM key is optional but recommended โ€” any one of GEMINI_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY, GROQ_API_KEY, or a local Ollama model (KASAUTI_OLLAMA_MODEL=llama3.2). With no LLM key, Kasauti runs in a conservative rule-based mode.

Free-tier tips (worth reading before a demo)
  • Gemini's free tier caps some models at a handful of requests per day (e.g. gemini-2.5-flash โ†’ 20/day on new keys). One check makes 3โ€“4 LLM calls. Set KASAUTI_LLM_MODEL=gemini-3-flash-preview (fast, separate quota) or use another provider.
  • Kasauti disk-caches both SerpApi and LLM responses โ€” run each demo once to warm the cache and every re-run is instant and costs nothing.
  • Gemini "thinking" mode is turned off by default (KASAUTI_GEMINI_THINKING=none): it added 30โ€“60 s per call with no accuracy gain here.
  • Every certificate prints its own cost line: "3 SerpApi searches ยท LLM-assisted ยท 5.4 s".

๐Ÿ”Ž How Kasauti uses SerpApi

SerpApi is not an add-on here โ€” it is the evidence engine. Every fact the verdict cites was retrieved live through it. Four strategies, three engines:

# Engine Strategy Why it's essential
1 google Organic web results per claim โ€” google_domain=google.co.in, gl=in The broad picture: is anyone credible reporting this at all? India-localised so regional coverage surfaces.
2 google_news News-tab coverage per claim Freshness and provenance: real events leave a news trail within hours; hoaxes leave a trail of debunks.
3 google + site: One query swept across 8 Indian fact-check desks โ€” altnews.in, boomlive.in, factly.in, vishvasnews.com, newschecker.in, factcrescendo.com, factcheck.afp.com, pib.gov.in The decisive shot: if a dedicated desk has already checked this exact claim, that finding should settle the verdict โ€” and it usually has.
4 google_lens Reverse image search on attached photos (type=visual_matches) The biggest misinformation pattern in India is a real photo with a false caption. Lens finds the image's other lives; dated matches and title-years expose the recycling.

Search results arrive as structured JSON โ€” titles, links, sources, dates โ€” exactly what a credibility-weighting pipeline needs. No scraping, no brittle parsers, no CAPTCHAs: the whole evidence layer is one clean module.

Free-tier economics (250 searches/month):

one text check   = claims (โ‰ค2 by default) ร— 3 strategies      โ‰ˆ 3โ€“6 searches
one image check  = + 1 Google Lens search                     โ‰ˆ 4โ€“7 searches
                                              โ†’ ~40โ€“80 checks per month, free

A transparent budget counter prints on every certificate, responses are disk-cached (22 h TTL, configurable), and the entire test suite runs on bundled SerpApi-shaped fixtures โ€” zero credits to develop, test, or CI.

๐Ÿ—๏ธ Architecture

%%{init: {'theme':'base','themeVariables':{'primaryColor':'#1b1617','primaryTextColor':'#f4edde','primaryBorderColor':'#d4a63f','lineColor':'#d4a63f','secondaryColor':'#261f20','tertiaryColor':'#131011','fontFamily':'Georgia, serif','fontSize':'14px','clusterBkg':'#131011','clusterBorder':'#8a641c','edgeLabelBackground':'#0c0a0b'}}}%%
flowchart LR
    A[๐Ÿ“ฑ Forward<br/>text + image] --> FP[๐Ÿซ† Fingerprint<br/>offline heuristics]
    A --> CE[๐Ÿ” Claim extraction<br/>LLM ยท fallback: rules]
    CE --> C1[Claim 1] & C2[Claim 2]
    C1 & C2 --> S{{"๐ŸŒ SerpApi<br/>google ยท google_news<br/>fact-check sweep"}}
    A -- image --> LENS{{"๐Ÿ–ผ๏ธ SerpApi<br/>google_lens"}}
    S --> EV[โš–๏ธ Evidence ranking<br/>credibility ร— relevance ร— recency]
    LENS --> TL[๐Ÿ“… Earliest-appearance<br/>timeline + title-year]
    EV --> J[๐Ÿ›๏ธ Verdict judge<br/>LLM + guardrails ยท fallback: rules]
    TL --> J
    FP --> R
    J --> R[๐Ÿ“œ Assay certificate<br/>verdict ยท confidence ยท citations]
    R --> REP[๐Ÿ’ฌ Reply for the group<br/>same language as the forward]
    style S fill:#3b2a08,stroke:#f0c75e,color:#fff1c2
    style LENS fill:#3b2a08,stroke:#f0c75e,color:#fff1c2
    style R fill:#f4edde,stroke:#d4a63f,color:#241f1a
Loading

The six stages of the Kasauti pipeline

Design decisions worth judging:

  • Guardrails over vibes. The LLM proposes; deterministic code disposes. Confidence caps are enforced after the model answers, in verdict.py โ€” an uncited verdict is always downgraded to unverified, whatever the model felt about it.
  • Old fact-checks stay decisive. Recency boosts ordinary news but never penalises fact-checkers or official sources โ€” a 2023 debunk of a recycled 2016 hoax is exactly the evidence you want in 2026.
  • Degrades gracefully. No LLM โ†’ rule-based claims and verdicts. LLM rate-limited mid-run โ†’ rule-based verdict, clearly labelled. No API key โ†’ helpful error with the free-key link.
  • Every interface is the same pipeline: web UI, CLI, Python API, MCP server. One check() function, four doors.

Deeper tour: docs/architecture.md.

โš–๏ธ Credibility weighting

Source credibility ladder: fact-checker 1.00, official 0.95, news agency 0.85, international 0.80, national 0.75, reference 0.60, regional 0.55, unknown 0.35, satire 0.20

The registry is a plain, PR-able dict of ~90 domains in eight tiers (a Reference tier โ€” Wikipedia, Wikimedia, Britannica โ€” is strong for image provenance, weaker than a newsroom for breaking claims). It classifies publisher type, never editorial stance. Unknown domains get weight 0.35 โ€” weak evidence, not anti-evidence. Score = credibility ร— (0.45 + 0.55 ร— relevance) ร— recency, with a flat bonus for a fact-checker directly on point so volume can never outrank it, and category/tag/archive listing pages filtered out before they can hijack the tier bonus.

๐Ÿ›ก๏ธ Guardrails

Situation Enforcement
No valid citations label โ†’ UNVERIFIED, confidence โ‰ค 0.35
Only unknown-tier citations confidence โ‰ค 0.55
TRUE / FALSE above 0.8 requires a fact-checker or official citation
Any cited satire-tier source label โ†’ SATIRE
Cited ids not in the evidence table dropped before all other checks

Every intervention is recorded in guardrail_notes and rendered on the certificate โ€” calibration you can see.

๐Ÿšช Four doors, one pipeline

Web app โ€” landing page + the checker

kasauti serve
# http://127.0.0.1:7860/app
# deep links: /app?text=...&image=...&auto=1

CLI โ€” rich terminal certificates, --json for scripting

kasauti check "UNESCO ne anthem ko best declare kiya!"
kasauti check "..." --image https://โ€ฆ/photo.jpg --json
kasauti examples

Python

from kasauti import check

report = check("Modi sarkar de rahi hai FREE recharge!")
report.overall_label        # VerdictLabel.FALSE
report.suggested_reply      # paste-ready, in Hinglish

MCP server โ€” give any AI assistant a fact-checking tool

pip install -e ".[mcp]" && kasauti mcp
{ "mcpServers": { "kasauti": { "command": "kasauti",
    "args": ["mcp"], "env": { "SERPAPI_API_KEY": "โ€ฆ" } } } }

๐Ÿท๏ธ Verdict labels

TRUE ยท MOSTLY TRUE ยท MISLEADING ยท FALSE ยท OUTDATED (real once, recycled as current โ€” the WhatsApp classic) ยท UNVERIFIED ยท SATIRE (sometimes the forward is a Faking News post taken literally).

What Kasauti is not: an oracle. It is an evidence assistant โ€” every verdict links its sources, confidence is calibrated to source quality, and the certificate says, on every run: "Kasauti assists your judgement โ€” read the evidence." When evidence is thin it says unverified, not a guess.

๐Ÿงช Tests

pip install -e ".[dev]"
pytest

68 tests cover the fingerprint heuristics (English + Hinglish + Devanagari), source tiering, date parsing for every format SerpApi emits, dedup and ranking, listing-page filtering, verdict guardrails, both fallback paths, LLM provider resolution and response caching, the streaming API, both web pages, and two end-to-end pipeline runs โ€” all against bundled SerpApi-shaped fixtures: no network, no keys, no credits. CI runs them on Python 3.10 and 3.12.

๐Ÿ“‚ Project layout

src/kasauti/
โ”œโ”€โ”€ pipeline.py      # the six-stage orchestrator (start here)
โ”œโ”€โ”€ serp.py          # SerpApi layer: 4 strategies, cache, budget counter
โ”œโ”€โ”€ fingerprint.py   # offline chain-forward heuristics (en / hi / Hinglish)
โ”œโ”€โ”€ claims.py        # LLM claim extraction + rule-based fallback
โ”œโ”€โ”€ evidence.py      # normalise ยท dedupe ยท credibility-rank ยท date parsing
โ”œโ”€โ”€ sources.py       # the transparent source-credibility registry
โ”œโ”€โ”€ imagecheck.py    # Google Lens โ†’ earliest appearance + title-year era
โ”œโ”€โ”€ verdict.py       # LLM judge + deterministic guardrails + rule fallback
โ”œโ”€โ”€ reply.py         # the "tell your uncle nicely" generator
โ”œโ”€โ”€ llm.py           # any OpenAI-compatible provider (or none) + disk cache
โ”œโ”€โ”€ cli.py ยท server.py ยท mcp_server.py
โ”œโ”€โ”€ webui/           # landing (index.html) + checker (app.html), no build step
โ”œโ”€โ”€ fixtures/        # SerpApi-shaped responses for tests & offline demo
โ””โ”€โ”€ examples/        # classic Indian hoaxes to try

๐Ÿ† Hackathon notes

  • Event: SerpApi India Hackathon 2026
  • Track: Knowledge & Public Interest โ€” news literacy
  • SerpApi products used: Google Search API, Google News API, Google Lens API โ€” see How Kasauti uses SerpApi
  • Prior existence: built from scratch for this hackathon.
  • AI disclosure: developed with AI pair-programming assistance (Claude Code); at runtime, users may optionally configure an LLM of their choice for claim extraction and verdict synthesis, as documented above. All evidence retrieval, credibility weighting, confidence guardrails and the source registry are deterministic, reviewable code.

๐Ÿ—บ๏ธ Roadmap

  • WhatsApp Business API bot โ€” forward a message to Kasauti, get the certificate back in-chat
  • More Indic languages in the fingerprint rules (Tamil, Telugu, Bengali)
  • Video-thumbnail checks via SerpApi's YouTube engine
  • Community-maintained source registry with regional fact-checkers

MIT License ยท The source registry categorises publishers by type (fact-checker / official / news / satire); it encodes no judgement of any outlet's editorial stance.

Check karo, phir forward karo.

About

Kasauti - the touchstone for WhatsApp forwards. Evidence-first misinformation checker for India, powered by SerpApi. SerpApi India Hackathon 2026.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages