Skip to content

redsid5/Alaska

Repository files navigation

ALASKA

ALASKA is a veteran-focused encrypted AI assistant for claims, benefits, healthcare, documents, voice, and crisis support.

It is designed to feel like a real personal assistant for a single veteran profile — conversational chat, voice mode, real VA form auto-fill, encrypted storage, task planning, and VA-aware routing — all in one secured dashboard.

The product emphasizes privacy, speed, and practical action:

  • keep sensitive data local and encrypted
  • auto-fill real VA PDFs from the veteran's profile
  • detect crisis language and respond safely
  • use AI to summarize, plan, and organize next steps

Product Goals

  • Make veteran support feel personal, immediate, and trustworthy.
  • Keep sensitive data encrypted in the browser.
  • Turn natural language into filled VA forms, practical actions, and reminders.
  • Support voice-first interaction and conversational follow-up.
  • Provide a single demo-ready experience that feels like a real product.

Core Experience

The app centers around one authenticated veteran profile and a five-tab dashboard.

Main areas:

  • Voice — hands-free conversational AI
  • Chat — text-based assistant with conversational form filing
  • Tasks — planning and scheduling support
  • form_filler.ai — standalone 7-step VA form wizard
  • secure.hub — unified encrypted storage: files, vault, notes, health summary, encryption demo

Product Features

Authentication

  • Sign up and sign in with email and password.
  • Demo login uses a prebuilt veteran identity with realistic profile data.
  • User profile is stored in session storage for the active session.

AI Chat

  • Persistent conversation with AI, encrypted history.
  • VA department routing badges (VBA, VHA, NCA, CRISIS).
  • Conversational form filing — veteran says "file a disability claim" and Alaska prepares the real PDF form inline.
  • Document attachment from vault — 📎 button lets the veteran attach encrypted vault files as chat context.
  • Crisis detection with crisis line routing.

Smart Form Filing (from Chat)

The core differentiator. When a veteran says a triggering phrase in chat:

  1. Alaska detects the intent and loads the real VA PDF from the filesystem.
  2. Gemini Vision reads all AcroForm fields from the PDF.
  3. A deterministic profile mapper pre-fills every matching field from the veteran's profile.
  4. A form card appears inline in the chat conversation showing all fields grouped by section.
  5. Fields show: ✓ auto-filled · ⚠ needs input · ✗ manual required.
  6. Veteran reviews inline, edits any field, uses voice input for narratives.
  7. Veteran says "check it" — Alaska reviews every field and flags issues.
  8. Veteran downloads the filled PDF, saves to vault, or opens the submission guide.

Supported forms: 21-526EZ, 21-0781, 10-10EZ, 22-1990, 20-0995, 10-0998, 21-4142, 21P-530EZ, 10-10D, 21P-527EZ.

form_filler.ai Tab

Standalone 7-step form wizard for when the veteran wants to manually select and fill a form:

  1. Upload or select a VA form
  2. Gemini Vision analyzes and extracts fields
  3. Auto-fill preview from veteran profile
  4. Step-by-step question guide for missing fields
  5. Tips per form
  6. Save to vault
  7. Submission guide with exact VA office addresses

Voice

  • Tap-to-speak microphone interaction.
  • Speech recognition for input.
  • Speech synthesis for spoken replies — the form card speaks to the veteran.
  • Voice mode supports a follow-up conversation style.

Tasks

  • Natural language task input.
  • Auto-detects priority, deadlines, and VA form references.
  • Designed to support planning, scheduling, and follow-through.

secure.hub

Unified security module with five internal sub-tabs:

  • Files — drag-drop upload, AI document analysis, Q&A per file
  • Vault — encrypt and store sensitive documents by type, reveal on demand
  • Notes — encrypted auto-save notes with sidebar
  • Health — blurred medical profile with access log for emergency responders
  • Encryption — live AES-256-GCM encryption demo with ciphertext visualization

Crisis Handling

  • Crisis language is detected before normal AI routing.
  • Critical cases trigger a fullscreen crisis banner with spoken support.
  • Veterans Crisis Line: 988 Press 1 · Text 838255 · veteranscrisisline.net
  • Panic overlay for CRITICAL distress level.

AI Behavior

ALASKA uses AI as a personal assistant, not a generic chatbot.

AI behavior goals:

  • sound human and respectful
  • keep replies short and practical
  • remember prior conversation context
  • explain next steps clearly
  • plan tasks and appointments when asked
  • support panic and emergency flows safely

Provider support:

  • Claude Sonnet 4.6 is the primary provider (Anthropic SDK).
  • Gemini 2.0 Flash is used for file-aware workflows and as fallback.
  • Gemini Vision is used for form field extraction and document analysis.

PDF Form System Architecture

The form pipeline has three parts:

Field extraction (/api/form-pdf-fields):

  1. Read the real PDF from public/ using the filesystem.
  2. pdf-lib extracts all AcroForm field names and types.
  3. A deterministic mapper fills known fields from the profile (name, SSN, DOB, address, service dates, bank info).
  4. Gemini Vision receives the PDF + field list and returns human labels, section groupings, and remaining values.
  5. Results are merged and returned to the front end.

Form display (PDFSmartFormCard):

  • Dynamic card in the chat thread, no static field definitions.
  • Fields grouped by Gemini-determined section names.
  • Inline editing, voice input for narratives, progress bar.

PDF filling (/api/form-pdf-fill):

  • Receives field name → value pairs from the front end.
  • pdf-lib fills TextField, CheckBox, Dropdown, and RadioGroup fields.
  • Returns filled PDF as base64 for browser download.

Backend Design

The backend uses Next.js API routes.

Main routes:

  • /api/ai — main AI orchestration (crisis detection, routing, Claude/Gemini)
  • /api/form-pdf-fields — PDF field extraction with pdf-lib + Gemini
  • /api/form-pdf-fill — AcroForm filling with pdf-lib
  • /api/form-analyze — Gemini Vision document analysis

Request flow for chat:

  1. Receive user text, history, and optional file data.
  2. Run crisis detection.
  3. Run VA department routing.
  4. Build system context from the active profile.
  5. Send the request to Claude (primary) or Gemini (fallback).
  6. Rank and sanitize the response.
  7. Return routing, form cards, and assistant text to the UI.

Security and Privacy

  • Sensitive values are stored encrypted in the browser (AES-256-GCM).
  • Clipboard protection replaces copied content with ciphertext outside the app.
  • Session keys are kept in memory only, never persisted.
  • localStorage is used only for encrypted payloads.
  • Environment secrets are excluded from git via .gitignore.

Technical Stack

Area Technology
Framework Next.js 14 App Router
UI React 18, inline styles + CSS variables
AI (chat) Claude Sonnet 4.6 (primary), Gemini 2.0 Flash (fallback)
AI (forms/files) Gemini Vision 2.0 Flash
PDF manipulation pdf-lib 1.17.1
Encryption Web Crypto API, AES-256-GCM
Voice Web Speech API (recognition + synthesis)
Storage sessionStorage (session), localStorage (encrypted only)
Deployment Vercel

Module Map

App Routes

  • app/page.js — landing and demo login
  • app/dashboard/page.js — main five-tab shell
  • app/api/ai/route.js — AI orchestration (Claude + Gemini)
  • app/api/form-pdf-fields/route.js — PDF field extraction
  • app/api/form-pdf-fill/route.js — PDF form filling
  • app/api/form-analyze/route.js — Gemini Vision document analysis

Components

  • components/ChatView.js — persistent assistant chat with form filing
  • components/PDFSmartFormCard.js — inline PDF form card in chat
  • components/VoiceView.js — conversational voice assistant
  • components/TasksView.js — planning and task tracking
  • components/FormFillerView.js — standalone 7-step form wizard
  • components/SecureHubView.js — unified secure.hub (Files + Vault + Notes + Health + Encryption)
  • components/PanicOverlay.js — emergency panic workflow
  • components/MarkdownContent.js — AI response markdown renderer

Lib

  • lib/encryption.js — AES-256-GCM encryption and encrypted persistence
  • lib/vaForms.js — VA form registry, veteran profile, autoFillField()
  • lib/formTriggers.js — chat intent detection for 10 VA forms + check-it
  • lib/vaRouter.js — VA department routing (VBA/VHA/NCA/CRISIS)
  • lib/crisisDetector.js — crisis language detection
  • lib/panicDetector.js — panic severity classification
  • lib/intentRouter.js — navigation intent routing
  • lib/responseRanker.js — response cleanup and form card extraction
  • lib/clipboardProtection.js — encrypted clipboard

Public

  • public/VBA-21-526EZ-ARE.pdf — Disability Compensation
  • public/VBA-21-0781-ARE.pdf — PTSD Stressor Statement
  • public/VA Form 10-10EZ.pdf — Healthcare Enrollment
  • public/VBA-22-1990-ARE.pdf — GI Bill Education
  • public/VBA-20-0995-ARE.pdf — Supplemental Claim
  • public/VBA-21-4142-ARE.pdf — Release of Records
  • public/VBA-21P-530EZ-ARE.pdf — Burial Benefits
  • public/VA Form 10-10d.pdf — CHAMPVA Dependents
  • public/VBA-21P-527EZ-ARE.pdf — Veterans Pension
  • public/10-0998 online corrected.pdf — Higher-Level Review

Demo Flow

  1. User signs in or chooses the demo account (John Doe, US Army, 100% P&T).
  2. Dashboard loads with five-tab navigation.
  3. User says "file a disability claim" in chat.
  4. Alaska loads the real 21-526EZ PDF, pre-fills 60+ fields from the veteran profile.
  5. User reviews the inline form card, edits as needed.
  6. User says "check it" — Alaska reviews every field and flags issues.
  7. User downloads the filled PDF in one click.
  8. User can also upload documents, chat, use voice, manage tasks, or access secure.hub.

Product Positioning

ALASKA is positioned as a veteran-specific personal assistant with privacy, form automation, and VA-aware guidance built into the product itself.

The goal is not to be a generic chatbot. The goal is to feel like a secure, useful, highly personal support tool for one veteran at a time — one that can actually fill out their paperwork.

No middleman. No breach risk. No 4-hour hold times.

18,000,000 veterans. $23,000,000,000 in unclaimed benefits annually. 4.5 hour average VA phone hold time.

Alaska changes that in 30 seconds.

Releases

Packages

Contributors

Languages