Every day, thousands of Indian students lose money to fake recruiters, phishing links, and UPI fraud. Existing tools are either too generic or require technical knowledge to use. ScamShield AI was built to solve this — an autonomous multi-agent scam detection pipeline that any student can use in seconds, just by pasting a suspicious message or uploading a WhatsApp screenshot.

What it does

ScamShield AI runs a 6-step autonomous pipeline powered by Google ADK and Gemini 2.5 Flash:

  1. Entity Extraction — OCR (Tesseract.js, eng+hin) pulls phone numbers, UPI handles, URLs, and keywords from text or screenshots
  2. Vector Search — MongoDB Atlas MCP Server queries a 1536-dimensional cosine similarity index against a database of known scam reports
  3. Trust Score Indexing — weighted algorithm scores the threat across multiple signal categories
  4. AI Verdict — Gemini 2.5 Flash classifies the risk as CRITICAL / HIGH / MEDIUM / LOW with reasoning
  5. Persistence — full audit report with embeddings is stored back to MongoDB Atlas via MCP insert-many
  6. FIR Generation — a pre-filled cybercrime complaint formatted for India's cybercrime.gov.in portal is generated and available for download

The entire pipeline streams step-by-step via NDJSON so users see real-time progress — not a spinner.

How we built it

The core agent is built on Google ADK (google.adk.agents.Agent) with Gemini 2.5 Flash as the reasoning model and MongoDB Atlas MCP Server integrated as a stdio child process via StdioConnectionParams. The ADK agent runs as a Python FastAPI bridge, connected to a Node.js + Express backend which handles NDJSON streaming to a React + Vite frontend deployed on Vercel. MongoDB Atlas handles both vector storage (1536-dim embeddings via gemini-embedding-2) and persistence via the MCP tool interface — not direct database calls.

Challenges we ran into

Getting Google ADK to reliably invoke MongoDB MCP tools in a streaming context required significant debugging — particularly around stdio process lifecycle management and JSON-RPC message parsing. NDJSON streaming from Python FastAPI through Express to React also required careful chunked response handling to avoid buffering issues. Tesseract OCR on Hindi + English mixed text (Hinglish) needed tuning to handle noisy WhatsApp screenshot backgrounds.

Accomplishments we're proud of

The MCP integration is real — MongoDB Atlas MCP Server is spawned as a child process and invoked at runtime for both vector search (aggregate + $vectorSearch pipeline) and persistence (insert-many). The system has a graceful fallback to direct Mongoose queries if MCP fails, ensuring 100% uptime. The FIR generator is India-specific — formatted for the MHA cybercrime.gov.in portal with the 1930 helpline surfaced on every CRITICAL verdict.

What we learned

Building with Google ADK taught us how agent tool invocation differs from simple API calls — the agent decides when and how to use tools based on context, not hardcoded logic. Integrating an MCP server as a tool inside an ADK agent required understanding both protocols simultaneously. We also learned how to design streaming pipelines that remain legible to end users rather than treating AI processing as a black box.

What's next for ScamShield AI

WhatsApp Business API integration for direct in-chat scam detection, expansion of the scam database with community-reported cases, a public API for NGOs and placement cells to integrate scam detection into their platforms, and Hindi-language UI for broader reach across tier-2 and tier-3 cities.

Built With

Share this project:

Updates