跳到正文
DEV Community· Rohit Purkait·· 3 小時前AI 評分58

Baad Mein 用 Gemma 4 E2B 在瀏覽器整理 WhatsApp 自我聊天記錄

'Baad mein' means later. Gemma reads the WhatsApp chat you keep with yourself, and tells you what you can forget

AI 導讀

作者推出 Baad Mein,讓 Gemma 4 E2B 在瀏覽器內整理用戶匯出的 WhatsApp 自我聊天記錄,歸納待辦、欠款、購物清單及可刪除或放下的舊筆記。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady

What I Built

Almost everyone I know in India has a WhatsApp chat with themselves. WhatsApp even made it official: "Message yourself".

It's where later goes. A YouTube link you'll watch this weekend. "dahi, bread aur 2 maggi". "Raju ko 500 dena hai". "kal 9 baje bank jaana hai KYC ke liye". An address you'll need once. A recipe from Ma. The wifi password. An OTP from March that you never deleted.

Baad mein dekhenge. We'll see later. Later never comes, the chat gets longer, and every few weeks you scroll up through five months of your own notes, feel bad, and scroll back down.

So I built Baad Mein (बाद में, "later"). You export that chat, and Gemma reads it slowly, inside your browser tab, while you sleep. In the morning you get one card:

  • Today and this week: what's due, with dates worked out by code, never guessed by the model
  • Money: who owes you, who you owe, how much
  • To buy: every shopping note from the last three weeks, merged into one list
  • Not sure: the notes it refuses to guess about, with the reason
  • Delete these from the chat: OTPs, card numbers, Aadhaar, PAN and passwords, masked
  • Let go: old links, dead to-dos and stale shopping lists, with permission to forget them

That last one is the sloth part. Most of what's in a "later" pile doesn't need doing. It needs someone to tell you it's okay to stop carrying it.

The morning card: 100 notes, 20 need you, 20 you can let go

Demo

Live: baad-mein.vercel.app

Press See an example for a finished card straight away. It's a made-up 100-note chat, and the answers are Gemma's real replies, recorded from a run on my laptop and replayed through the same code. Or press Read my chat and give it your own export (Chrome or Edge on a laptop; Gemma 4 E2B downloads once, about 2 GB). If you don't want to use your own chat, there's a made-up export to download under "How to get your chat out of WhatsApp".

Baad Mein demo: the home screen, Gemma reading slowly, then the card

Tap any line on the card and it shows the note it came from, word for word, with the day you wrote it.

Code

GitHub logo codeswithroh / baad-mein

Your WhatsApp chat with yourself, read slowly by Gemma 4 in your browser. One card in the morning: what's due, what to buy, who owes what, and what you can let go.

Baad Mein (बाद में, "later")

Baad Mein

Live: https://baad-mein.vercel.app · press See an example, or read your own chat.

Everyone has a WhatsApp chat with themselves. Links, "dahi bread aur maggi", "Raju ko 500 dena", an OTP from March. Things you'll deal with later.

Baad Mein reads that chat slowly, with Gemma 4 running inside your browser tab, and gives you one card in the morning:

  • Today and this week: what's due, with dates worked out by code, not guessed by the model
  • Money: who owes you, who you owe, with amounts
  • To buy: every shopping note from the last three weeks, merged into one list
  • Not sure: notes it won't guess about, with the reason
  • Delete these from the chat: OTPs, card numbers, Aadhaar, PAN and passwords, masked
  • Let go: old links, dead to-dos and stale lists you can stop carrying around

Nothing is…

How I Built It

Slow and steady, on purpose

Gemma 4 E2B runs in the tab through MediaPipe's LLM Inference on WebGPU. It reads eight notes at a time, and every answer is saved to IndexedDB the moment it arrives.

That makes the slowness free. You can start it at night with the laptop on charge and walk away. If the tab closes, the laptop sleeps or the battery dies, open the same chat again and it picks up where it stopped. I tested exactly that: closed the tab at 55 of 100 notes, reopened, and it said "4 batches picked up from last time" and carried on to the same card.

Gemma reading, eight notes at a time

On my 8 GB MacBook it's about 5 seconds per eight notes, so a 100-note chat takes under a minute, and a few thousand notes is a slow evening. Nobody has to watch it.

Gemma copies. Code reads.

A 2B model is good at "what kind of note is this?" It's bad at arithmetic, calendars and money. So the work is split in three:

your chat export
  ├─ code     secrets (OTP, card, Aadhaar, PAN, passwords) → "delete these"
  │           bare links, empty notes → settled, no model needed
  ├─ Gemma    for each note: todo / buy / money / read / keep / done / noise,
  │           and COPY the words that matter ("what", "when", "who")
  └─ code     checks every copied word is really in the note
              works out every date, every amount, who owes whom
              closes a to-do when a later note says it's done
              marks anything that doesn't add up as "not sure"

Gemma never sees your OTPs. Plain code finds them first, with checksums so a phone number or an order ID doesn't count: Luhn for card numbers, the Verhoeff check UIDAI uses for Aadhaar, the PAN pattern, and the words that announce a password or PIN. Those notes go straight to the "delete these" list, masked, and never reach the prompt.

Gemma never writes a date. It copies the words ("kal subah 8 baje", "monday ko", "12 tarikh", "parso") and code works out what they mean from the day the note was written. That part came from an earlier project of mine, Pakka, where I learned that kal means both tomorrow and yesterday in Hindi and only the verb tells you which.

Gemma never decides who owes whom. It copies the name. Code reads the direction from the words: dena, bhejna, wapas karna, dite hobe means you pay; lena, se lena, nite hobe, debe, owes me means you get paid. If the words don't say, the note goes to "not sure".

And Gemma's copies are checked. If the words it returns aren't actually in your note, the card shows your note as you wrote it and says why. On the held-out set, Gemma rewrote instead of copying 0 times out of 49.

Why code does the dates: 8 out of 19

I tested the obvious alternative. Same 19 to-dos with due dates, the date each was written right there in the prompt, and Gemma asked to give the due date itself.

Gemma: 8 of 19 right. Eight of its answers weren't even valid dates ("2026-19-Oct-2026"). "renew PUC kal", written on 20 October, came back as the 19th.

Code, from the words Gemma copied: 16 of 19 right, 2 marked "not sure" instead of guessed, 1 wrong. The two "not sure" ones are honest: "bike service next sunday", written on a Tuesday, could mean the coming Sunday or the one after, so the card asks.

Testing it

I wrote two made-up "chats with yourself" in the mix I actually see: English, Hinglish and Banglish, links, lists, money, IDs, half-typed nonsense. Every note is labelled by hand.

I tuned the prompt on a 40-note dev set only, then froze it in a commit before running the 100-note held-out set once. Same model and runtime as the app: Gemma 4 E2B in Chrome with WebGPU, on an 8 GB MacBook, driven by a script so the run is repeatable.

Held-out, 100 notes
Kind of note right 95 / 100
Due dates right 16 / 19 (2 "not sure", 1 wrong)
Money direction right 9 / 9
Secrets caught before Gemma 7 / 7
Gemma rewrote instead of copying 0 / 49
To-dos closed by a later "done" note 6
Time 49 seconds

The raw runs, every reply included, are in eval/results/ in the repo.

The money section: owed to you, you owe

Two bugs worth telling

Gemma broke its own JSON, and a whole batch vanished. On one dev run, five notes in a row came back as "Gemma didn't say what this is". The reply looked fine at a glance. It wasn't: Gemma had written "who=""" instead of "who":"", and one bad key made the whole array unparseable. The classification inside was perfect. Now the reader repairs that slip before parsing, there's a test for it, and the dev set went from 36 to 40 out of 40.

Netflix was tagged as X. The link reader checked whether a URL contained x.com. So does netflix.com. A word boundary fixed it, and a test keeps it fixed.

What it can't do yet

  • It once read a bill as already paid. "pay credit card bill 22nd" came back as done, which would quietly hide a real bill. That's the mistake I like least, and the next thing I'd fix: a "done" note should need a past-tense verb in the note itself before code believes it.
  • "end of month" isn't a date code understands yet, so "car PUC expires end of month, renew" goes to "not sure".
  • Plans read as tasks. "Pujo plans: Saturday Maddox Square, Sunday Bagbazar" is information, but Gemma filed it as a to-do.
  • After the held-out run I fixed one bug it exposed: when Gemma copied the wrong words as the date ("office party ke liye"), code gave up instead of reading "30 oct" from the note. Code now reads the note's own day words in that case. The numbers above are from before the fix.

Not sure: the notes it refuses to guess about

Why Does Open Innovation Matter?

Because this is the most private chat on your phone. The chat you keep with yourself is where people paste the things they'd never send anyone else: Aadhaar numbers, bank account numbers, the netbanking password "just for now", OTPs. Sending that to a hosted model, to sort it, means handing a stranger the exact pile you'd most like deleted. Baad Mein reads it in your own browser tab. Once the model is downloaded, reading your chat makes no network calls at all. Nothing is uploaded, there's no account, and there's no server to leak.

Because "slow" only works when it's free. An overnight job over a few thousand notes is a lot of tokens. On a paid API, "let it run slowly while you sleep" is a bill. On an open model on your own laptop, it costs some electricity, and there's no reason to rush it.

Because I could make it boring. With the weights on my machine, I run Gemma greedy (top-k 1, temperature 0), so the same chat gives the same card every time. That made it possible to test properly: a frozen prompt, a held-out set, a recorded example that replays exactly. It also means the example in the app isn't a mock-up. It's Gemma's real output.

Because the rules around the model are mine. The secret detection, the date reader, the money words in three languages and the "let go" rules are plain code anyone can read and change. Where an open model ends and my code begins is visible line by line, so when it's wrong, I can say exactly which half was wrong.

The Lazy Payoff

The made-up chat in the example covers five months: 100 notes. Reading through it yourself means scrolling, re-reading, deciding, and still forgetting half.

Baad Mein read it in 49 seconds, unattended, and turned it into:

  • 20 things that need you: 5 due today or overdue, 4 this week, 9 about money, 2 it wasn't sure about
  • 16 things to buy, merged from six separate lists
  • 20 things you can let go, with the reason for each
  • 7 secrets to delete from the chat

You read one card instead of five months. Tap anything you don't trust and see the original note. Then press Copy as a WhatsApp message and send the card back to yourself, to the same chat, where it belongs.

Let go: permission granted

Prize Categories

  • Best Use of Gemma. Gemma 4 E2B runs fully in the browser through MediaPipe on WebGPU. It's held to copying, never computing, and scored on a held-out set with the prompt frozen first.

來源:DEV Community · dev.to