Skip to content

Architecture

What is inside, and why each piece is there

One request flows through independent, testable tools. The verdict is computed deterministically; the optional LLM only writes the explanation.

MessageSMS / WhatsAppLanguage5 script stylesMLchar n-gram LRRules15 signalsURL forensicsofflineAdvisoriesBM25 RAGFuserisk 0-100VerdictEN / हिं / తె

Skills & technologies

What I used, what it does, why

Tagged by the hiring track it demonstrates: AI, ML, Data Science, Data Analytics and Software Engineering.

AIMLDSDASWE

Agentic tool pipeline (8 tools, streamed trace)

AI

What it doesA planner runs small single-purpose tools in order and streams each call to the UI.

WhyMakes the system auditable: every verdict can be traced to tool outputs, which is what regulated teams ask for.

lib/engine/analyze.ts, /api/analyze (NDJSON streaming)

RAG-lite: BM25 retrieval over curated advisories

AIDS

What it doesFinds the most relevant safety advisories for the message and shows them with official source links.

WhyGrounds the advice in documents instead of model memory, cutting hallucinated guidance. BM25 needs no embedding API, so it runs offline and free.

lib/engine/advisories.ts

Optional LLM explainer (Gemini / Claude)

AI

What it doesRewrites the findings as 2-3 plain sentences in English, Hindi or Telugu.

WhyLanguage quality without giving an LLM the power to change the verdict. Message text is passed as untrusted data to blunt prompt injection.

lib/engine/llm.ts

MCP server (Model Context Protocol)

AISWE

What it doesExposes analyze_message, check_url and search_advisories as tools any MCP-capable assistant can call.

WhyShows the engine is reusable infrastructure, not just a web page, and uses the 2026 standard for agent tooling.

mcp/server.ts (npm run mcp)

TF-IDF char n-grams + Logistic Regression (scikit-learn)

MLDS

What it doesTurns raw characters into weighted features and learns a linear scam/safe boundary; a second head predicts the scam family.

WhyCharacter n-grams survive transliteration chaos (kyc / KYC / k.y.c) where word models break. Linear models are fast, explainable and tiny (one JSON file).

ml/train.py -> lib/data/model.json

Pure-TypeScript model inference + parity test

MLSWE

What it doesRe-implements sklearn's char_wb analyzer, sublinear TF, IDF and L2 norm in TS.

WhyDeploys on Vercel with no Python runtime. A parity test proves the TS output matches Python to 2e-6 on 32 sentences.

lib/engine/classifier.ts, scripts/selftest.ts

Template-held-out evaluation + blind sets

DS

What it doesSplits train/test by message template, plus 64 hand-written and 40 blind messages.

WhyPrevents leakage that makes random splits report ~99-100% F1. Reporting the gap is the point.

ml/train.py, /benchmark

Calibration & error analysis (ECE, AUC, confusion)

DSML

What it doesMeasures whether probabilities mean what they say and lists exactly which messages fail.

WhyA probability of 0.9 should be right ~90% of the time. The model is over-confident, so it feeds a fusion layer instead of being shown raw.

ml/train.py -> results.json

Local explainability (per-word contributions)

MLDS

What it doesSums each n-gram's TF-IDF x coefficient into a per-word score and paints it on the message.

WhyLinear-model equivalent of SHAP: the user sees which words drove the score, and I found dataset shortcuts ('nov', 'rs') this way.

lib/engine/classifier.ts, <HeatText />

Rule engine: 15 multilingual scam-anatomy signals

DS

What it doesRegex features for urgency, secrecy, authority impersonation, OTP asks, advance fees, remote-access apps.

WhyCatches new wording the ML model has not seen, and every rule carries a human-readable label and weight.

lib/engine/signals.ts

URL forensics (offline)

DSSWE

What it doesFlags IP hosts, shorteners, abused TLDs, brand look-alikes and typo-squats using Levenshtein distance.

WhyPhishing links are the highest-signal evidence and need no network call, so it is private, fast and cannot be used to probe attacker servers.

lib/engine/urlforensics.ts

Score fusion (logit blend)

DSML

What it doesrisk = sigmoid(0.5*ML + 0.7*rules + 2.0*URL - 1.1*safety - 0.6).

WhyTransparent, hand-tunable alternative to a stacked model when only ~100 labelled hold-out messages exist.

lib/engine/analyze.ts

Corpus generation + data-quality iteration

DADS

What it does198 templates x slot filling across 5 scripts; first benchmark exposed over-flagging of ordinary receipts, so legit coverage was widened.

WhyShows the loop analysts actually run: measure, find the segment that fails, fix the data, re-measure.

ml/build_corpus.py

Segment analysis (language x outcome)

DA

What it doesBreaks accuracy down by language and scam family; surfaces the Hindi weakness.

WhyAverages hide the segment that fails users. Slicing is how analysts find it.

/benchmark

FastAPI + Docker microservice for the same model

SWEML

What it doesServes the pickled sklearn pipeline over HTTP for teams that prefer a Python backend.

WhyGives a second deployment path: Vercel (TS) or container (Python).

ml/serve/app.py, Dockerfile

Next.js 14 App Router, React 18, TypeScript (strict)

SWE

What it doesServer components for the data-heavy pages, client components for interaction, route handlers for the API.

WhyOne repo, one deploy, type safety from model JSON to UI.

app/, components/

Tailwind CSS, Framer Motion, design tokens

SWE

What it doesDark HUD design system, scroll reveals, animated gauge, live agent trace, reduced-motion support.

WhyPerceived quality: first impressions decide if a reviewer opens the code.

globals.css, components/

Security & privacy hardening

SWE

What it doesZod input validation, 2,000-char cap, per-IP rate limit, security headers, stateless API, no logging of message text.

WhyA scam tool receives sensitive messages; not storing them is the safest design.

app/api/analyze/route.ts, next.config.mjs