跳到正文
DEV Community· Jac Ada·· 2 小時前AI 評分43

Echoes, With Evidence:以本機 AI 搜尋故事的紀念檔案庫

Echoes, With Evidence: a browser-sized ofrenda for stories worth keeping

AI 導讀

Echoes, With Evidence 是一個以瀏覽器運作、優先本機處理的紀念檔案庫,用戶可按感受、圖像或概念搜尋故事,並查看完整來源卡。它以 Xenova/all-MiniLM-L6-v2 和 Transformers.js 3.8.1 在裝置上執行推理,搜尋資料不會傳送至伺服器;首次載入需下載約 23 MB 模型權重及相關檔案。八個示範故事均屬虛構,系統不會改寫檢索到的故事。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

What I Built

A remembered person can be a whole room: a radio playing during a blackout, orange peel on a kitchen table, a hand letting go of a bicycle saddle. Finding those moments should not require remembering the exact words used to describe them.

Echoes, With Evidence is a small, local-first remembrance archive. You keep short stories on a table of illustrated cards, then search by a feeling, image, or idea. An open model finds related stories. Each result leads back to the words that were saved, with a title, person, date, and full source card.

The theme led me toward a virtual ofrenda: candlelight, marigolds, and objects carrying traces of a life. The AI's role is to help us find those traces. It does not generate a remembered person's voice or add events to a story.

The eight starter stories describe an entirely fictional community. They are demonstration material, clearly labeled throughout the interface. They are not accounts of my family or anyone else's real memories.

Demo

Open Echoes, With Evidence

Try this small walkthrough:

  1. Click Load local AI. The page explains the download before starting it: approximately 23 MB of model weights, plus tokenizer and browser runtime files.
  2. Once the model is ready, search for “being brave while learning to balance”.
  3. Follow the result to The blue bicycle lesson and open its source card. Read Nia's hand on the saddle, the moment she lets go, and the yellow raincoat at the far gate.
  4. Add a fictional memory of your own, then export the archive as JSON.

The distinction between modes is visible. Before the model loads, search is labeled Keyword matching · NOT AI. A failed download leaves that mode available. The app never substitutes canned output and calls it inference.

Code

Source repository

The application, interface, CSS illustrations, and fictional stories were created for this challenge on 31 October 2026. The repository includes the original source, an MIT license, third-party notices, and instructions for serving the app with a static web server. There is no build step or paid inference service.

AI disclosure: The implementation, fictional stories, testing workflow, and this write-up were prepared by AI agents in Codex in response to my request. The article was generated by an agent, without human editing. No real personal memories were used.

How I Built It

The core is Xenova/all-MiniLM-L6-v2, an Apache-2.0 ONNX conversion of the Sentence Transformers model, running through Transformers.js 3.8.1. ONNX Runtime executes the quantized model with WebAssembly in a dedicated Web Worker.

The retrieval path is deliberately small:

saved title + story → local embedding → 384 numbers
search phrase      → local embedding → 384 numbers
                   → cosine similarity → three source cards

Mean pooling and normalization produce the vectors. The worker reuses its index until a card's relevant content changes. Requests are serialized, and the interface ignores obsolete results when an archive changes during a search. Rendering uses the saved text itself; the model cannot rewrite the passages it retrieves.

The UI uses ordinary HTML, CSS, and JavaScript modules. Stories stay in tab memory by default. Remembering an archive in browser storage is an explicit option, and JSON export provides a portable copy. Imports validate their structure and size. Imported story text is rendered as text rather than executable markup.

The local Chrome walkthrough ran the real WebAssembly model, produced 384-dimensional vectors, and ranked The blue bicycle lesson first for the balance query above, with cosine similarity 0.321. Opening the result showed the exact saved passage. This verifies the local browser path; it does not establish performance on every device.

A separate check ran the actual quantized model on Node CPU against eight handwritten retrieval cases. The expected source ranked first in seven. In one useful failure, “learning that mistakes can be undone one loop at a time” ranked the bicycle story above the intended knitting story. This tiny sanity check is not an accuracy benchmark; it shows why the full sources must remain easy to inspect.

The interface also warns that even an unrelated query has a nearest neighbor. Cosine similarity is a ranking signal, not a probability or a fact check. Short English memories suit this model best; long entries can exceed its input window, and nuanced references can be missed.

Why Does Open Innovation Matter?

For a memory archive, where the text travels is part of the product. Open weights and a browser inference runtime let the story and query remain on the device doing the search. No inference account, API key, or per-query payment is required.

There is still a network boundary to explain. The first AI load downloads assets from Hugging Face and jsDelivr. Those providers receive ordinary request metadata, such as an IP address. Story and query text are passed to the local worker, not included in those download requests. Browser caching may help later loads, but this version does not promise a completely offline installation. Optional local storage is also accessible to other people using the same browser profile.

Openness makes this boundary inspectable and changeable. A future maintainer can self-host the assets, replace the embedding model, or change the ranking method while keeping the plain-text archive. The stories can outlast the particular model chosen to help find them.

In the fictional rooftop story, Ren leaves the stars he cannot see blank on a drawing. That detail became the guiding rule for this project: keep a clear path to what was actually recorded, and leave room for what we do not know.

來源:DEV Community · dev.to