跳到正文
DEV Community· parteek yadav·· 3 小時前AI 評分45

Sloth Sort:少整理一點,多留白一點

Sloth Sort: a little less sorting, a little more nothing

AI 導讀

Sloth Sort 以開源嵌入模型為筆記和連結描述建議分組,讓用戶整理稍後閲讀的內容時有個起點。預設 0.60 閾值下,15 條合成筆記分成 3 組各含兩條筆記,另有 9 條單獨成組;分組可手動調整,結果亦可匯出為 Markdown。模型在本機推理,載入時會從外部資源供應商下載約 46 MB,筆記不會傳送給供應商。

正文

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

What I Built

A saved-for-later pile can become a collection of good intentions: notes, article links, little reminders, and ideas that do not have a folder yet. Categorizing them can become another task to postpone.

Sloth Sort tackles that first sorting pass. Paste one note or described link per line, explicitly load a small open embedding model, and ask it to suggest groups of similar ideas. Then rename a group, move a note, leave it ungrouped, or export the result as Markdown.

The payoff is reducing repeated manual categorization—not claiming that every note needs a perfect filing system. The app gives you a starting arrangement instead of asking you to compare everything yourself. I have not run a timing study or tested it with real users, so I cannot honestly claim minutes saved.

For “Slow and Steady,” I wanted the experience to feel unhurried too: muted greens, a sleepy CSS sloth, and no notifications, account setup, or automatic filing. Sometimes leaving a note alone is the right answer.

Demo

Open Sloth Sort

Try the included 15-note synthetic sample. Click Load AI, then Find their cozy corners. At the default 0.60 threshold, the observed local model run produced three two-note groups and nine singletons: 12 groups altogether.

Each multi-note group shows its weakest pairwise cosine similarity. Try renaming one, moving a note with the select control, or leaving it as a single note. Changing the threshold regroups the notes and resets manual names and moves; the interface warns about that.

Pasted links are only text. Sloth Sort never opens their pages, so add your own description rather than expecting it to understand an article from its URL.

Code

Source on GitHub

The original app is MIT licensed. It uses vanilla JavaScript, CSS, and HTML, with a small Node server for local development and no build step. The repository includes tests, the synthetic sample, saved inference outputs, model attribution, and full upstream license and runtime notice texts. Model weights and runtime binaries are not bundled.

How I Built It

The embedding pipeline uses Transformers.js 3.7.2 and Xenova/all-MiniLM-L6-v2 at revision 751bff37182d3f1213fa05d7196b954e230abad9, running q8 inference through WASM. Mean-pooled embeddings are normalized before comparing their cosine similarity.

The important design choice is complete-link grouping. Imagine note A is similar to B, and B is similar to C, but A and C are quite different. A chaining approach could pull all three together. Sloth Sort merges two groups only when every cross-pair meets the chosen threshold. If A and C fall below it, that three-note merge cannot happen. Showing the weakest pair makes this rule visible rather than mysterious.

It is deliberately conservative, not magically correct. In the real local inference run, the related sourdough notes stayed separate at 0.60. The model can miss useful connections, and the threshold is a control—not a probability or guarantee. Initial names are neutral “Nest” numbers, not AI-invented topic claims. Human moves can override the grouping, with below-threshold evidence labeled.

There are 17 passing pure-logic tests, using synthetic vectors to check parsing, limits, normalization, anti-chaining, singleton retention, determinism, and safe export. Separately, actual WASM inference on the 15 synthetic notes produced finite, normalized 384-dimensional embeddings. Those are different kinds of evidence.

The deployed browser workflow was tested too: AI loading and sample grouping succeeded, a nest was renamed, a note was separated manually, and the downloaded Markdown was checked. That test also caught a module-import problem; switching to the self-contained browser bundle and versioning the app asset fixed it. This verifies one browser workflow, not universal compatibility.

An illustrative pair analysis used AI-assisted, manually specified categories formalized after inspecting the output. At 0.60, three same-category pairs grouped, nine stayed apart, and no cross-category pairs grouped. These are post-hoc sample observations, not held-out accuracy validation. The default was not tuned against those labels.

Privacy also shaped the design. Loading AI explicitly downloads roughly 46 MB from external asset providers, which receive ordinary network metadata—not the notes. There is no telemetry or app persistence. Notes remain in page memory; pasted text is rendered safely, and oversized input errors rather than silently truncating.

AI assistance disclosure: Strawberry Browser’s AI coding companion substantially designed and wrote the interface, implementation, tests, documentation, and this post, and executed the local logic and model smoke tests. My role has been learning from and reviewing that work and directing the project—not manually authoring every line. The in-app embedding model represents text; it does not generate group titles. AI assistance is part of the process, not something I want to hide behind “I built it.”

Why Does Open Innovation Matter?

An open model makes this small experiment possible without sending the note pile to a hosted inference API. Open tooling and pinned versions also make it easier to inspect the grouping rule, reproduce the sample, question the results, or replace a component.

Openness does not remove mistakes. It makes the trade-offs easier to see and change. For Sloth Sort, that means a useful first pass, visible uncertainty, and permission to leave things unsorted.

來源:DEV Community · dev.to