<?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: Karan Raj</title>
    <description>The latest articles on DEV Community by Karan Raj (@karan_raj_1899d579c759c1f).</description>
    <link>https://dev.to/karan_raj_1899d579c759c1f</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%2F1660667%2F2278e384-c7b6-4c5d-9c44-3268627dfb9a.png</url>
      <title>DEV Community: Karan Raj</title>
      <link>https://dev.to/karan_raj_1899d579c759c1f</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/karan_raj_1899d579c759c1f"/>
    <language>en</language>
    <item>
      <title>I Built a Haunted Terminal That Scares You Into Taking Breaks</title>
      <dc:creator>Karan Raj</dc:creator>
      <pubDate>Sat, 31 Oct 2026 17:12:52 +0000</pubDate>
      <link>https://dev.to/karan_raj_1899d579c759c1f/i-built-a-haunted-terminal-that-scares-you-into-taking-breaks-20lp</link>
      <guid>https://dev.to/karan_raj_1899d579c759c1f/i-built-a-haunted-terminal-that-scares-you-into-taking-breaks-20lp</guid>
      <description>&lt;p&gt;Every break reminder I have ever installed died the same death: a toast slid into the corner of the screen, I thought "in a minute", and that was that. The reminder was polite. Polite is ignorable.&lt;/p&gt;

&lt;p&gt;So for Hacktoberfest Week 4, whose theme is &lt;strong&gt;Ghost in the Machine&lt;/strong&gt;, I built the opposite: &lt;code&gt;haunt&lt;/code&gt;, a terminal ghost that interrupts you with a horror still, a whisper from a local model, and then refuses to give the screen back until you have stood up and looked at something that is not a monitor.&lt;/p&gt;

&lt;p&gt;It is deliberately a little mean. That is the health feature.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;Every few minutes (randomised, so you cannot brace for it), &lt;code&gt;haunt&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;asks a &lt;strong&gt;local open-weight model&lt;/strong&gt; to write one unsettling line and one concrete break instruction;&lt;/li&gt;
&lt;li&gt;slams a horror image, GIF, or video over your terminal;&lt;/li&gt;
&lt;li&gt;replaces it with a calm panel that holds a countdown while you breathe, stretch, and walk away;&lt;/li&gt;
&lt;li&gt;logs the break so &lt;code&gt;--stats&lt;/code&gt; can tell you how long you actually spent away from the screen.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ python3 haunt.py --demo

your last commit message was a whisper too.

[ a 90x28 frame of a haunted house at night, rendered in 24-bit colour ]

╭──────────────────────────────────────────────────────────────╮
│ the spirit releases you                                      │
│                                                              │
│ Stand up and roll your shoulders back five times.            │
│ The ghost will wait.                                         │
│                                                              │
│ ███████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░       │
│ 14s away from the screen                                     │
╰──────────────────────────────────────────────────────────────╯
  breathe in 4, hold 4, out 6. ctrl+c ends the haunting.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;When you quit, it prints the damage: &lt;code&gt;23 breaks, 46.0 minutes away from the screen&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;


&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
  T[randomised timer] --&amp;gt; O[local model&amp;lt;br/&amp;gt;llama3.2:3b via Ollama]
  O --&amp;gt; W[whisper + health tip]
  T --&amp;gt; A[Wikimedia Commons asset&amp;lt;br/&amp;gt;still, GIF or video]
  A --&amp;gt; C[local cache + attribution]
  A -. network down .-&amp;gt; P[procedural Pillow art]
  W --&amp;gt; R[ANSI half-block renderer]
  C --&amp;gt; R
  P --&amp;gt; R
  R --&amp;gt; B[calm break panel&amp;lt;br/&amp;gt;countdown + breathing]
  B --&amp;gt; L[break log]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;No graphics protocol, no browser, no image library in the terminal. Frames are downsampled with Pillow and printed as half-block cells, two vertical pixels per character, with 24-bit colour escapes:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;ansi_frame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cols&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;fitted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ImageOps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;convert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;RGB&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cols&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                          &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Resampling&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LANCZOS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fitted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tobytes&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;lines&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;top&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;cols&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
        &lt;span class="n"&gt;bottom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;cols&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
        &lt;span class="n"&gt;chunks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cols&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;top&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bottom&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
            &lt;span class="n"&gt;chunks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\x1b&lt;/span&gt;&lt;span class="s"&gt;[38;2;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;m&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
                &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\x1b&lt;/span&gt;&lt;span class="s"&gt;[48;2;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;m▀&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chunks&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\x1b&lt;/span&gt;&lt;span class="s"&gt;[0m&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The ghost itself is a prompt. The model returns JSON with three fields, and the app treats every field defensively, because a small model on a laptop will eventually return something strange:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are the ghost in the machine, haunting a developer&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s terminal to push them &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;away from the screen for their health. Reply with JSON keys whisper, health_tip, &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;theme. whisper: one eerie line under 110 characters, unsettling not gory, lowercase, &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;second person. health_tip: one concrete ergonomic break instruction under 110 &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;characters that makes the human leave the screen (eyes, posture, movement, water). &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;theme: exactly one of ghost, haunted-house, skeleton, cemetery, pumpkin, ofrenda.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ollama_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;health_tip&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;health_tip&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;choice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;FALLBACK_TIPS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If Ollama is missing, slow, or returns garbage, curated lines take over. The haunting never fails open into silence; it fails into a break, which is the point.&lt;/p&gt;

&lt;p&gt;The break panel is a loop with a progress bar and a countdown, not a notification:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;remaining&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seconds&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;remaining&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="n"&gt;bar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;█&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bar_width&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;remaining&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;seconds&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="nf"&gt;draw_panel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tip&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bar&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;remaining&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.12&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The only way past it is time, or &lt;code&gt;Ctrl+C&lt;/code&gt;, and &lt;code&gt;Ctrl+C&lt;/code&gt; still restores the terminal and prints your stats.&lt;/p&gt;
&lt;h2&gt;
  
  
  Where the horror comes from
&lt;/h2&gt;

&lt;p&gt;Assets are searched and downloaded from &lt;strong&gt;Wikimedia Commons&lt;/strong&gt; using the public MediaWiki API, filtered to images, animated GIFs, and WebM video, and cached locally in &lt;code&gt;~/.cache/haunt/assets&lt;/code&gt;. Every file keeps its artist and licence, which &lt;code&gt;python3 haunt.py --credits ghost&lt;/code&gt; prints:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ghost
  Apparition by Eugeniu Voinescu.jpg — Ruth Tillman (CC BY-SA 4.0)
  Athenodorus - The Greek Stoic Philosopher ... — Henry Justice Ford (Public domain)
  La bimba dal vestitino rosso.webm — Museo Italiano Dell'Immaginario Folklorico (CC BY-SA 4.0)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Commons rate-limits aggressively, so downloads retry with backoff and refuse anything over 12 MB. If the network is gone, the ghost paints its own scene with Pillow: a gradient night, fog, a silhouette house, glowing windows, a moon, scratch marks. &lt;code&gt;--offline&lt;/code&gt; never touches the network.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why open matters here
&lt;/h2&gt;

&lt;p&gt;This tool is supposed to change a habit, and habits fail when the tool fails. Open pieces are what make it keep working:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A local model means no key, no cost, and no data leaving the machine.&lt;/strong&gt; The whisper is generated by &lt;code&gt;llama3.2:3b&lt;/code&gt; through Ollama. I can run it on a plane, and nothing about my terminal or my work goes to a provider.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swappable models.&lt;/strong&gt; The prompt is the contract, not an SDK. &lt;code&gt;--model&lt;/code&gt; takes anything Ollama can serve, from a 1B model on a laptop to something larger.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline is a first-class mode.&lt;/strong&gt; If Commons is unreachable, procedural art and curated lines still produce a complete haunting. The health habit does not depend on a service that might disappear.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The media is genuinely reusable.&lt;/strong&gt; Public domain and Creative Commons assets, with attribution preserved and printable, instead of scraped images with unclear provenance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You can read all of it.&lt;/strong&gt; The renderer, the model call, the break loop: nothing is hidden behind a hosted API, so you can change how the ghost behaves or how long it holds you.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  A note on safety
&lt;/h2&gt;

&lt;p&gt;A scare tool has to be careful about being a scare tool. &lt;code&gt;--safe&lt;/code&gt; disables the audio and the single inverted-frame flash, and audio is off by default whenever you ask for safe mode. The flash is one slow pulse, not a strobe. The health advice is ordinary workplace ergonomics: 20-20-20, standing, movement, water, blinking, posture, wrists. It is not medical advice, and the ghost is not a doctor. It is just rude enough to make you stand up.&lt;/p&gt;
&lt;h2&gt;
  
  
  Run it
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/karan-2004/haunted-terminal
&lt;span class="nb"&gt;cd &lt;/span&gt;haunted-terminal
python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv .venv &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
ollama pull llama3.2:3b

python3 haunt.py &lt;span class="nt"&gt;--demo&lt;/span&gt;     &lt;span class="c"&gt;# one haunting now, short break&lt;/span&gt;
python3 haunt.py            &lt;span class="c"&gt;# haunt roughly every 5 to 9 minutes&lt;/span&gt;
python3 haunt.py &lt;span class="nt"&gt;--safe&lt;/span&gt;     &lt;span class="c"&gt;# no sound, no flash&lt;/span&gt;
python3 haunt.py &lt;span class="nt"&gt;--stats&lt;/span&gt;    &lt;span class="c"&gt;# how long you stayed away&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;It needs Python 3.10+, Pillow, requests, numpy, and Ollama. &lt;code&gt;paplay&lt;/code&gt;/&lt;code&gt;aplay&lt;/code&gt; are optional for the sound; &lt;code&gt;ffmpeg&lt;/code&gt; is optional for Commons videos. No login, no API keys, nothing to configure.&lt;/p&gt;

&lt;p&gt;MIT licensed. Built during the Hacktoberfest Open-Source AI Challenge Week 4 window, with the model running locally and the lights off.&lt;/p&gt;

&lt;p&gt;Here is the session where it was built, if you want to see the messy middle:&lt;/p&gt;


&lt;div class="ltag-agent-session"&gt;
  &lt;div class="agent-session-header"&gt;
    
    &lt;span class="agent-session-tool-icon-badge" title="OpenCode"&gt;
&lt;/span&gt;
    &lt;span class="agent-session-title"&gt;Building haunt: a haunted terminal that forces screen breaks&lt;/span&gt;
  &lt;/div&gt;

  &lt;div class="agent-session-scroll"&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;lets create a script that uses a opensource lightweight model to fetch the horror screens, gifs and videos and render it randomly in the terminal to scare the user randomly and make them move away from the screen. let the horror scenes educate users to take breaks and be considerate about the health&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Plan: a local open-weight model (Ollama llama3.2:3b) writes the whisper and the health tip, assets come from Wikimedia Commons (public domain / CC), Pillow renders frames as 24-bit colour half-blocks, and every scare ends in a forced calm break with a countdown. Check the machine first.&lt;/p&gt;

                &lt;/div&gt;
              &lt;div class="agent-session-tool-call"&gt;
                
                  &lt;span class="agent-session-chevron"&gt;▸&lt;/span&gt;
                  &lt;span class="tool-name tool-name-bash"&gt;bash&lt;/span&gt;
                    &lt;span class="tool-input-preview"&gt;python3 -V; which ollama ffmpeg chafa viu; python3 -c 'import PIL, requests'&lt;/span&gt;
                
                &lt;div class="agent-session-tool-detail"&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Input&lt;/div&gt;
                      &lt;pre class="agent-session-pre agent-session-terminal"&gt;&lt;code&gt;$ python3 -V; which ollama ffmpeg chafa viu; python3 -c 'import PIL, requests'&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Output&lt;/div&gt;
                      &lt;pre class="agent-session-pre"&gt;&lt;code&gt;Python 3.13.11; /usr/local/bin/ollama; /usr/bin/paplay; PIL 12.3.0; no ffmpeg, no chafa&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="agent-session-tool-call"&gt;
                
                  &lt;span class="agent-session-chevron"&gt;▸&lt;/span&gt;
                  &lt;span class="tool-name tool-name-bash"&gt;bash&lt;/span&gt;
                    &lt;span class="tool-input-preview"&gt;ollama list&lt;/span&gt;
                
                &lt;div class="agent-session-tool-detail"&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Input&lt;/div&gt;
                      &lt;pre class="agent-session-pre agent-session-terminal"&gt;&lt;code&gt;$ ollama list&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Output&lt;/div&gt;
                      &lt;pre class="agent-session-pre"&gt;&lt;code&gt;llama3.2:3b 2.0 GB&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="agent-session-tool-call"&gt;
                
                  &lt;span class="agent-session-chevron"&gt;▸&lt;/span&gt;
                  &lt;span class="tool-name tool-name-bash"&gt;bash&lt;/span&gt;
                    &lt;span class="tool-input-preview"&gt;curl Commons API for haunted/halloween media&lt;/span&gt;
                
                &lt;div class="agent-session-tool-detail"&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Input&lt;/div&gt;
                      &lt;pre class="agent-session-pre agent-session-terminal"&gt;&lt;code&gt;$ curl Commons API for haunted/halloween media&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Output&lt;/div&gt;
                      &lt;pre class="agent-session-pre"&gt;&lt;code&gt;Commons API returns jpegs, gifs and webm with license metadata; upload.wikimedia.org rate-limits at 429 without backoff&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;can browserbase screens be rendered via cmd through agent or model&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Yes, over CDP: Page.startScreencast or captureScreenshot frames rendered with a terminal image tool, or fed to a vision model. Live View is web-only. For this project the simpler path is local: Pillow half-block rendering, no browser needed, which also keeps it fully offline.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
              &lt;div class="agent-session-tool-call"&gt;
                
                  &lt;span class="agent-session-chevron"&gt;▸&lt;/span&gt;
                  &lt;span class="tool-name tool-name-write"&gt;write&lt;/span&gt;
                    &lt;span class="tool-input-preview"&gt;haunted-terminal/haunt.py&lt;/span&gt;
                
                &lt;div class="agent-session-tool-detail"&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Input&lt;/div&gt;
                      &lt;pre class="agent-session-pre highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;haunted&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;terminal&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;haunt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Output&lt;/div&gt;
                      &lt;pre class="agent-session-pre highlight python"&gt;&lt;code&gt;&lt;span class="mi"&gt;661&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="n"&gt;CLI&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Commons&lt;/span&gt; &lt;span class="n"&gt;asset&lt;/span&gt; &lt;span class="n"&gt;search&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;cache&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;retries&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;procedural&lt;/span&gt; &lt;span class="n"&gt;Pillow&lt;/span&gt; &lt;span class="n"&gt;fallback&lt;/span&gt; &lt;span class="n"&gt;art&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ANSI&lt;/span&gt; &lt;span class="n"&gt;half&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;block&lt;/span&gt; &lt;span class="n"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Ollama&lt;/span&gt; &lt;span class="n"&gt;oracle&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;curated&lt;/span&gt; &lt;span class="n"&gt;fallback&lt;/span&gt; &lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;WAV&lt;/span&gt; &lt;span class="n"&gt;scare&lt;/span&gt; &lt;span class="n"&gt;synth&lt;/span&gt; &lt;span class="n"&gt;via&lt;/span&gt; &lt;span class="n"&gt;numpy&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;paplay&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;calm&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt; &lt;span class="n"&gt;panel&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;countdown&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;breathing&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;stats&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="agent-session-tool-call"&gt;
                
                  &lt;span class="agent-session-chevron"&gt;▸&lt;/span&gt;
                  &lt;span class="tool-name tool-name-write"&gt;write&lt;/span&gt;
                    &lt;span class="tool-input-preview"&gt;README.md, LICENSE, requirements.txt, .gitignore&lt;/span&gt;
                
                &lt;div class="agent-session-tool-detail"&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Input&lt;/div&gt;
                      &lt;pre class="agent-session-pre"&gt;&lt;code&gt;README.md, LICENSE, requirements.txt, .gitignore&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Output&lt;/div&gt;
                      &lt;pre class="agent-session-pre"&gt;&lt;code&gt;MIT license, install and usage docs, safety notes, why-open section&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="agent-session-tool-call"&gt;
                
                  &lt;span class="agent-session-chevron"&gt;▸&lt;/span&gt;
                  &lt;span class="tool-name tool-name-bash"&gt;bash&lt;/span&gt;
                    &lt;span class="tool-input-preview"&gt;python3 -m py_compile haunt.py &amp;amp;&amp;amp; COLUMNS=80 LINES=24 python3 haunt.py --demo...&lt;/span&gt;
                
                &lt;div class="agent-session-tool-detail"&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Input&lt;/div&gt;
                      &lt;pre class="agent-session-pre agent-session-terminal"&gt;&lt;code&gt;$ python3 -m py_compile haunt.py &amp;amp;&amp;amp; COLUMNS=80 LINES=24 python3 haunt.py --demo --offline --no-model --safe --calm 2&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Output&lt;/div&gt;
                      &lt;pre class="agent-session-pre"&gt;&lt;code&gt;renders a procedural scene, prints the calm panel, logs the break, restores the terminal; exit 0&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="agent-session-tool-call"&gt;
                
                  &lt;span class="agent-session-chevron"&gt;▸&lt;/span&gt;
                  &lt;span class="tool-name tool-name-bash"&gt;bash&lt;/span&gt;
                    &lt;span class="tool-input-preview"&gt;build_assets('ghost','skeleton','pumpkin')&lt;/span&gt;
                
                &lt;div class="agent-session-tool-detail"&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Input&lt;/div&gt;
                      &lt;pre class="agent-session-pre agent-session-terminal"&gt;&lt;code&gt;$ build_assets('ghost','skeleton','pumpkin')&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Output&lt;/div&gt;
                      &lt;pre class="agent-session-pre"&gt;&lt;code&gt;3 assets per theme downloaded from Wikimedia Commons with CC/PD attribution; 429 handled by retry with backoff&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="agent-session-tool-call"&gt;
                
                  &lt;span class="agent-session-chevron"&gt;▸&lt;/span&gt;
                  &lt;span class="tool-name tool-name-bash"&gt;bash&lt;/span&gt;
                    &lt;span class="tool-input-preview"&gt;COLUMNS=100 LINES=30 python3 haunt.py --demo --safe --no-audio --calm 3&lt;/span&gt;
                
                &lt;div class="agent-session-tool-detail"&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Input&lt;/div&gt;
                      &lt;pre class="agent-session-pre agent-session-terminal"&gt;&lt;code&gt;$ COLUMNS=100 LINES=30 python3 haunt.py --demo --safe --no-audio --calm 3&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Output&lt;/div&gt;
                      &lt;pre class="agent-session-pre"&gt;&lt;code&gt;model returned whisper 'your code will consume you, if you don't look up soon' and tip 'stand up, stretch, and take a 5-minute walk outside with some water'&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;lets submit this idea&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Checked the HF26 Week 4 challenge, the DEV account link, and GitHub credentials. Wrote the files, published the repo, and staged the submission post with this session embedded.&lt;/p&gt;

                &lt;/div&gt;
              &lt;div class="agent-session-tool-call"&gt;
                
                  &lt;span class="agent-session-chevron"&gt;▸&lt;/span&gt;
                  &lt;span class="tool-name tool-name-bash"&gt;bash&lt;/span&gt;
                    &lt;span class="tool-input-preview"&gt;git init -b main &amp;amp;&amp;amp; git commit &amp;amp;&amp;amp; create repo via GitHub API &amp;amp;&amp;amp; git push&lt;/span&gt;
                
                &lt;div class="agent-session-tool-detail"&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Input&lt;/div&gt;
                      &lt;pre class="agent-session-pre agent-session-terminal"&gt;&lt;code&gt;$ git init -b main &amp;amp;&amp;amp; git commit &amp;amp;&amp;amp; create repo via GitHub API &amp;amp;&amp;amp; git push&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Output&lt;/div&gt;
                      &lt;pre class="agent-session-pre"&gt;&lt;code&gt;karan-2004/haunted-terminal public, README and haunt.py return 200&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;

  &lt;div class="agent-session-footer"&gt;
    &lt;span class="agent-session-meta"&gt;
        7 of 9 messages
          · some content was hidden by the author
    &lt;/span&gt;
  &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>hf26challenge</category>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Building a "Split-Brain" AI Trip Manager for the Backcountry 🏔️</title>
      <dc:creator>Karan Raj</dc:creator>
      <pubDate>Mon, 12 Oct 2026 05:10:52 +0000</pubDate>
      <link>https://dev.to/karan_raj_1899d579c759c1f/building-a-split-brain-ai-trip-manager-for-the-backcountry-3bk9</link>
      <guid>https://dev.to/karan_raj_1899d579c759c1f/building-a-split-brain-ai-trip-manager-for-the-backcountry-3bk9</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week1-2026-10-05"&gt;Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  WHAT I BUILT
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Trip-polama&lt;/strong&gt;, is a colloquial term used in TamilNadu, a mix Tamil and English which means shall we go for a trip. From the header itself we can get to understand that this application can make people get off their seats and go offline for few days to explore the nature and experience the thrill.&lt;/p&gt;

&lt;h2&gt;
  
  
  DEMO
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;🚀 Live Demo:&lt;/strong&gt; &lt;a href="https://trip-polama.onrender.com/" rel="noopener noreferrer"&gt;trip-polama.onrender.com&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  CODE
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;💻 GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/karan-2004/trip-polama" rel="noopener noreferrer"&gt;karan-2004/trip-polama&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🌟 What is trip-polama?
&lt;/h2&gt;

&lt;p&gt;Most trip planning apps are great until you actually start your trip. The moment you hit a remote trail or a hill station with zero signal, your app becomes a glorified brick. Maps stop loading, expense tracking requires a server, and coordinating with your group becomes a game of "who has the last bit of LTE?"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;trip-polama&lt;/strong&gt; is an offline-first, "split-brain" trip manager designed specifically for hikers, trekkers, and outdoor groups. The goal is simple: get people off the screen and into the world, with open-source AI at the core.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧠 The "Split-Brain" Architecture
&lt;/h2&gt;

&lt;p&gt;I realized that the tools you need &lt;em&gt;before&lt;/em&gt; a trip are fundamentally different from what you need &lt;em&gt;during&lt;/em&gt; one. Instead of a monolithic app, I built two specialized "brains":&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Online Brain (The Planner)
&lt;/h3&gt;

&lt;p&gt;When you have a connection, you need a powerhouse. The Online Brain uses larger open-weight models (like &lt;strong&gt;Gemma 4&lt;/strong&gt; or &lt;strong&gt;Llama 3&lt;/strong&gt;) equipped with online research tools. It performs source-backed research using Wikipedia and other resources to suggest waypoints, check permits, and build a realistic itinerary.&lt;br&gt;
Still need to work on the model to identify a better one which could infer budget and planning based on the current data available. It also needs to be fine tuned specifically for trip planning.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. The Local Brain (The Manager)
&lt;/h3&gt;

&lt;p&gt;Once you're offline, the brain shifts. The Local Brain is a lightweight system that lives entirely on your device. It handles the essentials with zero signal:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Offline Waypoints:&lt;/strong&gt; Mark your path and track visited stops.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expense Tracking:&lt;/strong&gt; A local ledger to track spending and calculate "who owes whom" without a database.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Photo Log:&lt;/strong&gt; Capture memories locally without worrying about cloud uploads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Buddy Check-ins:&lt;/strong&gt; Tracking last-known locations of group members.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Next Up" Suggestions:&lt;/strong&gt; Context-aware tips based on your device location, weather, and pace.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s still not a working model in deployment where I need to figure out an even more smaller model to accommodate in mobile and needs more fine tuning in order provide accurate and quick responses offline.&lt;/p&gt;
&lt;h2&gt;
  
  
  🛠️ How I Built It
&lt;/h2&gt;

&lt;p&gt;I chose a stack that prioritizes user control and offline reliability:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PWA (Vite + React + TS):&lt;/strong&gt; Built as a Progressive Web App so it installs on the home screen and works offline via service workers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dexie.js &amp;amp; IndexedDB:&lt;/strong&gt; All trip data, photos, and expenses are stored in the browser's IndexedDB. Your data stays on your device, not on a corporate server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MapLibre GL:&lt;/strong&gt; Used for high-performance map rendering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open-Weight AI:&lt;/strong&gt; Integrated via an Ollama/Groq adapter, ensuring the AI is inspectable and swap-able.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node.js &amp;amp; Render:&lt;/strong&gt; A lightweight gateway serves the frontend and manages the transition to larger online models.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  🚧 Challenges I Faced
&lt;/h2&gt;

&lt;p&gt;The biggest challenge was managing the "split" effectively. Ensuring that the chat history and trip context transitioned seamlessly between a massive online model (for planning) and a lightweight local logic (for managing) required a custom routing layer and a strict schema for AI actions. &lt;/p&gt;

&lt;p&gt;Another hurdle was the PWA's background GPS behavior—modern mobile browsers are aggressive about killing background processes, which I had to account for in the "buddy tracking" design.&lt;/p&gt;
&lt;h2&gt;
  
  
  📚 What I Learned
&lt;/h2&gt;

&lt;p&gt;This project taught me the power of &lt;strong&gt;local-first software&lt;/strong&gt;. In an era of "everything-as-a-service," building something that &lt;em&gt;intentionally&lt;/em&gt; doesn't need a server to be useful is a refreshing challenge. I also learned how to leverage open-weight models to create specialized roles (Planner vs. Manager) rather than relying on a single generic prompt.&lt;/p&gt;
&lt;h2&gt;
  
  
  🗺️ The Road Ahead
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;On-Device Intelligence:&lt;/strong&gt; Integrating &lt;strong&gt;WebLLM&lt;/strong&gt; to bring the "Manager" brain fully on-device.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline Maps:&lt;/strong&gt; Implementing &lt;strong&gt;PMTiles&lt;/strong&gt; for true offline map downloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;P2P Coordination:&lt;/strong&gt; Using &lt;strong&gt;WebRTC&lt;/strong&gt; for live buddy tracking without a central server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Privacy First:&lt;/strong&gt; Automatic metadata stripping for photos.&lt;/li&gt;
&lt;/ol&gt;


&lt;h3&gt;
  
  
  🤖 AI Agent Session
&lt;/h3&gt;

&lt;p&gt;Here is the transcript of the session where I deployed the app and drafted this post:&lt;/p&gt;


&lt;div class="ltag-agent-session"&gt;
  &lt;div class="agent-session-header"&gt;
    
    &lt;span class="agent-session-tool-icon-badge" title="OpenCode"&gt;
&lt;/span&gt;
    &lt;span class="agent-session-title"&gt;Building trip-polama: split-brain trip planning and protected Render deployment&lt;/span&gt;
      &lt;span class="agent-session-model-badge"&gt;openai/gpt-6.1-sol&lt;/span&gt;
  &lt;/div&gt;

  &lt;div class="agent-session-scroll"&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;lets plan the archietecture and how to proceed forward&lt;br&gt;
dont blindly urge to only submit a scrap&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Curated milestone summary: We chose a no-rush PWA build with persistent trip conversations, local-first IndexedDB storage, manual trip tools, open-model integration, and versioned architecture plans. Supabase authentication/sync, on-device inference and peer-to-peer coordination were planned rather than represented as implemented.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;lets have a plan copy within the repo with all versions of plan available, lets install specific skills within the repo to keep things smooth and lets maintain a memory bank to keep track of the project&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Curated milestone summary: Added versioned plans, repository agent rules, AGENTS.md, a maintained README and a memory bank. Built an npm-workspaces foundation with a React/TypeScript/Vite PWA, deterministic geographic and expense logic, Dexie repositories, tests and CI.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;lets go with the light theeme with natural skyblue, green colours to blend with nature&lt;/p&gt;

&lt;p&gt;add it to any design rules so that I dont need to reiterate&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Curated milestone summary: Implemented a light nature palette and persistent design rules. Added trip creation, expenses and settlement, waypoints, next-stop suggestions, and group check-ins. Replaced coordinate entry/display with device or map selection and human-readable location labels. Photos gained an image picker and actual getUserMedia camera capture, with previews and local Blob persistence.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;lets remove the locations options in photos and add stripping location metadata from the photo to plan whhich we can implement later&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Curated milestone summary: Removed photo geolocation requests, tags and location display. Existing image files were not rewritten. Embedded GPS/location-metadata stripping was explicitly added as deferred work; no claim was made that original uploads were already location-free.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;In the home page along with the trips section lets mainly focus on to a chat session per trip which needs to be the heart of the application where the model acts as the manager if the trip is already created or a planner if the trip is newly being added or being explored. Let the chat handle all the actions of the application along with the manual application usage.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Curated milestone summary: Made chat the primary home workspace. Exploratory chats persist before creation and become manager conversations after confirmed trip creation. Chat and manual tools share local records. Model actions use strict runtime schemas, scoped transactions, confirmation/dismissal, audit statuses and duplicate-execution protection.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;lets be clear that the planner needs to opt a big llm to access online resources and provide efficient planner and the local agents role is to manage the trip read/write all the data via chat and provide summary and quick responses.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Curated milestone summary: Implemented separate routes: a server-configured online planner with a bounded resource-tool loop, and a local Ollama manager. Existing conversations can explicitly switch to Research/Replan and back. Local failures never silently escalate to cloud inference. Online research uses Wikipedia, with optional Brave Search; credentials remain server-side.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;now we can test the model&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Curated testing summary: Live llama3.2:3b checks revealed malformed or unrelated action proposals, so response schemas and a one-action manager policy were tightened. The configured deepseek-v4.1-flash cloud model was denied with HTTP 402; after the user switched to gemma4:31b, live Wikipedia-backed research and gateway requests succeeded. Name-only creation also exposed incomplete action envelopes and fenced JSON. Added clarification examples, one bounded output correction and strict validation after removing only an outer JSON fence.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Before creation of trip lets suggest the spot in the destination and use that data to create waypoints for the trip.for any creation or updation confirmation dont use json structure rather just confirm the data. read only actions to local model should not ask any confirmations. lets test more on the local model on data retrieval including summary, quick responses and other actions. lets also add an icon to add photos via chat(multi select).&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div&gt;
                  &lt;div class="agent-session-text agent-session-text-collapse"&gt;
                    &lt;p&gt;Curated milestone summary: Added sourced nearby-place suggestions and selectable stop reviews, with selected waypoints saved atomically during trip creation. Confirmation cards show readable values rather than JSON. Read-only tools execute without approval; known short commands use deterministic local reads, while natural retrieval requests select a compact read tool and facts come from complete saved records. Added multi-photo chat previews and local album/history linkage without sending images to models. Expanded live local tests found hallucinated retrieval answers and later intermittent 90-second timeouts; the final expanded live run was interrupted and must not be described as all-green. Deterministic reads were accurate and fast.&lt;/p&gt;

                  &lt;/div&gt;
                  Show more
                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;lets change the app name to trip-polama&lt;br&gt;
from code base level to UI and every where&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Curated milestone summary: Renamed UI, page title, PWA, workspace packages/imports, source symbols, prompts and documentation to trip-polama. Preserved legacy database/preference IDs for saved-data compatibility. Rebrand verification passed 93 regression tests, typecheck, lint and production build. Created and pushed the public repository &lt;a href="https://github.com/karan-2004/trip-polama" rel="noopener noreferrer"&gt;https://github.com/karan-2004/trip-polama&lt;/a&gt;; master contains commit b8598b1. Actual environment credentials were excluded.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;create a new branch deployment and add those changes and commit&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div&gt;
                  &lt;div class="agent-session-text agent-session-text-collapse"&gt;
                    &lt;p&gt;Curated deployment summary: Created deployment from master and committed 9fdbc54, feat: prepare protected Render deployment. Added one Node production server for the built frontend/API, Render PORT binding on &lt;span class="agent-session-redacted"&gt;[REDACTED]&lt;/span&gt;, /healthz, production startup, shared demo sign-in with expiring Secure/HttpOnly/SameSite cookies, request budgets, safe static serving, render.yaml and deployment instructions. Verified 105 regression tests, typecheck, lint and PWA build; actual production-start smoke checks passed with synthetic secrets and no paid inference. At this checkpoint, deployment was committed locally but not pushed or provisioned on Render.&lt;/p&gt;

                  &lt;/div&gt;
                  Show more
                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;submit_agent_session&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Session preservation summary: This is a curated milestone record, not a complete verbatim transcript. Secrets, session cookies and private machine paths have been omitted. Remaining work includes actual Render deployment and browser/device verification, faster and consistently reliable local inference, Supabase identities/sync, WebLLM, peer-to-peer coordination, offline map downloads, photo metadata sanitization and measured test coverage. Shared demo access and in-memory request limits are not a full production account or durable spending-control system.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;

  &lt;div class="agent-session-footer"&gt;
    &lt;span class="agent-session-meta"&gt;
        22 of 24 messages
          · some content was hidden by the author
    &lt;/span&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;em&gt;Check out the repo and join me in building the future of private, autonomous outdoor exploration!&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I have used render for deployment which made my work much easier to take my project to the world. I would like to enter in render category.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I have used Gemma model through illama for the online brain for trip planner. I would also like to enter in this category.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
    <item>
      <title>TriageAgent: a fully local AI that triages support tickets for my dev team(HALF BAKED)</title>
      <dc:creator>Karan Raj</dc:creator>
      <pubDate>Sun, 04 Oct 2026 19:10:57 +0000</pubDate>
      <link>https://dev.to/karan_raj_1899d579c759c1f/triageagent-a-fully-local-ai-that-triages-support-tickets-for-my-dev-teamhalf-baked-159k</link>
      <guid>https://dev.to/karan_raj_1899d579c759c1f/triageagent-a-fully-local-ai-that-triages-support-tickets-for-my-dev-teamhalf-baked-159k</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-weekend-2026-10-01"&gt;Hacktoberfest Weekend Challenge: Build for a Friend&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;My dev team's biggest time-sink isn't writing code — it's triaging support tickets. Every morning someone reads a wall of messages, figures out which tickets we've already solved and which need a real engineer, and routes them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TriageAgent&lt;/strong&gt; does that automatically. You paste in our support chat log — no strict format, just messages that mention a ticket ID like &lt;code&gt;#123&lt;/code&gt; — and it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;groups&lt;/strong&gt; messages into ticket threads by their ticket ID,&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;builds a local index&lt;/strong&gt; of every past thread and of each developer's past work,&lt;/li&gt;
&lt;li&gt;for a new ticket, either &lt;strong&gt;writes a short internal note&lt;/strong&gt; to the support team (when a similar &lt;em&gt;resolved&lt;/em&gt; thread exists) or &lt;strong&gt;routes it to the right dev&lt;/strong&gt; based on whose past responses it most resembles,&lt;/li&gt;
&lt;li&gt;and prints &lt;strong&gt;case-based reports&lt;/strong&gt;: open tickets per dev, critical cases, and a full case list.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No cloud, no API keys, nothing leaves the machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;It runs as a CLI and a small web UI. Two real examples from the sample data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ python cli.py triage "#999 the login page crashes on Safari"
action: note
note: "Duplicate of #101. Fix applied: Safari-specific JS bug in login
       handler fixed in v2.3.1. Handled by: alice."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ python cli.py triage "#999 our webhook receiver is returning 500s"
action: route
assigned_dev: carol
reason: "A very similar ticket already exists (#108) but is still open,
         so I routed to 'carol' — their past work is closest."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmlvk7wt63f5a0h4jgxge.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmlvk7wt63f5a0h4jgxge.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;The whole thing is on GitHub:&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/karan-2004" rel="noopener noreferrer"&gt;
        karan-2004
      &lt;/a&gt; / &lt;a href="https://github.com/karan-2004/triage-agent" rel="noopener noreferrer"&gt;
        triage-agent
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;TriageAgent&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;A local, open-source support-ticket triage agent for a dev team. Point it at a
chat log; it groups messages into ticket threads, builds an index, then for any
new ticket it either &lt;strong&gt;writes a short internal note to the support team&lt;/strong&gt; (when
a similar resolved thread exists) or &lt;strong&gt;routes it to the developer&lt;/strong&gt; whose past
responses it most resembles. It also prints case-based reports (open tickets
per dev, critical cases, and a full case list).&lt;/p&gt;
&lt;p&gt;Built with local AI at its core (Ollama + open models). No data leaves your
machine.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;How it works&lt;/h2&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Ingest&lt;/strong&gt; — parse a free-form chat log, group messages by ticket ID
embed each thread (&lt;code&gt;nomic-embed-text&lt;/code&gt;), store in a local vector index. It
also builds one "profile" embedding per developer from every message they
wrote.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Triage&lt;/strong&gt; — embed the new ticket and search
&lt;ul&gt;
&lt;li&gt;if a past &lt;strong&gt;resolved&lt;/strong&gt; thread is similar enough (≥ threshold)…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/karan-2004/triage-agent" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


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

&lt;p&gt;The open-source AI is the point, so everything runs locally:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ollama&lt;/strong&gt; serving two open-weight models:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;nomic-embed-text&lt;/code&gt; — embeddings for similarity search,&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;llama3.2:1b&lt;/code&gt; — writes the internal notes.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Python&lt;/strong&gt; glue: a tiny numpy vector store (cosine similarity), a free-form chat-log parser that groups messages by ticket ID, and a simple RAG flow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streamlit&lt;/strong&gt; for the browser UI.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The flow: parse the chat log → embed each thread and each developer's profile → store locally. For a new ticket, embed it and search. If the best &lt;em&gt;resolved&lt;/em&gt; match clears a similarity threshold, the LLM drafts the note from that thread's resolution; otherwise it routes to the dev whose profile is closest.&lt;/p&gt;

&lt;p&gt;One detail I'm proud of: it only auto-notes from &lt;strong&gt;resolved&lt;/strong&gt; threads. An open duplicate gets routed instead of answered with a hallucinated fix — that alone cut the wrong answers to near zero. The suite of 26 pytest tests covers the parser, reports, store, and triage decisions.&lt;/p&gt;

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

&lt;p&gt;Support tickets are full of things you don't want on someone else's server: customer emails, login problems, billing details. Because Ollama and the models are open-weight, &lt;strong&gt;this all runs on a laptop with the Wi-Fi off&lt;/strong&gt; — the tickets never leave the machine.&lt;/p&gt;

&lt;p&gt;That's what a closed API wouldn't let us do. A hosted model means shipping every ticket thread to a vendor. An open stack let us:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;keep the data local&lt;/strong&gt; — no upload, no retention policy to worry about;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;swap models freely&lt;/strong&gt; — if we outgrow &lt;code&gt;llama3.2:1b&lt;/code&gt;, point &lt;code&gt;TRIAGE_CHAT_MODEL&lt;/code&gt; at a bigger model, no code change;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;run it for free&lt;/strong&gt; — no per-token bill for triaging our own backlog.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Open innovation isn't a nice-to-have here; it's the reason the tool is safe to point at real tickets. Hope we devs really needs to keeps the bugs not to fly onto third party server exposing its source. &lt;/p&gt;

&lt;p&gt;Also Context of tickets need to be shared between the devs so that anyone can respond to it at the earliest. This agent acts as the context manager with autonomous response generator.&lt;/p&gt;

&lt;p&gt;Honestly it is still half baked and untested in the real environment. Need to involve in several iterations to make it helpful for my friends. So let it be outside rewarding category.&lt;/p&gt;

&lt;p&gt;Credits: Opencode with Deepseek 4(helped to convert my idea into code)&lt;/p&gt;

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