<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lukasz Snopkiewicz</title>
    <description>The latest articles on DEV Community by Lukasz Snopkiewicz (@lukasz_snopkiewicz_0d1bab).</description>
    <link>https://dev.to/lukasz_snopkiewicz_0d1bab</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2999212%2F42f6daf5-a09e-4361-8d6a-40e703e808c6.png</url>
      <title>DEV Community: Lukasz Snopkiewicz</title>
      <link>https://dev.to/lukasz_snopkiewicz_0d1bab</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lukasz_snopkiewicz_0d1bab"/>
    <language>en</language>
    <item>
      <title>Lantern Archive: find a remembered story in its original words</title>
      <dc:creator>Lukasz Snopkiewicz</dc:creator>
      <pubDate>Thu, 29 Oct 2026 22:36:41 +0000</pubDate>
      <link>https://dev.to/lukasz_snopkiewicz_0d1bab/lantern-archive-find-a-remembered-story-in-its-original-words-324o</link>
      <guid>https://dev.to/lukasz_snopkiewicz_0d1bab/lantern-archive-find-a-remembered-story-in-its-original-words-324o</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week4-2026-10-26"&gt;Hacktoberfest Open-Source AI Challenge: Ghost in the Machine&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Lantern Archive is a small offline search tool for letters, journals and notes.&lt;br&gt;
You can remember the meaning of a story without remembering the words that&lt;br&gt;
would find it. Lantern uses an open embedding model to connect a question to&lt;br&gt;
the relevant passage, then shows the original words and where to find them.&lt;/p&gt;

&lt;p&gt;In the included fictional archive, “Who fixed the broken timepiece?” finds&lt;br&gt;
Elsie's repair of the station clock. “What gave the homemade loaf its citrus&lt;br&gt;
fragrance?” finds the letter about orange peel rubbed into sugar.&lt;/p&gt;

&lt;p&gt;The “ghost” is a trace already present in the source: a small detail waiting to&lt;br&gt;
be found again. Every result includes its file and line numbers so the reader&lt;br&gt;
can return to the full story.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/soundcake/lantern-archive-hacktoberfest-20261029/blob/main/demo/walkthrough.mp4" rel="noopener noreferrer"&gt;Watch the 48-second walkthrough&lt;/a&gt; · &lt;a href="https://github.com/soundcake/lantern-archive-hacktoberfest-20261029/blob/main/demo/transcript.txt" rel="noopener noreferrer"&gt;Read the exact search results&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The walkthrough shows three searches against four fictional letters. Its&lt;br&gt;
captions come from an actual local inference run. The saved JSON and transcript&lt;br&gt;
are included alongside the video in the repository's &lt;code&gt;demo/&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;To run the same demonstration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm ci
npm run setup:model
npm run demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Setup downloads the pinned model once. The demonstration then disables fetch&lt;br&gt;
requests while the model loads, indexes the archive and searches it. This run&lt;br&gt;
recorded zero attempted requests.&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/soundcake/lantern-archive-hacktoberfest-20261029" rel="noopener noreferrer"&gt;Source code and setup instructions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The repository contains the CLI, source-indexing logic, a model setup script,&lt;br&gt;
fictional example letters, tests and the recorded demonstration. The app and&lt;br&gt;
examples use the MIT license.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node src/cli.mjs index examples/letters memories.lantern.json
node src/cli.mjs ask memories.lantern.json &lt;span class="s2"&gt;"Who fixed the broken timepiece?"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;Lantern runs &lt;a href="https://huggingface.co/Xenova/all-MiniLM-L6-v2" rel="noopener noreferrer"&gt;Xenova's quantized all-MiniLM-L6-v2 model&lt;/a&gt;&lt;br&gt;
through &lt;a href="https://github.com/huggingface/transformers.js" rel="noopener noreferrer"&gt;Transformers.js&lt;/a&gt;.&lt;br&gt;
The model builds on the &lt;a href="https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2" rel="noopener noreferrer"&gt;Sentence Transformers all-MiniLM-L6-v2&lt;/a&gt;&lt;br&gt;
sentence-embedding work. The model weights and Transformers.js use Apache-2.0.&lt;br&gt;
The code pins both the model revision and the library version.&lt;/p&gt;

&lt;p&gt;Documents are split into passages with their original character offsets and&lt;br&gt;
line numbers. Each passage becomes a 384-dimensional vector. A question becomes&lt;br&gt;
another vector, and cosine similarity selects up to three passages above a&lt;br&gt;
threshold. Returned text comes directly from those source passages.&lt;/p&gt;

&lt;p&gt;Source SHA-256 hashes are checked before each search. If a document changes,&lt;br&gt;
Lantern asks for a rebuilt index, keeping quotations and line references tied&lt;br&gt;
to the current document. An explicit no-match result handles questions whose&lt;br&gt;
scores fall below the threshold.&lt;/p&gt;

&lt;p&gt;Nine core tests pass, covering quotation accuracy, line references, changed&lt;br&gt;
sources, passage splitting, ranking, no-match behavior and index handling. A&lt;br&gt;
separate real-model test passes four paraphrase searches with fetch disabled.&lt;br&gt;
The demonstration indexed twelve passages in 23 ms and answered its three&lt;br&gt;
queries in 1.6–3.8 ms each on macOS arm64; the saved report records the runtime&lt;br&gt;
and measurements for this small archive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;A personal archive can outlast the service used to create it. Open weights let&lt;br&gt;
Lantern search locally, without a hosted inference account or a subscription.&lt;br&gt;
The model, its revision and the retrieval code are available for inspection.&lt;br&gt;
Someone can repeat the same experiment, change the threshold or replace the&lt;br&gt;
model as their archive grows.&lt;/p&gt;

&lt;p&gt;That matters for the theme: keeping a story accessible includes keeping the&lt;br&gt;
tools needed to find it accessible. Lantern brings an old passage back into&lt;br&gt;
view, with its original wording intact.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
  </channel>
</rss>
