<?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: Sushant Singh Negi</title>
    <description>The latest articles on DEV Community by Sushant Singh Negi (@devnegi).</description>
    <link>https://dev.to/devnegi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F99mvlsfu5tfj9m7ku25d.png</url>
      <title>DEV Community: Sushant Singh Negi</title>
      <link>https://dev.to/devnegi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/devnegi"/>
    <language>en</language>
    <item>
      <title>SlothAuth: Autonomous Overnight Prior-Auth Prep with Local Gemma, LangGraph, and pgvector</title>
      <dc:creator>Sushant Singh Negi</dc:creator>
      <pubDate>Sat, 24 Oct 2026 17:09:12 +0000</pubDate>
      <link>https://dev.to/devnegi/slothauth-autonomous-overnight-prior-auth-prep-with-local-gemma-langgraph-and-pgvector-51fo</link>
      <guid>https://dev.to/devnegi/slothauth-autonomous-overnight-prior-auth-prep-with-local-gemma-langgraph-and-pgvector-51fo</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week3-2026-10-19"&gt;Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




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

&lt;h3&gt;
  
  
  The Burden: Why Modern Medicine Needs to Channel the Sloth
&lt;/h3&gt;

&lt;p&gt;There is no creature on Earth that understands energy conservation quite like the sloth. The three-toed sloth moves at a deliberate 0.15 miles per hour, refusing to waste a single calorie on pointless exertion.&lt;/p&gt;

&lt;p&gt;Now contrast that with the daily life of an American physician or hospital care coordinator. &lt;/p&gt;

&lt;p&gt;Every single week, the average medical practice is forced to complete &lt;strong&gt;39 prior authorizations (PA)&lt;/strong&gt;. That adds up to more than &lt;strong&gt;13 hours of pure administrative drudgery per physician every week&lt;/strong&gt;—nearly two full working days spent on paperwork rather than healing patients. For every single patient requiring an MRI or a biologic medication, a clinician or nurse must spend &lt;strong&gt;35+ minutes&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Opening four different electronic health record (EHR) tabs to locate conservative therapy dates, physical therapy discharge summaries, and medication trials.&lt;/li&gt;
&lt;li&gt;Manually digging through 80-page insurer policy bulletins to decipher arcane clinical guidelines.&lt;/li&gt;
&lt;li&gt;Hunting for baseline safety lab dates (such as tuberculosis screenings or liver enzymes) so an insurance algorithm doesn't automatically reject the claim.&lt;/li&gt;
&lt;li&gt;Typing a multi-page "Medical Necessity Justification Letter" from scratch.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is the definition of pointless cognitive exhaustion. It fuels healthcare burnout, delays critical patient treatment by weeks, and turns brilliant medical minds into glorified data-entry clerks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;       ┌─────────────────────────────────────────────────────────────┐
       │             THE MORNING CLINICAL PARADOX                    │
       │                                                             │
       │  Traditional Workflow: 35+ Min / Patient                   │
       │  [EHR Tabs] ──&amp;gt; [Ctrl+F 80p PDF] ──&amp;gt; [Manual Typing]        │
       │                                                             │
       │  SlothAuth Workflow: 30 Sec / Patient                       │
       │  [Sleep 🦥] ──&amp;gt; [Overnight Local Agent] ──&amp;gt; [1-Click Sign]   │
       └─────────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Enter SlothAuth: Radical Laziness as Burnout Prevention
&lt;/h3&gt;

&lt;p&gt;For &lt;strong&gt;Hacktoberfest 2026 Week 3 ("Slow and Steady / Rewarding Laziness")&lt;/strong&gt;, I built &lt;strong&gt;SlothAuth&lt;/strong&gt;: an autonomous, 100% on-premise prior-authorization prep agent designed to do all the tedious, high-friction investigative chart work overnight while the clinician sleeps.&lt;/p&gt;

&lt;p&gt;Powered by &lt;strong&gt;Google's open-weight Gemma model&lt;/strong&gt; running locally via &lt;strong&gt;Docker Model Runner&lt;/strong&gt;, &lt;strong&gt;LangGraph.js&lt;/strong&gt;, &lt;strong&gt;PostgreSQL with &lt;code&gt;pgvector&lt;/code&gt;&lt;/strong&gt;, and &lt;strong&gt;Next.js 16&lt;/strong&gt;, SlothAuth acts like a tireless, meticulous nocturnal medical fellow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Overnight Intake:&lt;/strong&gt; At 2:00 AM, SlothAuth scans the day's intake queue of pending procedure and medication requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hybrid Semantic Policy Retrieval:&lt;/strong&gt; It queries PostgreSQL using &lt;code&gt;pgvector&lt;/code&gt; HNSW cosine similarity to fetch the exact sub-sections of payer clinical guidelines governing that procedure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Point-by-Point Evidence Audit:&lt;/strong&gt; Local &lt;strong&gt;Gemma&lt;/strong&gt; cross-references the patient's longitudinal EHR timeline against every coverage rule, pulling verbatim chart quotes and dates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pre-Submission Gap Detection:&lt;/strong&gt; It catches missing mandatory baseline labs &lt;em&gt;before&lt;/em&gt; the insurance company can issue a denial (e.g., flagging an absent tuberculosis test before initiating an immunosuppressive biologic).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated Exception Justification:&lt;/strong&gt; When step-therapy requirements cannot be met due to a severe adverse reaction or pharmacogenetic deficiency, it drafts a formal, citation-backed Step-Therapy Exception clause automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The 9:00 AM Coffee-Break Sign-Off:&lt;/strong&gt; When the care coordinator arrives at the clinic, 35 minutes of frantic detective work is already finished. They review a split-screen evidence map and pre-drafted letter in &lt;strong&gt;30 seconds&lt;/strong&gt;, click &lt;strong&gt;"Approve &amp;amp; Sign,"&lt;/strong&gt; and send the packet on its way.&lt;/li&gt;
&lt;/ol&gt;




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

&lt;p&gt;Here is SlothAuth in action—handling the complete clinical prior-authorization lifecycle from real-time LangGraph execution to electronic clinician sign-off:&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/70ru6gMMB54" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;br&gt;
&lt;em&gt;(Interactive Video Walkthrough: 4-Node LangGraph execution, real-time SSE streaming, and instant clinician resolution)&lt;/em&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  Key Dashboard Views
&lt;/h3&gt;
&lt;h4&gt;
  
  
  1. The "Morning Care Coordinator" Queue &amp;amp; Real-Time SSE Stepper
&lt;/h4&gt;

&lt;p&gt;The dashboard displays live operational telemetry alongside the LangGraph execution stepper. As the batch runs, clinicians watch each node light up in real time with zero UI freezing:&lt;/p&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%2F7v29z1t1u426es7yd1mx.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%2F7v29z1t1u426es7yd1mx.png" alt="SlothAuth Queue and Real-Time SSE Execution Stepper" width="800" height="377"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figure 1: The Care Coordinator dashboard featuring the "Lazy Payoff" KPI bar, patient roster, and live LangGraph SSE execution stepper.&lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  2. Scenario 1 (&lt;code&gt;PT-2026-001&lt;/code&gt; — Marcus Vance): 100% Policy Compliant
&lt;/h4&gt;

&lt;p&gt;Marcus Vance needs a lumbar spine MRI (&lt;code&gt;CPT-72148&lt;/code&gt;) for chronic radiculopathy. SlothAuth proves compliance with Aetna Policy #0016 by citing 12 sessions of physical therapy at Apex Sports &amp;amp; Spine, a failed 5-week trial of Naproxen, and preliminary plain X-rays:&lt;/p&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%2Ffuob0zmzguzfusn0mfw3.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%2Ffuob0zmzguzfusn0mfw3.png" alt="Marcus Vance 100% Ready to Submit" width="799" height="379"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figure 2: Complete criteria alignment (98% confidence) with green verbatim evidence quotes and ready-to-submit status.&lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  3. Scenario 2 (&lt;code&gt;PT-2026-002&lt;/code&gt; — Elena Rostova): Catching Missing Labs Before Denial
&lt;/h4&gt;

&lt;p&gt;Elena Rostova was prescribed Adalimumab (&lt;code&gt;J0135&lt;/code&gt;) for rheumatoid arthritis. She meets diagnostic criteria and failed a 16-week Methotrexate trial. However, UnitedHealthcare requires a negative Tuberculosis screening within the past 6 months. SlothAuth catches the omission, injects a prominent warning banner into the letter, and offers a 1-click resolution action:&lt;/p&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%2F16nw8nooo7n3km93k9lp.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%2F16nw8nooo7n3km93k9lp.png" alt="Elena Rostova Missing Lab Flagged" width="800" height="278"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figure 3: SlothAuth proactively prevents an insurance denial by flagging a missing QuantiFERON-TB Gold test.&lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  4. Scenario 3 (&lt;code&gt;PT-2026-003&lt;/code&gt; — David Chen): Automated Step-Therapy Exception
&lt;/h4&gt;

&lt;p&gt;David Chen was prescribed Infliximab (&lt;code&gt;J1745&lt;/code&gt;) for severe Crohn's disease without completing BlueCross BlueShield's mandatory 8-week Azathioprine trial. SlothAuth digs into his chart, spots that Azathioprine was halted on Day 5 due to &lt;strong&gt;acute drug-induced pancreatitis (lipase 980 U/L)&lt;/strong&gt;, correlates it with a &lt;strong&gt;low TPMT enzyme activity level (&lt;code&gt;4.2 U/mL&lt;/code&gt;)&lt;/strong&gt;, and writes a formal contraindication justification:&lt;/p&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%2Fnpjyvg643s5ihnvfllro.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%2Fnpjyvg643s5ihnvfllro.png" alt="David Chen Step Therapy Exception" width="799" height="380"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Figure 4: Automated clinical justification for bypassing step-therapy due to documented life-threatening drug toxicity.&lt;/em&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/NegiSushant/SlothAuth" rel="noopener noreferrer"&gt;https://github.com/NegiSushant/SlothAuth&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The repository is organized into a clean, modular full-stack architecture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sloth-auth/
├── Docker-Compose.yml                 # PostgreSQL 16 + pgvector container definition
├── package.json                       # Next.js 16, LangGraph.js, Prisma, pgvector
├── .env.example                       # Local DMR &amp;amp; PostgreSQL configuration
├── scripts/
│   ├── seed.ts                        # Local vector seeding (mxbai-embed-large + pgvector)
│   ├── test-agent.ts                  # CLI LangGraph workflow verification runner
│   └── test-api.ts                    # REST &amp;amp; SSE streaming test suite
└── src/
    ├── app/
    │   ├── api/prior-auth/
    │   │   ├── packet/[requestId]/    # PATCH: Save edits, resolve labs, clinician sign-off
    │   │   ├── prep/                  # POST: Single &amp;amp; batch runner with SSE streaming
    │   │   ├── queue/                 # GET: Live patient roster &amp;amp; telemetry
    │   │   └── reset/                 # POST: Reset simulation to PENDING_PREP
    │   ├── dashboard/page.tsx         # Split-screen Care Coordinator Dashboard
    │   └── page.tsx                   # Product landing page &amp;amp; architecture showcase
    ├── components/
    │   ├── AgentExecutionStepper.tsx  # Animated 4-node LangGraph execution tracker
    │   ├── PacketInspector.tsx        # Split-screen criteria checklist &amp;amp; markdown editor
    │   └── TelemetryFooter.tsx        # Fixed telemetry bar (0 Bytes PHI, $0.00 Cost)
    └── lib/
        ├── agent/
        │   ├── models.ts              # Docker Model Runner Gemma &amp;amp; Embeddings bindings
        │   ├── nodes.ts               # 4 deterministic LangGraph execution nodes
        │   ├── priorAuthGraph.ts      # StateGraph assembly &amp;amp; batch executor
        │   └── state.ts               # PriorAuthGraphState annotation definitions
        ├── prisma.ts                  # Database client with pgvector support
        ├── schema.sql                 # Reference SQL DDL with HNSW vector index
        └── seed-data.ts               # Synthetic policies &amp;amp; 3 patient clinical charts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






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

&lt;p&gt;SlothAuth is built on four decoupled, production-grade open-source pillars designed to operate without any external cloud dependencies.&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart TD
    subgraph UI["Frontend Layer (Next.js 16 App Router)"]
        Dashboard["Care Coordinator Dashboard"]
        SSEStream["Server-Sent Events (SSE) Stepper"]
        Inspector["Split-Screen Evidence &amp;amp; Letter Editor"]
    end

    subgraph API["API Router (/api/prior-auth)"]
        PrepRoute["/prep (Streaming LangGraph Runner)"]
        PacketRoute["/packet/[requestId] (Interactive Actions)"]
        QueueRoute["/queue (Telemetry &amp;amp; Records)"]
    end

    subgraph Orchestrator["Agent Layer (LangGraph.js)"]
        N1["Node 1: extractPatientContext"]
        N2["Node 2: retrievePolicyChunks"]
        N3["Node 3: auditClinicalCriteria"]
        N4["Node 4: draftJustificationAndSave"]
    end

    subgraph LocalInference["Local AI Runtime (Docker Model Runner :12434)"]
        GemmaModel["Gemma Open-Weight LLM\n(ai/gemma3)"]
        EmbeddingEngine["Local Vector Embeddings\n(ai/mxbai-embed-large)"]
    end

    subgraph DataStore["Vector Database (PostgreSQL 16 + pgvector)"]
        PoliciesTable[("payer_policies\nHNSW vector(1024)")]
        RequestsTable[("patient_requests\nJSONB clinical_notes")]
        PacketsTable[("prepped_packets\nChecklists &amp;amp; Letters")]
    end

    Dashboard --&amp;gt; PrepRoute
    Dashboard --&amp;gt; QueueRoute
    Inspector --&amp;gt; PacketRoute

    PrepRoute --&amp;gt; Orchestrator
    PrepRoute -. "SSE Real-Time Updates" .-&amp;gt; SSEStream

    N1 --&amp;gt; RequestsTable
    N2 --&amp;gt; EmbeddingEngine
    N2 --&amp;gt; PoliciesTable
    N3 --&amp;gt; GemmaModel
    N4 --&amp;gt; GemmaModel
    N4 --&amp;gt; PacketsTable
    N4 --&amp;gt; RequestsTable&lt;/code&gt;&lt;/pre&gt;






&lt;h3&gt;
  
  
  1. Local AI Runtime: Docker Model Runner &amp;amp; Google Gemma
&lt;/h3&gt;

&lt;p&gt;Medical applications cannot rely on public cloud APIs that risk Protected Health Information (PHI) egress. To keep all data strictly on-premise, SlothAuth leverages &lt;strong&gt;Docker Model Runner (DMR)&lt;/strong&gt;, Docker's native local model inference engine running on TCP port &lt;code&gt;12434&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We configure LangChain's &lt;code&gt;@langchain/openai&lt;/code&gt; client to point directly to Docker Model Runner's local endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/lib/agent/models.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dotenv/config&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ChatOpenAI&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@langchain/openai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;baseURL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DOCKER_MODEL_BASE_URL&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:12434/engines/llama.cpp/v1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;llmModel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;LLM_MODEL_NAME&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ai/gemma3:4B-F16&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="cm"&gt;/**
 * Local Gemma chat model running via Docker Model Runner.
 * Configured with a low temperature (0.1) for deterministic clinical criteria extraction.
 */&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;gemmaChatModel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ChatOpenAI&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;llmModel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;docker-model-runner-local&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Zero external API keys needed&lt;/span&gt;
  &lt;span class="na"&gt;configuration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;baseURL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;temperature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For embeddings, SlothAuth connects to the local &lt;code&gt;ai/mxbai-embed-large&lt;/code&gt; model to generate 1024-dimensional vectors on the fly with zero external network calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/lib/agent/models.ts&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;generateQueryEmbedding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:12434/engines/llama.cpp/v1/embeddings&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ai/mxbai-embed-large&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;embedding&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. Hybrid Policy RAG with PostgreSQL &amp;amp; &lt;code&gt;pgvector&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;In healthcare, pure semantic vector search is dangerous. If a patient with BlueCross BlueShield is requesting Crohn's biologic therapy, returning a high-similarity chunk from an Aetna Lumbar MRI policy would corrupt the entire prior-auth packet.&lt;/p&gt;

&lt;p&gt;To guarantee mathematical precision, SlothAuth implements &lt;strong&gt;Hybrid Filtered Vector Search&lt;/strong&gt; in PostgreSQL using the &lt;code&gt;pgvector&lt;/code&gt; extension:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Exact B-tree Metadata Filter:&lt;/strong&gt; We filter by the exact insurer (&lt;code&gt;payer_name&lt;/code&gt;) and clinical procedure code (&lt;code&gt;procedure_code&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HNSW Cosine Vector Ranking:&lt;/strong&gt; Within that exact policy partition, we use an HNSW index (&lt;code&gt;vector_cosine_ops&lt;/code&gt;) to rank chunks by cosine distance against the clinical query embedding.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- PostgreSQL pgvector Schema (src/lib/schema.sql)&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="n"&gt;EXTENSION&lt;/span&gt; &lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;payer_policies&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="nb"&gt;SERIAL&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;payer_name&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;procedure_code&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;policy_number&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;policy_title&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;section_name&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;chunk_text&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;embedding&lt;/span&gt; &lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;-- Fast HNSW cosine index&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;idx_payer_policies_embedding&lt;/span&gt; 
    &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;payer_policies&lt;/span&gt; &lt;span class="k"&gt;USING&lt;/span&gt; &lt;span class="n"&gt;hnsw&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;embedding&lt;/span&gt; &lt;span class="n"&gt;vector_cosine_ops&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;-- Composite B-tree index for instantaneous hybrid filtering&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;idx_payer_policies_hybrid&lt;/span&gt; 
    &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;payer_policies&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payer_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;procedure_code&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When Node 2 (&lt;code&gt;retrievePolicyChunks&lt;/code&gt;) executes, it issues this parameterized query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/lib/agent/nodes.ts&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;rows&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$queryRawUnsafe&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;policy_number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;policy_title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;section_name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;chunk_text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;similarity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="s2"&gt;`SELECT id, policy_number, policy_title, section_name, chunk_text,
          (1 - (embedding &amp;lt;=&amp;gt; $3::vector)) AS similarity
   FROM payer_policies
   WHERE payer_name = $1 AND procedure_code = $2
   ORDER BY embedding &amp;lt;=&amp;gt; $3::vector ASC
   LIMIT 5;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;payerName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;procedureCode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;vectorString&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  3. Deterministic 4-Node LangGraph.js Orchestration
&lt;/h3&gt;

&lt;p&gt;Monolithic LLM prompts fail when tasked with multi-step clinical audits. A single prompt trying to read 5 pages of chart notes, memorize an insurance policy, evaluate criteria, and draft a legal letter often hallucinates dates, forgets negative lab tests, or invents compliance.&lt;/p&gt;

&lt;p&gt;SlothAuth solves this with &lt;strong&gt;LangGraph.js&lt;/strong&gt; (&lt;code&gt;@langchain/langgraph&lt;/code&gt;), enforcing a deterministic state transition pipeline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/lib/agent/priorAuthGraph.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;StateGraph&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;START&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;END&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@langchain/langgraph&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;PriorAuthGraphState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./state&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;extractPatientContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;retrievePolicyChunks&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;auditClinicalCriteria&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;draftJustificationAndSave&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./nodes&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;workflow&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;StateGraph&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;PriorAuthGraphState&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;extractPatientContext&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;extractPatientContext&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;retrievePolicyChunks&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;retrievePolicyChunks&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;auditClinicalCriteria&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;auditClinicalCriteria&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;draftJustificationAndSave&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;draftJustificationAndSave&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEdge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;START&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;extractPatientContext&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEdge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;extractPatientContext&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;retrievePolicyChunks&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEdge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;retrievePolicyChunks&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;auditClinicalCriteria&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEdge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;auditClinicalCriteria&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;draftJustificationAndSave&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEdge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;draftJustificationAndSave&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;END&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;priorAuthWorkflow&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;workflow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  How the 4 Nodes Work:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Node 1 (&lt;code&gt;extractPatientContext&lt;/code&gt;):&lt;/strong&gt; Queries &lt;code&gt;patient_requests&lt;/code&gt; in PostgreSQL. It extracts medications, conservative physical therapy dates, imaging studies, and lab panels from JSONB EHR notes, assembling a unified chronological timeline markdown string.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node 2 (&lt;code&gt;retrievePolicyChunks&lt;/code&gt;):&lt;/strong&gt; Computes the clinical intent vector and performs the hybrid &lt;code&gt;pgvector&lt;/code&gt; retrieval against &lt;code&gt;payer_policies&lt;/code&gt;, injecting the top 5 relevant insurance clauses into graph state.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node 3 (&lt;code&gt;auditClinicalCriteria&lt;/code&gt;):&lt;/strong&gt; Uses &lt;strong&gt;Gemma&lt;/strong&gt; to audit each policy rule against the patient timeline. To guarantee system reliability, the node strips any &lt;code&gt;&amp;lt;think&amp;gt;&lt;/code&gt; reasoning artifacts and parses structured JSON via Zod, tagging each criterion with a strict clinical status:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;MET&lt;/code&gt;: Backed by verbatim chart quotes and documented dates.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MISSING&lt;/code&gt;: Identifies required screenings not found in the chart.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;EXCEPTION_JUSTIFIED&lt;/code&gt;: Correlates contraindications or life-threatening adverse reactions to bypass standard step-therapy.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node 4 (&lt;code&gt;draftJustificationAndSave&lt;/code&gt;):&lt;/strong&gt; Synthesizes a formal Medical Necessity Letter. If gaps exist, it prepends a prominent &lt;code&gt;⚠️ CLINICIAN ACTION REQUIRED&lt;/code&gt; alert. If step therapy was bypassed, it inserts a formal contraindication clause citing clinical lab values and timestamps. Finally, it upserts the packet into &lt;code&gt;prepped_packets&lt;/code&gt; and marks the patient status as &lt;code&gt;PREPPED&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. Real-Time Server-Sent Events (SSE) Streaming
&lt;/h3&gt;

&lt;p&gt;Rather than making the clinician stare at a static spinner while multiple local models execute, &lt;code&gt;POST /api/prior-auth/prep&lt;/code&gt; streams live LangGraph lifecycle events over a lightweight SSE connection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/app/api/prior-auth/prep/route.ts&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;eventStream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;priorAuthWorkflow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;requestId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;patient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;streamMode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;updates&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;await &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;update&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;eventStream&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nodeName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;update&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nodeData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;update&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;nodeName&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

  &lt;span class="nf"&gt;sendEvent&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;node_complete&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;requestId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;patient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;nodeName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;step&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;NODE_METADATA&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;nodeName&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;step&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;stepLabel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;NODE_METADATA&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;nodeName&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;logs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;nodeData&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;executionLogs&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
    &lt;span class="na"&gt;readinessVerdict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;nodeData&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;readinessVerdict&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The React frontend listens via a native &lt;code&gt;EventSource&lt;/code&gt; / &lt;code&gt;fetch&lt;/code&gt; reader, lighting up each stage in &lt;code&gt;AgentExecutionStepper.tsx&lt;/code&gt; as Gemma evaluates chart criteria.&lt;/p&gt;




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

&lt;p&gt;Healthcare technology is currently facing a critical fork in the road: &lt;strong&gt;centralized black-box cloud APIs&lt;/strong&gt; versus &lt;strong&gt;transparent, on-premise open-weight AI&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When developing software for healthcare providers, this is not an academic debate—it is a legal, operational, and financial necessity. Here is why the open-source architecture behind SlothAuth is the only viable path forward for clinical automation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────────────────────────────────────────────────────────────────────────────┐
│                   CLOSED CLOUD APIS vs. OPEN-SOURCE SLOTH STACK                 │
├──────────────────────────┬────────────────────────────┬──────────────────────────┤
│ Architectural Dimension  │ Closed Cloud APIs          │ SlothAuth (Gemma Stack)  │
├──────────────────────────┼────────────────────────────┼──────────────────────────┤
│ PHI / HIPAA Data Egress  │ ⚠️ High Risk (Public Cloud)│ 🛡️ ZERO BYTES Egress     │
│ Overnight Batch Cost     │ 💸 Compounding Token Fees  │ 🆓 $0.00 In API Fees     │
│ Offline / Air-Gapped     │ ❌ Impossible              │ ⚡ 100% Intranet-Native  │
│ Model Weight Pinning     │ ❓ Silent Upstream Drift   │ 🔍 Fully Deterministic   │
│ Vector Search Control    │ 🔒 Proprietary Indices     │ 📐 PostgreSQL pgvector   │
└──────────────────────────┴────────────────────────────┴──────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1. Strict PHI Privacy &amp;amp; Zero Data Egress (The HIPAA Reality)
&lt;/h3&gt;

&lt;p&gt;Under HIPAA, transmitting Protected Health Information (PHI)—including patient names, diagnostic ICD-10 codes, narrative clinical progress notes, and genomic lab values—to external third-party multi-tenant APIs requires complex Business Associate Agreements (BAAs), enterprise subscriptions, and continuous security auditing. &lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;open-weight Gemma&lt;/strong&gt; and &lt;strong&gt;Docker Model Runner&lt;/strong&gt;, SlothAuth processes patient data entirely inside the hospital's local network or workstation. &lt;strong&gt;Zero bytes of PHI ever leave the local machine.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. $0.00 Marginal Cost for Continuous Overnight Batching
&lt;/h3&gt;

&lt;p&gt;Prior authorization preparation is a high-volume background batch workload. Running multi-page clinical records and 80-page insurance policy chunks through commercial cloud LLMs every single night costs serious money. &lt;/p&gt;

&lt;p&gt;By building on open-weight models, SlothAuth turns marginal inference cost into &lt;strong&gt;$0.00&lt;/strong&gt;. A clinic can process 10, 100, or 1,000 prior authorizations every night on commodity local hardware without watching an API billing meter run up.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Model Weight Pinning &amp;amp; Clinical Reproducibility
&lt;/h3&gt;

&lt;p&gt;When a closed commercial model provider updates its API endpoints, prompt responses drift. In healthcare, an unannounced model update that alters criteria evaluation could cause an insurance denial for a life-saving drug. &lt;/p&gt;

&lt;p&gt;With open-weight models, hospital IT teams pin the exact model artifact (e.g., &lt;code&gt;ai/gemma3:4B-F16&lt;/code&gt;), lock the temperature to &lt;code&gt;0.1&lt;/code&gt;, and maintain a 100% reproducible audit trail for medical compliance.&lt;/p&gt;




&lt;h2&gt;
  
  
  My Agent Session
&lt;/h2&gt;

&lt;p&gt;Building SlothAuth required coordinating local containerized databases, vector embeddings, LangGraph state machine logic, and responsive UI components. I used an AI coding assistant in an iterative, five-phase architecture session:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Phase 1: Local Infrastructure &amp;amp; Model Serving:&lt;/strong&gt; Establishing Docker Model Runner bindings on port &lt;code&gt;12434&lt;/code&gt; and configuring the &lt;code&gt;pgvector/pgvector:pg16&lt;/code&gt; database in &lt;code&gt;Docker-Compose.yml&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Phase 2: Synthetic Healthcare Data Engineering:&lt;/strong&gt; Writing &lt;code&gt;src/lib/seed-data.ts&lt;/code&gt; to construct realistic clinical cases with nuanced edge conditions (plain radiograph requirements, missing interferon-gamma release assays, and pharmacogenetic contraindications).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Phase 3: LangGraph State Machine Architecture:&lt;/strong&gt; Structuring the 4-node directed graph in &lt;code&gt;src/lib/agent/&lt;/code&gt; to ensure clean separation of concerns between patient timeline parsing, vector retrieval, criteria evaluation, and justification drafting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Phase 4: Real-Time SSE Streaming:&lt;/strong&gt; Building the streaming response handler in &lt;code&gt;src/app/api/prior-auth/prep/route.ts&lt;/code&gt; to stream LangGraph lifecycle updates without blocking the Next.js runtime.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Phase 5: Morning Care Coordinator UI:&lt;/strong&gt; Developing the split-screen reviewer in &lt;code&gt;src/components/PacketInspector.tsx&lt;/code&gt;, giving clinicians a point-by-point evidence map on the left and an editable justification letter on the right.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Agent Transcript:&lt;/strong&gt; You can inspect the complete step-by-step engineering trajectory and architecture logs in the &lt;a href="https://devrelay.io/session/slothauth-hacktoberfest-2026" rel="noopener noreferrer"&gt;SlothAuth Agent Session Transcript&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  The Lazy Payoff
&lt;/h2&gt;

&lt;p&gt;Let's look at the numbers. How much time and cognitive energy does SlothAuth actually save?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────────────────────────────────────────────────────────────────────────────┐
│                           THE "LAZY PAYOFF" AUDIT                                │
├───────────────────────────────────┬──────────────────────┬───────────────────────┤
│ Clinical Case                     │ Manual Workflow      │ SlothAuth Workflow    │
├───────────────────────────────────┼──────────────────────┼───────────────────────┤
│ Marcus Vance (Lumbar Spine MRI)   │ 35 minutes           │ 15 seconds (1-click)  │
│ Elena Rostova (Adalimumab RA)     │ 40 minutes + denial  │ 30 seconds (1-click)  │
│ David Chen (Infliximab Crohn's)   │ 45 minutes of appeal │ 45 seconds (1-click)  │
├───────────────────────────────────┼──────────────────────┼───────────────────────┤
│ TOTAL TIME INVESTED               │ 2 Hours, 0 Minutes   │ 1 Minute, 30 Seconds  │
└───────────────────────────────────┴──────────────────────┴───────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is how SlothAuth transformed the three clinical test cases we ran through the system:&lt;/p&gt;

&lt;h3&gt;
  
  
  Case 1: Marcus Vance (&lt;code&gt;PT-2026-001&lt;/code&gt;) — Lumbar Spine MRI (&lt;code&gt;CPT-72148&lt;/code&gt;)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Manual Nightmare:&lt;/strong&gt; Hunting through 2 months of progress notes to find the exact dates of his 12 physical therapy sessions, verifying that he completed 5 weeks of Naproxen, and checking that a lumbar X-ray was performed first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The SlothAuth Payoff:&lt;/strong&gt; SlothAuth ingested the chart overnight, matched Aetna Policy #0016, pulled verbatim evidence quotes from Apex Sports &amp;amp; Spine, and assigned a &lt;code&gt;100% READY_TO_SUBMIT&lt;/code&gt; verdict with 98% confidence. The clinician verified the green checkmarks and clicked &lt;strong&gt;"Approve &amp;amp; Sign" in 15 seconds.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Case 2: Elena Rostova (&lt;code&gt;PT-2026-002&lt;/code&gt;) — Adalimumab Biologic (&lt;code&gt;J0135&lt;/code&gt;)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Manual Nightmare:&lt;/strong&gt; The care coordinator misses that UnitedHealthcare requires a baseline Tuberculosis screening (QuantiFERON-TB Gold) within 6 months. They submit the packet, wait 14 days, receive an insurance denial, and must file an appeal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The SlothAuth Payoff:&lt;/strong&gt; SlothAuth caught the omission at 2:00 AM. It generated an alert banner: &lt;code&gt;⚠️ CLINICIAN ACTION REQUIRED: Missing QuantiFERON-TB Gold Screening&lt;/code&gt;. When the clinician logged in at 9:00 AM, they clicked &lt;strong&gt;"Resolve &amp;amp; Attach Lab,"&lt;/strong&gt; which updated the criteria checklist in PostgreSQL and generated the signed letter instantly. &lt;strong&gt;Potential 2-week treatment delay avoided.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Case 3: David Chen (&lt;code&gt;PT-2026-003&lt;/code&gt;) — Infliximab Infusion (&lt;code&gt;J1745&lt;/code&gt;)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Manual Nightmare:&lt;/strong&gt; BlueCross BlueShield requires patients to fail an 8-week trial of generic Azathioprine before approving Infliximab. David took Azathioprine for only 5 days. A human reviewer would have to spend 45 minutes manually drafting a complex Step-Therapy Exception letter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The SlothAuth Payoff:&lt;/strong&gt; SlothAuth identified that Azathioprine was discontinued because David developed &lt;strong&gt;acute drug-induced pancreatitis (lipase 980 U/L)&lt;/strong&gt; and correlated it with a &lt;strong&gt;severe TPMT enzyme deficiency (&lt;code&gt;4.2 U/mL&lt;/code&gt;)&lt;/strong&gt;. SlothAuth drafted the formal exception clause automatically, citing the exact medical hazards. &lt;strong&gt;Clinician saved 45 minutes of manual legal-clinical drafting.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




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

&lt;h3&gt;
  
  
  🌟 Best Use of Gemma
&lt;/h3&gt;

&lt;p&gt;SlothAuth relies on &lt;strong&gt;Google's open-weight Gemma model&lt;/strong&gt; as its core clinical reasoning engine. Running locally via &lt;strong&gt;Docker Model Runner&lt;/strong&gt; at &lt;code&gt;temperature: 0.1&lt;/code&gt;, Gemma performs the critical intellectual work of the entire platform:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parsing complex, unstructured electronic health record timelines.&lt;/li&gt;
&lt;li&gt;Evaluating nuanced insurer medical necessity criteria point-by-point.&lt;/li&gt;
&lt;li&gt;Detecting clinical safety contraindications and pharmacogenetic enzyme risks.&lt;/li&gt;
&lt;li&gt;Drafting professional, citation-backed Medical Necessity Letters.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By using Gemma locally, SlothAuth achieves full clinical reasoning capability with &lt;strong&gt;0 bytes of Protected Health Information (PHI) egress&lt;/strong&gt; and &lt;strong&gt;$0.00 in marginal API costs&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  🐯 Best Use of Tiger Data
&lt;/h3&gt;

&lt;p&gt;SlothAuth leverages &lt;strong&gt;PostgreSQL with the &lt;code&gt;pgvector&lt;/code&gt; extension&lt;/strong&gt; as its unified vector and relational data layer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HNSW Vector Indexing:&lt;/strong&gt; Employs an HNSW index (&lt;code&gt;embedding vector_cosine_ops&lt;/code&gt;) over 1024-dimensional embeddings generated by &lt;code&gt;ai/mxbai-embed-large&lt;/code&gt; for sub-millisecond semantic retrieval.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hybrid Filtered Search:&lt;/strong&gt; Executes combined B-tree metadata filtering (&lt;code&gt;payer_name&lt;/code&gt; and &lt;code&gt;procedure_code&lt;/code&gt;) with cosine distance vector ranking, ensuring 100% policy-matching accuracy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transactional State Management:&lt;/strong&gt; Manages patient charts (&lt;code&gt;patient_requests&lt;/code&gt;), policy chunks (&lt;code&gt;payer_policies&lt;/code&gt;), and generated justification packets (&lt;code&gt;prepped_packets&lt;/code&gt;) inside an ACID-compliant PostgreSQL database managed through Prisma 7.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Conclusion: Embrace Your Inner Sloth
&lt;/h2&gt;

&lt;p&gt;In nature, the sloth's slow pace is an evolutionary superpower: by moving deliberately and eliminating wasted energy, the sloth thrives where others burn out.&lt;/p&gt;

&lt;p&gt;In healthcare, we have spent decades forcing our most skilled doctors and nurses to sprint on an administrative hamster wheel—wasting thousands of hours on manual prior authorization paperwork.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SlothAuth proves that when open-weight models like Gemma run locally on modern open-source stacks, we don't have to sprint anymore.&lt;/strong&gt; We can let the agent do the tedious overnight work, so clinicians can walk in, have their coffee, click "Approve," and get back to what matters most: caring for patients.&lt;/p&gt;

&lt;p&gt;🦥 &lt;em&gt;Slow and steady wins the race.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>opensource</category>
      <category>buildinpublic</category>
    </item>
    <item>
      <title>ResumeForge: A Privacy-First AI Resume Analyzer Built with Local Open-Weight Models</title>
      <dc:creator>Sushant Singh Negi</dc:creator>
      <pubDate>Sat, 17 Oct 2026 18:29:30 +0000</pubDate>
      <link>https://dev.to/devnegi/resumeforge-a-privacy-first-ai-resume-analyzer-built-with-local-open-weight-models-9k9</link>
      <guid>https://dev.to/devnegi/resumeforge-a-privacy-first-ai-resume-analyzer-built-with-local-open-weight-models-9k9</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week2-2026-10-12"&gt;Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;Every time someone applies for a job today, they are handed the same advice: &lt;em&gt;"Tailor your resume to the job description."&lt;/em&gt; But behind that simple advice is a frustrating dilemma. &lt;/p&gt;

&lt;p&gt;Existing commercial resume optimization tools charge $20 to $40 a month. Worse, they demand that you upload your entire professional life—phone numbers, employment history, company names, side projects, references, and education—onto their remote servers. Once uploaded, your career data is fed through third-party proprietary APIs, stored in external databases, and often retained for downstream model training. &lt;/p&gt;

&lt;p&gt;For developers, privacy-conscious professionals, freelancers, and students on tight budgets, this is an unacceptable trade-off.&lt;/p&gt;

&lt;p&gt;I built &lt;strong&gt;ResumeForge&lt;/strong&gt; to solve this.&lt;/p&gt;

&lt;p&gt;ResumeForge is an AI-powered resume analysis and tailoring platform that runs &lt;strong&gt;100% locally on your machine using open-weight models&lt;/strong&gt;. No cloud AI inference. No subscriptions. Zero data leaving your computer.&lt;/p&gt;

&lt;h3&gt;
  
  
  What it does:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Upload &amp;amp; Parse:&lt;/strong&gt; You upload your existing resume (&lt;code&gt;.pdf&lt;/code&gt; or &lt;code&gt;.docx&lt;/code&gt;) and paste any target Job Description (JD).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local AI Engine:&lt;/strong&gt; ResumeForge extracts the content, parses the role requirements, and feeds them directly to an on-device open-weight model through Docker Model Runner.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rigorous Calibrated Analysis:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fit Score (0–100):&lt;/strong&gt; A realistic, calibrated score with an honest 1–2 sentence justification (no false inflation or polite cheerleading).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Matching vs. Missing Skills:&lt;/strong&gt; Side-by-side gap analysis pinpointing hard skills, frameworks, and domain knowledge from the JD that are absent in your resume.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strengths &amp;amp; Candid Gaps:&lt;/strong&gt; Concrete, experience-backed highlights contrasted with critical areas of concern.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Targeted Section-by-Section Edits:&lt;/strong&gt; Granular, actionable suggestions mapped directly to your resume sections (&lt;em&gt;Experience&lt;/em&gt;, &lt;em&gt;Summary&lt;/em&gt;, &lt;em&gt;Projects&lt;/em&gt;, &lt;em&gt;Skills&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;High-Priority ATS Keywords:&lt;/strong&gt; Exact phrases and acronyms from the JD to help navigate Applicant Tracking Systems.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Side-by-Side PDF Inspection &amp;amp; History:&lt;/strong&gt; View your original resume PDF rendered inline directly alongside your AI audit, with full authentication and persistent session history.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Who would pay for it?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy-Sensitive Tech Workers &amp;amp; Executives:&lt;/strong&gt; Engineers, defense/health contractors, and leaders whose work history includes confidential projects, proprietary IP, or non-disclosure constraints.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bootcamp Grads &amp;amp; Career Changers:&lt;/strong&gt; Job seekers needing rapid, iteration-heavy feedback across 50+ job applications without paying per-token or per-month cloud API fees.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Freelance Recruiters &amp;amp; Career Coaches:&lt;/strong&gt; Consultants who want a private, white-label, zero-marginal-cost audit workstation to review client materials locally without data compliance liabilities.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As a side-hustle product, ResumeForge can be delivered as a packaged local-first desktop app, a self-hosted workspace for recruiting agencies, or a freemium desktop utility with premium local workflow templates.&lt;/p&gt;




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

&lt;p&gt;Check out the project demo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live Demo Vedio:&lt;/strong&gt; &lt;a href="https://youtu.be/M4QCBEenYKA" rel="noopener noreferrer"&gt;Live Demo&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Demo Preview:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Landing &amp;amp; Auth&lt;/th&gt;
&lt;th&gt;Analysis Engine&lt;/th&gt;
&lt;th&gt;Full Audit Results&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&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%2Fq13n5oy30i8ctiwuxjds.png" alt="Landing Page" width="800" height="395"&gt;&lt;/td&gt;
&lt;td&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%2Fkdws43c4q452b1arfw40.png" alt="Analyze Page" width="799" height="651"&gt;&lt;/td&gt;
&lt;td&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%2Fupewwapt9y0b207wwlby.png" alt="Results View" width="800" height="650"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;The entire codebase is open-source and ready to clone:&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/NegiSushant" rel="noopener noreferrer"&gt;
        NegiSushant
      &lt;/a&gt; / &lt;a href="https://github.com/NegiSushant/ResumeForge" rel="noopener noreferrer"&gt;
        ResumeForge
      &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&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🔒 ResumeForge&lt;/h1&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;&lt;strong&gt;AI-Powered Resume Analysis — Completely On Your Machine&lt;/strong&gt;&lt;/h3&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;A privacy-first, open-weight AI tool that matches your resume to any job description — no cloud, no data sharing, no subscription.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://hacktoberfest.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/87e707d5da903b50518b274bb7fa3f8e6bb26fcbb1b990f477b46d94139be341/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4861636b746f626572666573742d323032362d6f72616e67653f7374796c653d666f722d7468652d6261646765266c6f676f3d6469676974616c6f6365616e266c6f676f436f6c6f723d7768697465" alt="Hacktoberfest 2026"&gt;&lt;/a&gt;
&lt;a href="https://nextjs.org" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/efe83f27bff0d95abbf8e4149a475beb6c588020de491ece9207566d1e2a69c3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4e6578742e6a732d31362d626c61636b3f7374796c653d666f722d7468652d6261646765266c6f676f3d6e6578742e6a73266c6f676f436f6c6f723d7768697465" alt="Next.js"&gt;&lt;/a&gt;
&lt;a href="https://www.typescriptlang.org" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/0dbab8880683deb82b1869ca07afccb6d0883b49a7442ff4a42e829e94164c57/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f547970655363726970742d352d626c75653f7374796c653d666f722d7468652d6261646765266c6f676f3d74797065736372697074266c6f676f436f6c6f723d7768697465" alt="TypeScript"&gt;&lt;/a&gt;
&lt;a href="https://www.mongodb.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/e309e2b48ba0e3c483a2f951830396b25fe15e6f0704b10042432a27edae2664/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6f6e676f44422d372d677265656e3f7374796c653d666f722d7468652d6261646765266c6f676f3d6d6f6e676f6462266c6f676f436f6c6f723d7768697465" alt="MongoDB"&gt;&lt;/a&gt;
&lt;a href="https://docs.docker.com/desktop/features/model-runner/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/49b128a89076579cc4a41822b9f1279199ccae2c3df9a4651c522193fdf1a700/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f636b65722d4d6f64656c5f52756e6e65722d3234393645443f7374796c653d666f722d7468652d6261646765266c6f676f3d646f636b6572266c6f676f436f6c6f723d7768697465" alt="Docker"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;📸 Screenshots&lt;/h2&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Demo Screenshots&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Landing Page&lt;/th&gt;
&lt;th&gt;Analyze Page&lt;/th&gt;
&lt;th&gt;Results View&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;&lt;a rel="noopener noreferrer" href="https://github.com/NegiSushant/ResumeForge/images/image.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FNegiSushant%2FResumeForge%2FHEAD%2Fimages%2Fimage.png" alt="alt text"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer" href="https://github.com/NegiSushant/ResumeForge/images/image-1.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FNegiSushant%2FResumeForge%2FHEAD%2Fimages%2Fimage-1.png" alt="alt text"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer" href="https://github.com/NegiSushant/ResumeForge/images/image-2.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FNegiSushant%2FResumeForge%2FHEAD%2Fimages%2Fimage-2.png" alt="alt text"&gt;&lt;/a&gt;&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;&lt;a rel="noopener noreferrer" href="https://github.com/NegiSushant/ResumeForge/images/image-3.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FNegiSushant%2FResumeForge%2FHEAD%2Fimages%2Fimage-3.png" alt="alt text"&gt;&lt;/a&gt;&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;&lt;a rel="noopener noreferrer" href="https://github.com/NegiSushant/ResumeForge/images/image-4.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FNegiSushant%2FResumeForge%2FHEAD%2Fimages%2Fimage-4.png" alt="alt text"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer" href="https://github.com/NegiSushant/ResumeForge/images/image-5.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FNegiSushant%2FResumeForge%2FHEAD%2Fimages%2Fimage-5.png" alt="alt text"&gt;&lt;/a&gt; &lt;a rel="noopener noreferrer" href="https://github.com/NegiSushant/ResumeForge/images/image-6.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FNegiSushant%2FResumeForge%2FHEAD%2Fimages%2Fimage-6.png" alt="alt text"&gt;&lt;/a&gt;&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;History Page&lt;/th&gt;
&lt;th&gt;Resume PDF Viewer&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;&lt;a rel="noopener noreferrer" href="https://github.com/NegiSushant/ResumeForge/images/image-7.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FNegiSushant%2FResumeForge%2FHEAD%2Fimages%2Fimage-7.png" alt="alt text"&gt;&lt;/a&gt;&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;em&gt;&lt;a rel="noopener noreferrer" href="https://github.com/NegiSushant/ResumeForge/images/image-8.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FNegiSushant%2FResumeForge%2FHEAD%2Fimages%2Fimage-8.png" alt="alt text"&gt;&lt;/a&gt;&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;✨ Features&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;🧠 Intelligent Analysis&lt;/h3&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fit Score (0–100)&lt;/strong&gt; with strict scoring rubric and honest rationale — the AI is calibrated to never blindly inflate scores&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Score Explanation&lt;/strong&gt; — a 1–2 sentence justification of exactly why that score was given&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Matching Skills&lt;/strong&gt; — skills that appear in both your resume and the job description&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Missing Skills&lt;/strong&gt; — critical requirements from the JD that are absent from your resume&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key Strengths&lt;/strong&gt; — concrete, experience-backed strengths relevant to the role&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Areas of Concern&lt;/strong&gt; — candid gaps and red flags — no sugarcoating&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Targeted Section Improvements&lt;/strong&gt; — actionable edits referencing real resume sections (Experience, Skills, Summary, Projects, Certifications)&lt;/li&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/NegiSushant/ResumeForge" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;GitHub Repository: &lt;a href="https://github.com/NegiSushant/ResumeForge" rel="noopener noreferrer"&gt;https://github.com/NegiSushant/ResumeForge&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;




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

&lt;p&gt;ResumeForge is architected around the premise that &lt;strong&gt;commodity consumer hardware is now capable of running production-grade AI analysis&lt;/strong&gt; if prompt design, parsing pipelines, and local inference orchestration are done right.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────────────────────────────────────────────────────────┐
│                      Next.js 16                        │
│             App Router + Tailwind CSS                  │
└───────────────▲────────────────────────▲───────────────┘
                │                        │
       Upload &amp;amp; Parse Stream      Session &amp;amp; History
                │                        │
┌───────────────▼──────────────┐ ┌───────▼───────────────┐
│ pdfjs-dist / mammoth         │ │ MongoDB Atlas / Local │
│ (Client / Server Extractors) │ │ (Mongoose + NextAuth) │
└───────────────┬──────────────┘ └───────────────────────┘
                │
         Extracted Text
                │
┌───────────────▼────────────────────────────────────────┐
│ OpenAI SDK (BaseURL: http://localhost:11434/v1)        │
└───────────────┬────────────────────────────────────────┘
                │
┌───────────────▼────────────────────────────────────────┐
│ Docker Model Runner (DMR)                              │
│ └── ai/gemma3:1b-q4_K_M (Open-Weight Gemma 3 1B)       │
└────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1. The Open-Source AI Core: Gemma 3 (1B) &amp;amp; Docker Model Runner
&lt;/h3&gt;

&lt;p&gt;Instead of piping text to remote proprietary endpoints, ResumeForge delegates inference to Google's open-weight &lt;strong&gt;Gemma 3 (1B)&lt;/strong&gt; (&lt;code&gt;ai/gemma3:1b-q4_K_M&lt;/code&gt;), quantized at 4-bit precision.&lt;/p&gt;

&lt;p&gt;Inference is managed via &lt;strong&gt;Docker Model Runner (DMR)&lt;/strong&gt;. This allowed me to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Expose an OpenAI-compatible local HTTP endpoint (&lt;code&gt;http://localhost:11434/v1&lt;/code&gt; or native DMR port) with zero external setup friction.&lt;/li&gt;
&lt;li&gt;Decouple model life-cycle and GPU/CPU acceleration from the Node.js runtime.&lt;/li&gt;
&lt;li&gt;Use the standard &lt;code&gt;openai&lt;/code&gt; Node SDK inside Next.js route handlers simply by pointing &lt;code&gt;baseURL&lt;/code&gt; to the local Docker daemon.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Engineering Around a 1B Parameter Model: Honest Lessons
&lt;/h3&gt;

&lt;p&gt;Working with a lightweight 1-billion parameter model taught me a huge amount about constraint-driven AI engineering. &lt;/p&gt;

&lt;p&gt;A 1B model is lightning fast and runs with a negligible memory footprint (~1.2 GB RAM), but it can easily wander or drop structured fields if given ambiguous instructions. To get deterministic, publication-grade resume evaluations out of Gemma 3 1B:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Strict JSON-Only Guardrails:&lt;/strong&gt; I engineered an exacting system prompt that forces raw JSON output wrapped in a single code block, complete with an explicit scoring rubric (e.g., &lt;em&gt;70–84: Strong candidate, minor gaps; 50–69: Moderate fit, notable missing skills&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Anti-Sycophancy Calibration:&lt;/strong&gt; Small models tend to be agreeable and hand out 95% scores. I explicitly calibrated the rubric to penalize missing prerequisites and prioritize brutal honesty.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Robust Schema Parsing &amp;amp; Fallbacks:&lt;/strong&gt; Responses pass through a regex-assisted JSON cleaner and Zod schema validation to handle edge-case markdown formatting quirks before hitting the frontend.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Full-Stack Data &amp;amp; Authentication Pipeline
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Next.js 16 (App Router) &amp;amp; TypeScript:&lt;/strong&gt; High-performance server actions and API route handlers for document ingestion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Document Extractors:&lt;/strong&gt; &lt;code&gt;pdfjs-dist&lt;/code&gt; for raw text and structure parsing from PDFs, and &lt;code&gt;mammoth&lt;/code&gt; for parsing &lt;code&gt;.docx&lt;/code&gt; resumes cleanly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MongoDB &amp;amp; NextAuth.js v5:&lt;/strong&gt; Handles secure credential authentication (bcrypt-hashed) and persists resume metadata, extracted content, fit scores, and historical audits so users can track improvements across multiple versions of their CV.&lt;/li&gt;
&lt;/ul&gt;




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

&lt;p&gt;Open innovation is not just an alternative deployment model; for an application like ResumeForge, &lt;strong&gt;it is the only model that aligns with user ethics and long-term viability.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Privacy Is Not a Feature—It Is the Product
&lt;/h3&gt;

&lt;p&gt;Career data is intimate. Resumes reveal your identity, residential address, compensation progression, side ventures, and clearances. &lt;/p&gt;

&lt;p&gt;When you use proprietary SaaS resume checkers powered by closed APIs, you are forced to trust a chain of third parties not to log, leak, or train on your identity. Open innovation means the model weights live on &lt;em&gt;your&lt;/em&gt; disk, the inference executes inside &lt;em&gt;your&lt;/em&gt; memory, and the network cable could literally be unplugged while your resume is analyzed.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Eliminating the "API Tax" on Side Hustles
&lt;/h3&gt;

&lt;p&gt;Building an AI side hustle on closed APIs creates an existential vulnerability: &lt;strong&gt;variable marginal cost&lt;/strong&gt;. Every time a user uploads a 4-page resume and a long JD, you pay token costs. If a user tests 20 resumes, your margins evaporate.&lt;/p&gt;

&lt;p&gt;With open-weight models like Gemma 3 running locally or self-hosted:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Marginal inference cost is &lt;strong&gt;$0.00&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;There are no surprise cloud bills at the end of the month.&lt;/li&gt;
&lt;li&gt;Builders can price their product as a one-time purchase or lifetime license instead of forcing users into recurring subscriptions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Democratizing Career Advancement
&lt;/h3&gt;

&lt;p&gt;A student in an emerging market or an unemployed worker should not have to pay $30/month just to understand why their resume is failing ATS filters. Open-weight models level the playing field, making world-class career analysis accessible to anyone with a modest laptop.&lt;/p&gt;




&lt;h2&gt;
  
  
  My Agent Session
&lt;/h2&gt;

&lt;p&gt;During development, agentic pair programming helped scaffold the Next.js 16 App Router endpoints, optimize the Docker Model Runner configurations, and iterate through prompt calibrations for Gemma 3's output parsing.&lt;/p&gt;




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

&lt;p&gt;I am entering ResumeForge into the following categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Gemma:&lt;/strong&gt; Built directly around Google's open-weight &lt;strong&gt;Gemma 3 (1B)&lt;/strong&gt; model (&lt;code&gt;ai/gemma3:1b-q4_K_M&lt;/code&gt;), pushing the limits of what a compact 1B model can achieve through calibrated system prompts and structured JSON enforcement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of MongoDB Atlas:&lt;/strong&gt; Utilizing MongoDB (Mongoose ODM) to power secure user authentication, resume metadata storage, and persistent historical resume-to-job matching audits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Docker / Local Inference:&lt;/strong&gt; Containerized local AI orchestration through &lt;strong&gt;Docker Model Runner&lt;/strong&gt;, creating a seamless, zero-cloud bridge between open-weight models and web runtimes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Overall / Side Hustle Track:&lt;/strong&gt; A complete, privacy-respecting product concept addressing a massive consumer pain point with zero marginal inference costs.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>buildinpublic</category>
      <category>hacktoberfest</category>
    </item>
    <item>
      <title>CodeWeaver: Giving AI Agents Real Context with a Codebase Knowledge Graph</title>
      <dc:creator>Sushant Singh Negi</dc:creator>
      <pubDate>Sat, 17 Oct 2026 17:41:59 +0000</pubDate>
      <link>https://dev.to/devnegi/codeweaver-giving-ai-agents-real-context-with-a-codebase-knowledge-graph-252j</link>
      <guid>https://dev.to/devnegi/codeweaver-giving-ai-agents-real-context-with-a-codebase-knowledge-graph-252j</guid>
      <description>&lt;h1&gt;
  
  
  Beyond Vector Search: Building a Graph-Native Codebase Intelligence Agent with FalkorDB
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Why vector embeddings fail at understanding software architecture, and how we built an explainable ReAct agent that navigates code as a living graph.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;Every software engineer knows the sinking feeling of opening a new, massive repository for the first time. &lt;/p&gt;

&lt;p&gt;You look at dozens of directories, hundreds of source files, implicit architectural layers, and complex dependency webs. You open your favorite AI coding assistant and ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"If I refactor our authentication service, what downstream agent nodes and API routes will break?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The assistant pauses, scans your repository with vector similarity search, and responds with a confident, beautifully formatted hallucination. It lists files that don't depend on your service, misses the actual orchestrator three directories over, and leaves you to dig through the call stack manually.&lt;/p&gt;

&lt;p&gt;During the &lt;strong&gt;FalkorDB Graph Hacks 2026&lt;/strong&gt;, we set out to fix this fundamental breakdown. We built &lt;strong&gt;CodeWeaver&lt;/strong&gt; — a graph-powered codebase intelligence agent that treats code not as disconnected text chunks, but as what it actually is: &lt;strong&gt;a directed, typed, multi-dimensional graph&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here is the story of why we abandoned vanilla vector RAG for codebase intelligence, how we modeled a real-world enterprise codebase in FalkorDB, and what we learned building an autonomous agent with a 100% explainable reasoning path.&lt;/p&gt;




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

&lt;p&gt;Check out the project demo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;** Demo Vedio:** &lt;a href="https://youtu.be/0gjnDK7I5U8" rel="noopener noreferrer"&gt;Live Demo&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Demo Preview:&lt;/strong&gt; &lt;a href="https://github.com/NegiSushant/CodeWeaver" rel="noopener noreferrer"&gt;Repo link&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&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%2Fwydokyyvt35eldmy0wo9.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%2Fwydokyyvt35eldmy0wo9.png" alt=" " width="800" height="339"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  2. The Real Problem: Why Vector Search Fails at Code
&lt;/h2&gt;

&lt;p&gt;The modern AI stack is obsessed with semantic embeddings. For general knowledge retrieval, vector search works wonders. But software code is not natural language prose — &lt;strong&gt;code is strict, deterministic topology&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When you chunk a codebase into 500-token text slices and embed them into a vector space, you destroy the exact information that makes software function:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Topological Blindness&lt;/strong&gt;: Embedding vectors capture semantic similarity, not causal connectivity. A function named &lt;code&gt;handleAuthError&lt;/code&gt; might be semantically identical to &lt;code&gt;logAuthFailure&lt;/code&gt;, but if only one of them is invoked by the mission-critical state machine, vector search treats them as interchangeable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Multi-Hop Horizon&lt;/strong&gt;: Real codebase questions are multi-hop by definition:
$$\text{Repository} \longrightarrow \text{Domain Service} \longrightarrow \text{State Machine Node} \longrightarrow \text{API Route}$$
Vector retrieval cannot jump across four deterministic references. It retrieves chunks that "sound" like the query, completely missing the transitive chain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero Verifiability&lt;/strong&gt;: When a traditional LLM answers an architectural question, you have no way to verify &lt;em&gt;how&lt;/em&gt; it reached its conclusion. You are left trusting a black box with your production deployment.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  3. The Insight: Code is a Graph, Not a Bag of Tokens
&lt;/h2&gt;

&lt;p&gt;Compilers have understood this for half a century: code represents an Abstract Syntax Tree (AST), a call graph, and an import dependency graph. &lt;/p&gt;

&lt;p&gt;When an experienced engineer investigates a codebase, they don't do vector similarity in their heads. They trace references:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;"Who calls this function?"&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;"Which architectural layer does this file belong to?"&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;"What high-level business feature does this module implement?"&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;"Who owns this domain?"&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These questions are textbook graph traversals. By representing the codebase as a native property graph, we can leverage Cypher queries to answer structural, multi-hop questions with mathematical certainty. The LLM shouldn't guess connections; it should navigate verified graph relations.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. What We Built: CodeWeaver
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CodeWeaver&lt;/strong&gt; is an autonomous codebase intelligence platform built on top of &lt;strong&gt;FalkorDB&lt;/strong&gt;, Next.js 16, LangChain, and PostgreSQL.&lt;/p&gt;

&lt;p&gt;Instead of guessing from isolated snippets, CodeWeaver equips an autonomous ReAct agent with specialized tools that execute Cypher queries against FalkorDB in real time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Core Capabilities:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Architectural Discovery&lt;/strong&gt;: Understands clean architecture layers, modules, and file distributions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blast Radius &amp;amp; Impact Analysis&lt;/strong&gt;: Calculates multi-hop downstream dependencies when files or functions change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Feature-to-Code Mapping&lt;/strong&gt;: Bridges the gap between high-level business features (e.g., &lt;em&gt;ReAct Agent Loop&lt;/em&gt;, &lt;em&gt;Human-in-the-Loop Validation&lt;/em&gt;, &lt;em&gt;Policy RAG&lt;/em&gt;) and the exact classes and files that implement them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explainable Reasoning Paths&lt;/strong&gt;: Every answer returned by the agent includes the exact internal FalkorDB node IDs traversed. Users can click a single button to inspect the visual subgraph that grounded the response.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive Knowledge Graph Canvas&lt;/strong&gt;: A dedicated, interactive force-directed graph page (&lt;code&gt;/graph&lt;/code&gt;) with category filtering, node inspection, and real-time search.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. How We Modeled the Codebase as a Graph
&lt;/h2&gt;

&lt;p&gt;To test CodeWeaver against a realistic, non-trivial system, we ingested the complete repository of an &lt;strong&gt;Autonomous Healthcare Prior Authorization Agent&lt;/strong&gt; — a system featuring Next.js 16, LangGraph state machines, domain services, and Prisma persistence.&lt;/p&gt;

&lt;p&gt;We designed a property graph schema that captures both low-level code syntax and high-level architectural intent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(Person)-[:OWNED_BY]-(File|Module)
(File)-[:BELONGS_TO]-&amp;gt;(Module)
(File)-[:IMPLEMENTS]-&amp;gt;(Feature)
(Function|Class)-[:BELONGS_TO]-&amp;gt;(File)
(Function)-[:CALLS]-&amp;gt;(Function)
(Class|File)-[:USES]-&amp;gt;(Class|File)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Node Types:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Module&lt;/code&gt;&lt;/strong&gt;: Architectural layers (&lt;code&gt;Agent Core&lt;/code&gt;, &lt;code&gt;Agent Tools&lt;/code&gt;, &lt;code&gt;Services&lt;/code&gt;, &lt;code&gt;Repository&lt;/code&gt;, &lt;code&gt;UI Components&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Feature&lt;/code&gt;&lt;/strong&gt;: Functional product capabilities (&lt;code&gt;ReAct Loop&lt;/code&gt;, &lt;code&gt;Prior Authorization Flow&lt;/code&gt;, &lt;code&gt;Clinical Guideline RAG&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;File&lt;/code&gt;&lt;/strong&gt;: Source files across the repository.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Function&lt;/code&gt; &amp;amp; &lt;code&gt;Class&lt;/code&gt;&lt;/strong&gt;: Discrete AST-extracted symbols, methods, and declarations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Person&lt;/code&gt;&lt;/strong&gt;: Domain owners and maintainers responsible for specific modules.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Relationship Topology:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;BELONGS_TO&lt;/code&gt;: Structural encapsulation (functions in files; files in modules).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;IMPLEMENTS&lt;/code&gt;: Semantic grounding linking low-level code directly to high-level product features.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;CALLS&lt;/code&gt; &amp;amp; &lt;code&gt;USES&lt;/code&gt;: AST invocation chains and import dependencies.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;OWNED_BY&lt;/code&gt;: Accountability and team ownership mapping.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our ingestion engine parsed the codebase into &lt;strong&gt;228 nodes&lt;/strong&gt; and &lt;strong&gt;306 relationships&lt;/strong&gt;, creating a complete structural digital twin inside FalkorDB.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. How the Agent Reasons: Cypher-Powered Tools &amp;amp; Explainability
&lt;/h2&gt;

&lt;p&gt;We built CodeWeaver using LangChain and LangGraph to implement a structured ReAct (Reason-Act-Reflect) loop. &lt;/p&gt;

&lt;p&gt;Rather than giving the LLM raw Cypher execution privileges (which often produces invalid syntax and security risks), we provided the agent with four deterministic graph tools:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;getArchitectureOverview&lt;/code&gt;: Traverses high-level &lt;code&gt;Module&lt;/code&gt; nodes and their file counts.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;getFeatureImplementation&lt;/code&gt;: Finds all files and classes linked to a feature via &lt;code&gt;IMPLEMENTS&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;analyzeDependencies&lt;/code&gt;: Executes 1-to-3 hop traversals (&lt;code&gt;&amp;lt;-[:CALLS|USES*1..3]-&lt;/code&gt;) to compute the blast radius of a component.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;getOwnershipInfo&lt;/code&gt;: Resolves code ownership through &lt;code&gt;OWNED_BY&lt;/code&gt; relationships.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Prompt
    │
    ▼
LangChain ReAct Agent (Azure OpenAI GPT-4o)
    │
    ├─► Step 1: Select Graph Tool (e.g., analyzeDependencies)
    │
    ├─► Step 2: Query FalkorDB via Redis Protocol
    │           MATCH (n)&amp;lt;-[:CALLS|USES*1..2]-(dep)
    │           RETURN ID(n), ID(dep), n.name, dep.name
    │
    ├─► Step 3: FalkorDB responds in 1.4ms
    │
    ▼
Synthesize Answer + Collect Reasoning Node IDs: [42, 88, 104, 115]
    │
    ▼
Client: Render Answer + Interactive Reasoning Path Subgraph
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Power of the Reasoning Path
&lt;/h3&gt;

&lt;p&gt;Whenever the agent queries FalkorDB, our Cypher queries explicitly project the internal graph node IDs: &lt;code&gt;RETURN ID(n) AS nodeId&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The agent collects these IDs throughout its reasoning trajectory and returns them alongside the markdown answer. In the UI, the user sees an interactive &lt;strong&gt;Reasoning Path&lt;/strong&gt; badge. Clicking it opens a focused modal containing &lt;em&gt;only&lt;/em&gt; the nodes and relationships the agent touched. &lt;/p&gt;

&lt;p&gt;There is zero black-box mystery: developers can verify every claim against the actual graph topology.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Architecture Decisions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. In-Memory Graph Processing with FalkorDB
&lt;/h3&gt;

&lt;p&gt;Agentic workflows require multiple tool calls per turn. If graph queries take 500ms, an agent that needs 3 hops feels sluggish and unresponsive. FalkorDB runs in-memory with C-level graph algorithms over Redis protocol, consistently returning multi-hop queries in &lt;strong&gt;under 2 milliseconds&lt;/strong&gt;. This sub-millisecond latency makes iterative graph reasoning feel instantaneous.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Separation of Playground (&lt;code&gt;/chat&lt;/code&gt;) and Explorer (&lt;code&gt;/graph&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;A common mistake in AI developer tools is cramming an enormous canvas into the chat interface. We maintained a strict separation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;Playground&lt;/strong&gt; focuses on focused conversational Q&amp;amp;A with lightweight, contextual subgraph previews.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Knowledge Graph Page&lt;/strong&gt; provides an expansive, full-viewport canvas with category filtering, real-time node search, and full property inspection.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Persistent Grok-Style Chat Sessions
&lt;/h3&gt;

&lt;p&gt;Codebase investigations are iterative. We paired PostgreSQL and Prisma with our FalkorDB backend to persist chat sessions, conversation histories, and associated reasoning node IDs across browser sessions.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Challenges We Faced &amp;amp; How We Solved Them
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Challenge 1: The "Visual Hairball" Effect
&lt;/h3&gt;

&lt;p&gt;Our first attempt at visualizing 200+ nodes and 300+ relationships on an HTML canvas resulted in an unreadable green blob. Text labels overlapped, and users couldn't isolate relevant components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: We introduced adaptive scale-based label rendering and category filtering. In &lt;code&gt;GraphViewer.tsx&lt;/code&gt;, high-level entities (&lt;code&gt;Module&lt;/code&gt;, &lt;code&gt;Feature&lt;/code&gt;) display bold labels at all zoom levels, while granular labels (&lt;code&gt;Function&lt;/code&gt;, &lt;code&gt;Class&lt;/code&gt;) only render when the user zooms in past &lt;code&gt;1.05x&lt;/code&gt; scale. We also added canvas outline stroke rendering (&lt;code&gt;ctx.strokeText&lt;/code&gt;) to ensure contrast across both light and dark themes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenge 2: Hallucination-Free Reasoning Nodes
&lt;/h3&gt;

&lt;p&gt;Initially, we experimented with asking the LLM to output which nodes it referenced. The result? The LLM occasionally invented node IDs that didn't exist in FalkorDB.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: We eliminated LLM discretion entirely. The graph tools themselves extract and accumulate the exact FalkorDB &lt;code&gt;ID(node)&lt;/code&gt; integers directly from the Cypher query result records. The frontend receives mathematically grounded node IDs straight from the database engine.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. What We Learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Graph databases turn RAG from probabilistic guessing into deterministic retrieval.&lt;/strong&gt; When an LLM cites a structural path derived from a graph database, its hallucinations on architectural boundaries drop to near zero.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explainability is the missing pillar in developer tooling.&lt;/strong&gt; Developers don't distrust AI because it's imperfect; they distrust AI because it doesn't show its work. Providing an interactive subgraph showing the exact nodes used in reasoning builds immediate trust.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Graph schema design requires intentional abstraction.&lt;/strong&gt; Including every single variable or line of code creates unusable noise. Focusing on high-impact abstractions (&lt;code&gt;Module&lt;/code&gt;, &lt;code&gt;Feature&lt;/code&gt;, &lt;code&gt;File&lt;/code&gt;, &lt;code&gt;Function&lt;/code&gt;, &lt;code&gt;Class&lt;/code&gt;) provides the sweet spot for agentic reasoning.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  10. Why FalkorDB Was Critical
&lt;/h2&gt;

&lt;p&gt;CodeWeaver simply could not exist without a purpose-built graph database:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Expressive OpenCypher&lt;/strong&gt;: Modeling queries like &lt;code&gt;MATCH (f:File)-[:IMPLEMENTS]-&amp;gt;(feat:Feature {name: "ReAct Agent Loop"})&lt;/code&gt; requires clean, standardized graph query language semantics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unbeatable Speed&lt;/strong&gt;: FalkorDB’s in-memory execution meant our agent’s multi-step ReAct loop ran without latency penalties.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Effortless Docker Deployment&lt;/strong&gt;: Deploying FalkorDB alongside Postgres in a single &lt;code&gt;docker compose up -d&lt;/code&gt; made local setup seamless.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;FalkorDB isn't a secondary cache in CodeWeaver — it is the intelligence engine that powers every single answer our agent produces.&lt;/p&gt;




&lt;h2&gt;
  
  
  11. Conclusion
&lt;/h2&gt;

&lt;p&gt;Software systems will only grow larger, more complex, and more distributed. As AI agents take on larger roles in software engineering, feeding them flattened text chunks through vector search is a dead end.&lt;/p&gt;

&lt;p&gt;By anchoring AI reasoning in a native graph database like &lt;strong&gt;FalkorDB&lt;/strong&gt;, we can build agents that truly understand software architecture — agents that trace dependencies across multiple hops, respect module boundaries, and show their work with complete transparency.&lt;/p&gt;

&lt;p&gt;CodeWeaver proves that when code is modeled as connected knowledge, AI stops guessing and starts understanding.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Check out the &lt;a href="https://github.com/NegiSushant/CodeWeaver" rel="noopener noreferrer"&gt;CodeWeaver GitHub Repository&lt;/a&gt; to explore the code, run the ingestion pipeline, and try the graph-powered agent yourself.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>wemakedevs</category>
      <category>graphhacks</category>
      <category>buildinpublic</category>
      <category>falkordb</category>
    </item>
    <item>
      <title>I Built OutSideQuest: An AI That Wants You to Stop Using It 🌿</title>
      <dc:creator>Sushant Singh Negi</dc:creator>
      <pubDate>Sat, 10 Oct 2026 06:51:42 +0000</pubDate>
      <link>https://dev.to/devnegi/i-built-outsidequest-an-ai-that-wants-you-to-stop-using-it-3126</link>
      <guid>https://dev.to/devnegi/i-built-outsidequest-an-ai-that-wants-you-to-stop-using-it-3126</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;h1&gt;
  
  
  SideQuest — Outside Quest
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Less scrolling. More living.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
An open-weight AI micro-adventure generator that gives you a reason to put your phone down and go outside.&lt;/p&gt;
&lt;/blockquote&gt;




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

&lt;p&gt;Most modern consumer AI is engineered to maximize screen time, message volume, and session retention. We chat with assistants, scroll generated text, and stay tethered to our desks.&lt;/p&gt;

&lt;p&gt;I built &lt;strong&gt;SideQuest (OutsideQuest)&lt;/strong&gt; with the opposite philosophy: &lt;strong&gt;the AI interaction should be the shortest part of the user experience.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SideQuest is a minimalist, privacy-first web application that uses a local, open-weight language model to generate bite-sized, real-world outdoor missions. It gives you an immediate, structured reason to step away from your screen and interact with the physical world.&lt;/p&gt;

&lt;h3&gt;
  
  
  How It Gets People Off the Screen and Into the World
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Under 60 Seconds on Screen:&lt;/strong&gt; You choose how much time you have (from 15 minutes to 2 hours), select your current mood (11 curated vibes or a custom note), and pick your immediate environment (park, city sidewalk, backyard, neighborhood).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Anti-Screen Prompt Engineering:&lt;/strong&gt; The underlying AI model is strictly instructed &lt;strong&gt;never&lt;/strong&gt; to suggest anything involving phones, photography, internet searches, apps, or social media. Missions are built entirely around sensory awareness — noticing seasonal leaf transitions, identifying quiet corners, tracing textured bark or stone, or listening for overlooked sounds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Lock-and-Step Loop:&lt;/strong&gt; When you tap &lt;strong&gt;Start Quest&lt;/strong&gt;, a fullscreen 3-2-1 countdown sequence begins, followed by an active timer and a clear prompt: &lt;em&gt;"Put your phone away. See you in X minutes."&lt;/em&gt; You lock your screen, pocket your phone, and head outdoors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Post-Quest Reflection:&lt;/strong&gt; When you return, SideQuest calculates your minutes outside from start timestamps, records how your mood shifted before and after the quest, and saves your thoughts in a private local journal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Focus Guard:&lt;/strong&gt; You can never have more than &lt;strong&gt;2 ongoing quests&lt;/strong&gt; active at once, discouraging quest hoarding and keeping your focus on completing real-world activities.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Who It Is For
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Developers &amp;amp; Remote Workers:&lt;/strong&gt; Desk-bound professionals suffering from screen fatigue and decision paralysis during short breaks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Students:&lt;/strong&gt; Anyone trapped in an infinite social media loop between study sessions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Everyday Explorers:&lt;/strong&gt; People who want to take a walk but want a novel observational lens rather than an aimless wander.&lt;/li&gt;
&lt;/ul&gt;




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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live Demo Walkthrough:&lt;/strong&gt; [&lt;a href="https://youtu.be/ffJ03snJw5s" rel="noopener noreferrer"&gt;https://youtu.be/ffJ03snJw5s&lt;/a&gt;]&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHug Submission:&lt;/strong&gt; [&lt;a href="https://github.com/NegiSushant/OutsideQuest" rel="noopener noreferrer"&gt;https://github.com/NegiSushant/OutsideQuest&lt;/a&gt;]&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Key Screens &amp;amp; Experience
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quest Customization (&lt;code&gt;/start&lt;/code&gt;):&lt;/strong&gt; Granular time presets (15m, 30m, 45m, 60m, 120m, or custom minutes), 11 moods (&lt;em&gt;Relax, Explore, Calm, Nature, Move, Create, Curious, Adventurous, Reflective, Anxious, Bored&lt;/em&gt;), and 8 environments (&lt;em&gt;Outdoors, Park, City/Urban, Home/Yard, Nature, Quiet Spot, Mixed, Anywhere&lt;/em&gt;). Includes a one-click &lt;strong&gt;Surprise Me&lt;/strong&gt; mode.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mission View (&lt;code&gt;/quest&lt;/code&gt;):&lt;/strong&gt; Displays mission title, duration, tags, purpose, and ordered physical tasks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive Launch Modal:&lt;/strong&gt; 3-2-1 animated launch sequence transitioning into an active countdown timer with pause and resume controls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reflection Journal (&lt;code&gt;/reflect&lt;/code&gt;):&lt;/strong&gt; Full-context review of initial parameters and tasks, mood-before (pre-filled) vs. mood-after tracker, outside time counter, and personal reflection notes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quest History (&lt;code&gt;/journal&lt;/code&gt;):&lt;/strong&gt; Filterable log (All, Not started, Ongoing, Completed) with live running countdown badges and detail inspection modals.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Code
&lt;/h2&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/NegiSushant" rel="noopener noreferrer"&gt;
        NegiSushant
      &lt;/a&gt; / &lt;a href="https://github.com/NegiSushant/OutsideQuest" rel="noopener noreferrer"&gt;
        OutsideQuest
      &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;SideQuest — Outside Quest&lt;/h1&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Less scrolling. More living.&lt;/strong&gt;
An AI that gives you a reason to put your phone down and go outside.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="https://dev.to/challenges/hacktoberfest-week1-2026-10-05" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/3d9bdec4fd27ad45c2fa89fd1e5009109b0a59f383f5bbd877427e95265226b1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4861636b746f626572666573745f323032362d5765656b5f315f254532253830253943546f7563685f47726173732545322538302539442d3130623938313f7374796c653d666c61742d737175617265" alt="Hacktoberfest 2026"&gt;&lt;/a&gt;
&lt;a href="https://huggingface.co/google/gemma-3-1b-it" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/2a3a0fc970b35dfd9813333815fd237957e99daf056ce0475b1b13ed82375806/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6f64656c2d47656d6d615f335f31425f2851345f5f4b5f5f4d292d3035393636393f7374796c653d666c61742d737175617265" alt="Model"&gt;&lt;/a&gt;
&lt;a href="https://docs.docker.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/734a8a6315a4a78f9f8ea846bea545e9efb19e15f79e0178bb245256375c2f5a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f52756e74696d652d446f636b65725f4d6f64656c5f52756e6e65725f284c6f63616c292d3034373835373f7374796c653d666c61742d737175617265" alt="Runtime"&gt;&lt;/a&gt;
&lt;a href="https://nextjs.org" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/f3b4d0e31f8be5ce96d71e4c0b84031d0f516763a7f44df115b7f7058f716616/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4672616d65776f726b2d4e6578742e6a735f31365f284170705f526f75746572292d3036346533623f7374796c653d666c61742d737175617265" alt="Framework"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🌱 What is SideQuest?&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;SideQuest&lt;/strong&gt; (OutsideQuest) is an outdoor micro-adventure generator powered by a local, open-weight language model.&lt;/p&gt;
&lt;p&gt;Instead of keeping you engaged in prolonged conversational dialogue, SideQuest is designed to do the opposite: take under a minute of your time, generate a small physical mission in your immediate environment, and tell you to put your phone away.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Who it is for&lt;/h3&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Anyone experiencing digital fatigue from extended screen sessions.&lt;/li&gt;
&lt;li&gt;Remote workers and students needing a structured reason to take a short break outdoors.&lt;/li&gt;
&lt;li&gt;Anyone who wants to step outside but gets stuck deciding where to go or what to do.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;The problem it addresses&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;Most outdoor and fitness applications demand continuous screen engagement — watching live maps, managing GPS routes, logging stats mid-walk, or photographing scenery…&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/NegiSushant/OutsideQuest" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/NegiSushant/OutsideQuest" rel="noopener noreferrer"&gt;https://github.com/NegiSushant/OutsideQuest&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The project is completely open-source and built using &lt;strong&gt;Next.js 16 (App Router)&lt;/strong&gt;, &lt;strong&gt;React 19&lt;/strong&gt;, &lt;strong&gt;Tailwind CSS v4&lt;/strong&gt;, &lt;strong&gt;Bun&lt;/strong&gt;, and &lt;strong&gt;Docker Desktop Model Runner&lt;/strong&gt;.&lt;/p&gt;




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

&lt;p&gt;SideQuest was built from the ground up around &lt;strong&gt;local open-weight AI&lt;/strong&gt;, ensuring zero external API dependencies, zero tracking, and true offline capability.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Open-Weight Model &amp;amp; Local Inference
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Model:&lt;/strong&gt; Google’s &lt;strong&gt;Gemma 3 1B&lt;/strong&gt; (&lt;code&gt;ai/gemma3:1b-q4_K_M&lt;/code&gt;), 4-bit medium quantized instruction-tuned model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Serving Engine:&lt;/strong&gt; &lt;strong&gt;Docker Desktop Model Runner&lt;/strong&gt;, exposing an OpenAI-compatible REST endpoint at &lt;code&gt;http://localhost:12434/engines/v1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hardware Efficiency:&lt;/strong&gt; At under &lt;strong&gt;1.5 GB of RAM/VRAM&lt;/strong&gt;, Gemma 3 1B runs easily on standard consumer laptops without specialized GPU hardware. Early attempts to run 4B models triggered Out-Of-Memory allocation errors on local hardware, making the 1B variant the ideal balance of speed (under 3 seconds per quest), reliability, and lightweight footprint.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Guardrailed System Prompting
&lt;/h3&gt;

&lt;p&gt;The system prompt (&lt;code&gt;src/lib/prompts.ts&lt;/code&gt;) turns generative AI into an intentional departure tool:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enforces exact requested durations.&lt;/li&gt;
&lt;li&gt;Strictly forbids screen-based tasks: &lt;em&gt;"Never suggest taking photos, browsing online, or social sharing."&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Focuses on sensory observation: &lt;em&gt;"Focus on noticing, sensing, walking, sitting, comparing, or finding."&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Respects user physical constraints (&lt;em&gt;e.g., knee fatigue, quiet preferences&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;Guarantees clean, deterministic JSON output.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. A Real Example from the Application Logs
&lt;/h3&gt;

&lt;p&gt;Here is an authentic test generation stored in &lt;code&gt;quest-test-logs.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"preferences"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"availableTime"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"mood"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"relax"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"environment"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"park"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"notes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Keep it quiet, i have knee problem"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"quest"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Stroll Through the Park's Hidden Corner"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"duration"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"goal"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Find a serene spot to sit and observe the surroundings"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"tasks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"task-1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Walk slowly to a quiet area of the park, avoiding main paths"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"task-2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Find a bench or a tree with a flat surface to sit on, and sit down"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"task-3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Observe the types of leaves and flowers around you, noticing any changes in the season"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"task-4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Listen to the sounds of nature, focusing on the quietest sounds, such as the rustling of leaves or the chirping of birds"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"tags"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"relaxation"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"nature"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"observation"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"completed"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Full-Stack Web Architecture
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend:&lt;/strong&gt; Next.js 16 App Router with React 19, styled using Tailwind CSS v4 and &lt;code&gt;next-themes&lt;/code&gt; for responsive dark and light modes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server Handlers:&lt;/strong&gt; Server-side route handlers (&lt;code&gt;/api/generate&lt;/code&gt;, &lt;code&gt;/api/latest-quest&lt;/code&gt;, &lt;code&gt;/api/update-quest-progress&lt;/code&gt;, &lt;code&gt;/api/complete-quest&lt;/code&gt;) format prompts, validate JSON structures, and manage session lifecycles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero-Setup Local Persistence:&lt;/strong&gt; Data persists to local JSON files (&lt;code&gt;quest-test-logs.json&lt;/code&gt; and &lt;code&gt;final-quest.json&lt;/code&gt;) alongside browser &lt;code&gt;localStorage&lt;/code&gt;, eliminating the need to set up remote databases.&lt;/li&gt;
&lt;/ul&gt;




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

&lt;p&gt;During early experimentation, I hit a cloud provider error recorded directly in my project logs:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;"Failed to perform inference: You have no remaining credits. Purchase pre-paid credits to continue..."&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That moment underscored why &lt;strong&gt;open innovation and local open-weight models&lt;/strong&gt; are crucial for products like SideQuest:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Intimate Privacy by Default:&lt;/strong&gt; SideQuest asks users to log daily emotional states (&lt;em&gt;e.g., feeling anxious, bored, or reflective&lt;/em&gt;), personal physical limitations (&lt;em&gt;e.g., knee issues&lt;/em&gt;), and neighborhood locations. Streaming raw emotional reflections and habits to closed commercial cloud APIs is an unnecessary privacy risk. With local open-weight AI, &lt;strong&gt;zero bytes leave the host machine&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Freedom from Paywalls &amp;amp; Artificial Scarcity:&lt;/strong&gt; Closed APIs require subscription models, token metering, and credit card barriers. Open-weight models empower developers to build free, perpetual utility software that anyone with a laptop can run forever without paying per token.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resilience &amp;amp; Offline Independence:&lt;/strong&gt; If you take your laptop to a cabin, a park bench with spotty mobile data, or travel without Wi-Fi, SideQuest still generates mindful quests on demand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Focused Utility:&lt;/strong&gt; Gemma 3 1B demonstrates that open models don't need to be massive 70B parameter giants to deliver meaningful human impact. A lightweight 1B model running on local hardware is all it takes to help someone step away from their desk and reset their mind.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  My Agent Session
&lt;/h2&gt;

&lt;p&gt;Throughout the development of SideQuest, I utilized pair-programming agent workflows to iterate rapidly on system prompt edge cases, dynamic reverse timers, JSON database handlers, and responsive dark-mode UI tokens.&lt;/p&gt;

&lt;p&gt;The entire development history, architectural decisions, and setup instructions are documented transparently in the repository's commit history and &lt;a href="https://github.com/NegiSushant/OutsideQuest/blob/main/README.md" rel="noopener noreferrer"&gt;&lt;code&gt;README.md&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;




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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Primary Category:&lt;/strong&gt; Hacktoberfest 2026 Week 1 Challenge — &lt;strong&gt;“Touch Grass”&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Track:&lt;/strong&gt; Local &amp;amp; Open-Weight AI (Google Gemma 3 via Docker Model Runner)&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Less scrolling. More living. Put your phone away and go touch grass!&lt;/em&gt; 🌱&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>weekendchallenge</category>
    </item>
    <item>
      <title>Echoes of an Era: Building a Grounded AI Time Capsule from My Grandfather’s Voice</title>
      <dc:creator>Sushant Singh Negi</dc:creator>
      <pubDate>Sun, 04 Oct 2026 12:49:55 +0000</pubDate>
      <link>https://dev.to/devnegi/echoes-of-an-era-building-a-grounded-ai-time-capsule-from-my-grandfathers-voice-160n</link>
      <guid>https://dev.to/devnegi/echoes-of-an-era-building-a-grounded-ai-time-capsule-from-my-grandfathers-voice-160n</guid>
      <description>&lt;p&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;/p&gt;




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

&lt;p&gt;&lt;strong&gt;Echoes of an Era&lt;/strong&gt; is an open-source, retrieval-grounded AI voice memory capsule built specifically for my grandfather. It preserves, organizes, indexes, and makes searchable his authentic life stories and oral history without turning the AI into a fictionalized, hallucinatory avatar of him.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Problem It Solves
&lt;/h3&gt;

&lt;p&gt;My grandfather lived through a world that no longer exists—growing up in the 1950s, communicating via weekly inland letters, experiencing the transformation of traditional family customs, and observing decades of societal change. Our family captured hours of his stories on voice recorders, but like most personal audio archives:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Voice recordings are unsearchable:&lt;/strong&gt; Audio files are linear and opaque. You cannot &lt;code&gt;Ctrl+F&lt;/code&gt; a voice recording.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stories lose context over time:&lt;/strong&gt; Unlabelled files sitting in folders become difficult for future generations to explore.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The AI Hallucination Trap:&lt;/strong&gt; Generic cloud chatbots are trained to be helpful, which often means they fabricate heartwarming but entirely fake personal memories when asked questions they don't know the answer to.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The Core Philosophy
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"AI interprets the memories. It does not create the memories."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This application is &lt;strong&gt;not&lt;/strong&gt; an AI pretending to be my grandfather. It &lt;strong&gt;is&lt;/strong&gt; an AI-powered interface to my grandfather's authentic, recorded voice. His original voice recordings remain the single source of truth.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🎙️ &lt;strong&gt;Audio Memory Vaulting:&lt;/strong&gt; Upload and store raw voice recordings (&lt;code&gt;.mp3&lt;/code&gt;, &lt;code&gt;.wav&lt;/code&gt;) up to 10MB per file with automatic PyAV audio metadata decoding.&lt;/li&gt;
&lt;li&gt;📝 &lt;strong&gt;Timestamped Speech-to-Text:&lt;/strong&gt; Verbatim transcription using &lt;code&gt;faster-whisper&lt;/code&gt; with voice activity detection (VAD) and auto-detected language support (Hindi, Hinglish, English).&lt;/li&gt;
&lt;li&gt;🧠 &lt;strong&gt;Structured Memory Extraction:&lt;/strong&gt; Automatically extracts titles, summaries, historical eras, locations, people mentioned, emotions, verbatim quotes, and life advice using &lt;code&gt;gemma3:1B-Q4_K_M&lt;/code&gt; running locally through Docker Model Runner.&lt;/li&gt;
&lt;li&gt;⚡ &lt;strong&gt;1024-Dimensional Vector Search:&lt;/strong&gt; High-density semantic indexing using local &lt;code&gt;BAAI/bge-m3&lt;/code&gt; via &lt;code&gt;SentenceTransformers&lt;/code&gt; stored in PostgreSQL with &lt;code&gt;pgvector&lt;/code&gt; HNSW vector indexes.&lt;/li&gt;
&lt;li&gt;🔍 &lt;strong&gt;Hybrid Retrieval Engine:&lt;/strong&gt; Combines dense vector similarity with keyword/lexical field scoring re-ranked via Reciprocal Rank Fusion (RRF).&lt;/li&gt;
&lt;li&gt;💬 &lt;strong&gt;Grounded Q&amp;amp;A ("Ask Grandfather"):&lt;/strong&gt; Answers user questions strictly using retrieved memory context, refusing to fabricate answers when evidence is insufficient.&lt;/li&gt;
&lt;li&gt;🎧 &lt;strong&gt;Interactive Audio Player &amp;amp; Timestamps:&lt;/strong&gt; Direct, range-supported HTTP audio streaming (&lt;code&gt;206 Partial Content&lt;/code&gt;) that jump-cuts to the exact second where grandfather spoke the retrieved memory.&lt;/li&gt;
&lt;li&gt;📜 &lt;strong&gt;Chronological Era Timeline:&lt;/strong&gt; Explore memories grouped chronologically across eras (1940s to present) and filter by thematic categories.&lt;/li&gt;
&lt;li&gt;⏳ &lt;strong&gt;"Then vs Now" Reflections:&lt;/strong&gt; Compare historical experiences described by grandfather (THEN) against modern realities (NOW), generating generational reflection questions and enduring values.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Screenshots
&lt;/h2&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%2Fle7rpr2z0umwojbb1w9y.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%2Fle7rpr2z0umwojbb1w9y.png" alt=" " width="799" height="291"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Home Page Dashboard &amp;amp; Audio Memory Vault&lt;/em&gt;&lt;/p&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%2Ftwfjrz5mf89w54y787nl.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%2Ftwfjrz5mf89w54y787nl.png" alt=" " width="800" height="422"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Grounded Q&amp;amp;A Interface ("Ask Grandfather")&lt;/em&gt;&lt;/p&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%2Fkggditt5r53crgqo1ijj.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%2Fkggditt5r53crgqo1ijj.png" alt=" " width="799" height="457"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Signature "Then vs Now" Historical Reflections Engine&lt;/em&gt;&lt;/p&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%2Fws86f1wufbmyshinjy0i.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%2Fws86f1wufbmyshinjy0i.png" alt=" " width="800" height="513"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Decade-based Memory Categorization&lt;/em&gt;&lt;/p&gt;




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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Video Demo:&lt;/strong&gt; [&lt;a href="https://youtu.be/73hLP9b_y4M" rel="noopener noreferrer"&gt;https://youtu.be/73hLP9b_y4M&lt;/a&gt;]&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; [&lt;a href="https://github.com/NegiSushant/Echoes-of-an-Era" rel="noopener noreferrer"&gt;https://github.com/NegiSushant/Echoes-of-an-Era&lt;/a&gt;]
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/NegiSushant/Echoes-of-an-Era.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






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

&lt;h3&gt;
  
  
  Architecture &amp;amp; System Flow
&lt;/h3&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;graph TB
    subgraph Frontend Client Layer
        React[React 18 UI - Tailwind CSS]
        Player[Docked Audio Player Component]
        SDK[Client API Layer - api.js]
    end

    subgraph Backend Layer FastAPI
        API[FastAPI Core Application]
        STT[TranscriptionService - faster-whisper]
        Embed[EmbeddingService - BAAI/bge-m3]
        Extract[MemoryExtractorService]
        Retriever[RetrievalService - Hybrid Engine]
        RAG[RAGService - Grounded QA]
        Comp[ComparisonService - Then vs Now]
    end

    subgraph Local LLM Engine
        DMR[Docker Model Runner]
        Gemma[Gemma 3 1B Q4_K_M]
    end

    subgraph Storage &amp;amp; Database Layer
        PG[(PostgreSQL 16)]
        PGVector[pgvector Extension - Vector 1024]
        HNSW[HNSW Vector Index]
        AudioStore[File Storage ./uploads/audio]
    end

    React --&amp;gt; SDK
    React --&amp;gt; Player
    SDK --&amp;gt;|REST API| API

    API --&amp;gt; STT
    API --&amp;gt; Extract
    API --&amp;gt; Embed
    API --&amp;gt; Retriever
    API --&amp;gt; RAG
    API --&amp;gt; Comp

    RAG --&amp;gt;|Grounded Context| DMR
    Extract --&amp;gt;|Extraction Prompt| DMR
    Comp --&amp;gt;|Comparison Prompt| DMR
    DMR --&amp;gt; Gemma

    Retriever --&amp;gt; Embed
    Retriever --&amp;gt;|Vector + Lexical Query| PGVector
    Embed --&amp;gt;|1024-dim Vector| PGVector
    PGVector --&amp;gt; HNSW
    Postgres --&amp;gt; PGVector

    Player --&amp;gt;|HTTP Range Stream| API
    API --&amp;gt;|Read Audio Bytes| AudioStore
    STT --&amp;gt;|Read Audio| AudioStore&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
  
  
  1. Gemma 3: Local Reasoning &amp;amp; Memory Extraction
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Model:&lt;/strong&gt; &lt;code&gt;gemma3:1B-Q4_K_M&lt;/code&gt; (Gemma 3 1B 4-bit quantized).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Runtime:&lt;/strong&gt; Gemma 3 1B Q4_K_M running locally through Docker Model Runner (&lt;code&gt;docker model run gemma3:1B-Q4_K_M&lt;/code&gt;) on port &lt;code&gt;12434&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; Structured JSON memory extraction (&lt;code&gt;temperature: 0.1&lt;/code&gt;), grounded RAG answer generation (&lt;code&gt;temperature: 0.2&lt;/code&gt;), and "Then vs Now" historical comparison synthesis.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. BGE-M3: 1024-Dimensional Local Vector Indexing
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Model:&lt;/strong&gt; &lt;code&gt;BAAI/bge-m3&lt;/code&gt; via local &lt;code&gt;SentenceTransformers&lt;/code&gt; (&lt;code&gt;EMBEDDING_LOCAL_ONLY=true&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dimensions:&lt;/strong&gt; 1024-dimensional normalized dense vectors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Composite Text Schema:&lt;/strong&gt; Encodes &lt;code&gt;TITLE + SUMMARY + TOPICS + TRANSCRIPT&lt;/code&gt; together so semantic queries like &lt;em&gt;"school days"&lt;/em&gt; or &lt;em&gt;"travelling by train"&lt;/em&gt; map directly to relevant memories.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Speech-to-Text (STT)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Model:&lt;/strong&gt; &lt;code&gt;faster-whisper&lt;/code&gt; (&lt;code&gt;large-v3-turbo&lt;/code&gt; model default) with PyAV and CTranslate2.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Execution:&lt;/strong&gt; Local transcription with Voice Activity Detection (&lt;code&gt;vad_filter=True&lt;/code&gt;) and precise segment timestamps (&lt;code&gt;start_time&lt;/code&gt;, &lt;code&gt;end_time&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. PostgreSQL + pgvector Hybrid Retrieval
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Database:&lt;/strong&gt; PostgreSQL 16 image (&lt;code&gt;pgvector/pgvector:pg16&lt;/code&gt;) with &lt;code&gt;pgvector&lt;/code&gt; extension and HNSW vector index (&lt;code&gt;Vector(1024)&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hybrid Fusion:&lt;/strong&gt; Combines cosine vector similarity (&lt;code&gt;1.0 - cosine_distance&lt;/code&gt;) with multi-field lexical keyword matching re-ranked via Reciprocal Rank Fusion (RRF $k=60$) blended with linear score weighting (65% vector, 35% keyword).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. Evidence-Grounded Refusal Guardrail
&lt;/h3&gt;

&lt;p&gt;If no retrieved memory candidate meets the confidence floor ($\ge 0.20$), the system refuses to guess and outputs:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Grandfather has not spoken about this in his recorded memories."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Technology Stack Table
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Frontend&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;React 18, Vite, Tailwind CSS, Lucide Icons&lt;/td&gt;
&lt;td&gt;Modern Web UI &amp;amp; docked audio player&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Backend&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;FastAPI, Python 3.10+, PyAV, Pydantic&lt;/td&gt;
&lt;td&gt;REST API &amp;amp; media streaming server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Database&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;PostgreSQL 16&lt;/td&gt;
&lt;td&gt;Relational storage for memories, transcripts, &amp;amp; eras&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Vector Index&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;pgvector&lt;/code&gt; (0.2.5+)&lt;/td&gt;
&lt;td&gt;1024-dim HNSW vector similarity search&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;LLM Model&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Gemma 3 1B Q4_K_M (&lt;code&gt;gemma3:1B-Q4_K_M&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Local memory extraction, grounded QA, Then vs Now&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;LLM Runtime&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Docker Model Runner (&lt;code&gt;docker model&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Local LLM inference engine (port 12434)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Embeddings&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;BAAI/bge-m3&lt;/code&gt; (SentenceTransformers)&lt;/td&gt;
&lt;td&gt;1024-dimensional normalized dense vectors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Speech-to-Text&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;faster-whisper&lt;/code&gt; (&lt;code&gt;large-v3-turbo&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Local transcription &amp;amp; timestamp extraction&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Containerization&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Docker &amp;amp; Docker Compose&lt;/td&gt;
&lt;td&gt;Containerized database and vector engine setup&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




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

&lt;p&gt;Open-weight models (&lt;strong&gt;Gemma 3&lt;/strong&gt;, &lt;strong&gt;BGE-M3&lt;/strong&gt;, &lt;strong&gt;faster-whisper&lt;/strong&gt;) and open-source infrastructure (&lt;strong&gt;PostgreSQL + pgvector&lt;/strong&gt;) are essential for personal family archives:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Privacy &amp;amp; Data Sovereignty:&lt;/strong&gt; Personal family history, private transcripts, and voice audio remain strictly on local hardware rather than being transmitted to third-party public LLM cloud providers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long-Term Longevity:&lt;/strong&gt; Closed cloud APIs can change terms of service, adjust pricing, or sunset models. Open-weight models running on standard host hardware guarantee that the family time capsule will remain accessible 10 or 20 years from now.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full Transparency &amp;amp; Control:&lt;/strong&gt; Open infrastructure allows us to inspect and customize prompt templates, tune retrieval thresholds, and manage vector indices directly without relying on proprietary black-box pipelines.&lt;/li&gt;
&lt;/ol&gt;




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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Build for a Friend:&lt;/strong&gt; Built specifically for my grandfather to preserve his living oral history and share his recorded memories with our family.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Gemma:&lt;/strong&gt; Uses &lt;strong&gt;Gemma 3 1B Q4_K_M running locally through Docker Model Runner&lt;/strong&gt; for structured memory extraction, evidence-grounded Q&amp;amp;A generation, and historical "Then vs Now" reflections.&lt;/li&gt;
&lt;/ul&gt;

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