跳到正文
DEV Community· Priyansh Jikadra·· 3 小時前AI 評分39

Group Chat Summarizer:以本地開源模型整理 WhatsApp 和 Telegram 羣組聊天

Group-Chat-Summarizer

AI 導讀

Group Chat Summarizer 是一款以 Ollama 運行開放權重模型的本地 CLI 工具,可整理匯出的 WhatsApp 和 Telegram 羣組聊天,為每段對話生成兩行摘要及行動事項。工具預設使用 qwen2.5:3b,只處理新訊息,並可離線運行;聊天資料不會傳送至第三方伺服器。

正文

Priyansh Jikadra

Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady Submission 🦥

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

What I Built

I built Group Chat Summarizer, a lazy sloth agent that reads your group chats overnight so you don't have to scroll through hundreds of messages in the morning.

You drop exported chats (WhatsApp .txt or Telegram result.json) into a folder. Every night it summarizes only the new messages in each chat into a strict two-line summary, plus a short list of action items and dates mentioned. In the morning you open one daily digest (digests/YYYY-MM-DD.md) instead of 15 noisy chats.

It's for anyone who sits in college, project, family, or society groups and misses the one important message ("class moved to 9 AM", "submit by Friday") buried under 400 memes.

Demo

🎥 Video demo: [add your link here]

Example of the morning digest in the terminal:

🦥 Group Chat Summarizer: digest for 2026-10-26

📱 CSE Batch 2027
  Most chatter was about the DSA assignment; the deadline was moved to Friday.
  Lab is shifted to Lab 3 on Monday.
  Action items: Submit DSA assignment (Fri) · Bring ID card for lab

📱 Project Team
  The team agreed to freeze features and focus on testing this week.
  Priyansh will push the final build before the demo.

Code

group-chat-summarizer

Let a lazy sloth read your group chats overnight so you don't have to.

"Slow and steady wins the morning." 🦥

A fully local, privacy-first CLI tool that reads exported WhatsApp and Telegram group chats and produces a two-line summary of each conversation — powered by open-weight models through Ollama. No API keys, no cloud, no data leaves your machine.

Built for the DEV.to "Slow and Steady" challenge — build something with open-weight models that rewards laziness.


Demo

$ summarize run
Summarizing work_project_chat.txt (15 new messages)...
Summarizing hiking_group_chat.json (11 new messages)...

╭──────────────────────────────╮
│   Group Chat Digest          │
│       slow and steady        │
╰──────────────────────────────╯

>> Hiking Group Chat

Summary:
The group planned a Ridge Loop hike for Sunday with a 7:30 AM carpool from Main St.
Mood is enthusiastic; logistics are locked in with snacks, water, and sunscreen covered.

Action items:
- Meet 7:30 AM at Main St coffee

…

How I Built It

  • Open-weight model: a small model (qwen2.5:3b by default) that fits comfortably on a laptop GPU with 6 GB VRAM. It's one line in config.yaml, so you can swap it for any other model.
  • Local inference: Ollama serves the model at localhost:11434. The app talks only to that local endpoint.
  • Python CLI: built with Typer and Rich. Commands: summarize run, summarize watch, summarize check, and summarize install-schedule (Windows Task Scheduler or cron).
  • Parsers: WhatsApp and Telegram exports are normalized into a common Message dataclass. Media placeholders and system messages are dropped.
  • Incremental state: a small state file remembers the last processed timestamp per chat, so each night only new messages are summarized.
  • Map-reduce chunking: long chats are split into chunks, each chunk is summarized, and the partial summaries are merged into the final two lines.
  • Editable prompt: the summary style lives in prompts/summary.txt, so you can change the tone or format without touching code.
  • Privacy test: a test fails if the code ever calls a non-localhost URL.
  • Built with Google Antigravity: I gave its agent one detailed spec and it planned, built, tested, and pushed the project to GitHub.

Why Does Open Innovation Matter?

Group chats are some of the most private text we have: family plans, friends venting, personal details. Sending them to a closed API means handing them to someone else's server. With an open-weight model, the data never leaves your laptop.

  • Privacy: no chat text touches a third-party server, and a test enforces it.
  • Works offline: after the one-time model download, the whole pipeline runs with no internet.
  • Zero cost: no API keys, no per-token bills, so running it every night costs nothing.
  • Swappable and tunable: if a model summarizes your Hinglish chats badly, change one line in the config, or fine-tune a model on your own style. A closed API wouldn't let me do either.
  • Editable behavior: the prompt and the code are fully mine to change.

My Agent Session

[Add your DevRelay session embed or link here]

The Lazy Payoff

Before: catching up on my groups meant scrolling through roughly [X] messages a day, about [Y] minutes.
After: I read one digest in about 30 seconds, and the nightly run needs zero effort from me.

[Replace X and Y with your real numbers from this week, or delete this section if you didn't use it.]

Prize Categories

[List the partner categories you're entering from the challenge page, or remove this section.]

來源:DEV Community · dev.to