Steady Inbox:以 MiniLM 本機分組訊息,保留所有原文
Steady Inbox: A Local MiniLM Assistant That Groups Messages Without Losing the Originals
Steady Inbox 使用 sentence-transformers/all-MiniLM-L6-v2 在本機為訊息分組,同時保留每則原文供查看及匯出。合成測試中,9 則訊息被整理為 6 組,所有原文均可還原;工具不會刪除、傳送或封存訊息。模型檔下載並驗證後,推理會在用戶的 CPU 上執行,無需 API key 或雲端推理服務。
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady.
What I Built
Steady Inbox is a small local-AI tool for the repetitive part of inbox review: noticing when several messages are really about the same thing. You paste one message per line, and it proposes semantic groups while keeping every original visible and exportable.
The project follows the challenge's “Slow and Steady” theme by reducing a pile of repeated reminders to a shorter review queue. It does not delete, send, archive, or act on a message. The person reviewing the results stays in control.
In my synthetic demonstration, 9 messages became 6 review groups and all 9 originals remained recoverable. That is a functional test result, not a claim about production-scale accuracy or guaranteed time savings.
Demo
Watch the verified 64-second browser demonstration.
The reproducible demonstration uses only synthetic messages: two pull-request reminders, two milk reminders, two meeting-time notes, two database-backup reminders, and one Wi-Fi notice. It shows the empty state, input validation, local grouping, an expanded two-message group, the reviewed control, and Markdown export availability.
Local reproduction:
py -3.12-64 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.lock
.\.venv\Scripts\python.exe setup_model.py
.\.venv\Scripts\python.exe app.py --port 8797
Then open http://127.0.0.1:8797/ and choose Try an example followed by Make a steady digest.
Code
github.com/shivammusic/steady-inbox
The repository will include the application, pinned direct and tested dependency lists, model manifest and hashes, automated tests, MIT license, and third-party notices. Model weights are intentionally not committed.
How I Built It
The application is a Python 3.12 HTTP service with a dependency-free browser interface. It uses:
-
sentence-transformers/all-MiniLM-L6-v2at pinned revision1110a243fdf4706b3f48f1d95db1a4f5529b4d41; - Hugging Face Tokenizers 0.22.1 for the pinned tokenizer;
- ONNX Runtime 1.23.2 for CPU inference;
- NumPy 2.3.3 for attention-mask-aware mean pooling, L2 normalization, and cosine similarity.
Each non-empty line receives a 384-dimensional embedding. The grouping rule is conservative complete-link clustering: every pair of messages in a proposed group must meet the chosen cosine-similarity threshold. That prevents A and C from being joined only because each resembles B. A group representative is one of the original messages—the item with the best average within-group similarity—rather than a generated summary.
The model input is capped at 256 tokens, but the application keeps the complete source text and flags truncation. Inputs are capped at 100 messages and 1,500 characters per message.
I verified the implementation with:
.\.venv\Scripts\python.exe -m unittest -v
node --check static\app.js
All 10 Python tests passed on Windows 11. They cover real model inference, normalized 384-dimensional vectors, semantic paraphrases, unrelated notes, duplicate inputs, complete source preservation, truncation reporting, validation, and protection against similarity chaining. The JavaScript syntax check also passed.
Why Does Open Innovation Matter?
The open-weight model is the feature, not decoration around a hosted API. Once its pinned files have been downloaded and verified, inference runs on the user's CPU. That gives someone a meaningful choice about where their pasted text is processed and lets a developer inspect or replace the tokenizer, weights, pooling logic, threshold, or grouping strategy.
Steady Inbox does not need an API key, usage billing, or a cloud inference service. Its interface loads no third-party scripts, and its server binds to 127.0.0.1. Notes are held in browser memory and the local request; the app does not automatically write them to disk. Those choices do not make it a secure-erasure tool—browser state and operating-system memory still exist—and an initial network connection is required to download the pinned model files.
The Lazy Payoff
The measured synthetic run reduced 9 lines to 6 groups for review while preserving all 9 originals. Three repeated items were grouped. I did not run a timed human baseline, so I am not claiming a number of minutes saved.
The smaller payoff may be more important: the app proposes structure but never hides the evidence. A reviewer can expand a group, see exactly which original lines produced it, mark it reviewed, and export a Markdown digest.
來源:DEV Community · dev.to