Skip to content
shaileshdev4Public

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Decoder

Read between the lines - with honest doubt.

Decoder helps neurodiverse teens interpret ambiguous text messages. Instead of one AI guess, it runs many independent reads, clusters them by meaning, and shows confidence as agreement - with the uncertainty left visible.

Youth Code x AI · Track 03 - AI that actually helps people.

Live: decoder-dun.vercel.app · Try the app · API health


Why this exists

Typical AI chat Decoder
One completion 6–16 independent samples
Model says “I’m 80% sure” Code measures sample agreement
Hides ambiguity Empty bar space = doubt
Feels like a verdict Feels like “here are plausible reads”

Not therapy. Not a diagnosis. A practice tool for messages sent to you, with crisis routing to real helplines when needed.


Judge quick-start

git clone git@github-dev:shaileshdev4/decoder.git
cd decoder
copy .env.example .env          # add ANTHROPIC_API_KEY or GROQ_API_KEY

# Terminal 1 - backend
cd backend
pip install -r ..\requirements.txt
uvicorn server:app --reload --host 127.0.0.1 --port 8001

# Terminal 2 - frontend
cd frontend
npm install
npm run dev                     # open http://localhost:5173

Try on /app: Them: wow great job 🙃 → watch confidence bars converge.

Check URL
UI http://localhost:5173
API health http://127.0.0.1:8001/api/health
Decode app http://localhost:5173/app

Documentation

Doc Audience Contents
ARCHITECTURE.md Judges / technical reviewers System design, pipeline, safety, privacy, diagrams
docs/DEMO.md Demo video / live pitch 3-minute walkthrough script

How it works (30 seconds)

flowchart LR
    A[Message] --> B[Safety check]
    B --> C[N LLM samples]
    C --> D[Cluster by meaning]
    D --> E[Verify cues in text]
    E --> F[Confidence = agreement]
    F --> G[Show bars + doubt]
Loading
  1. Safety first - crisis/distress → helplines, no tone-reading
  2. N independent LLM reads - model never sees previous samples
  3. Python clusters similar meanings and computes confidence
  4. Cue verifier drops readings that cite text not in the message
  5. Abstain when reads don’t agree - or show low-confidence bars
  6. Optional reply coach - one extra LLM call after readings

Details → ARCHITECTURE.md


Project structure

decoder/
├── frontend/     React UI (landing, app, privacy)
├── backend/      FastAPI + decoder_core engine
│   ├── server.py
│   ├── decoder_core/
│   └── tests/
├── ARCHITECTURE.md
├── docs/DEMO.md
└── .env.example

Features

  • Independent multi-sample decode with adaptive budget (6 → 16)
  • Confidence bars + particle convergence animation
  • Screenshot upload (Anthropic vision)
  • Crisis / distress off-ramps with regional helplines
  • On-device voice sample, cues journal, history
  • Rumination guard, dyslexia font, reduce motion
  • Rate limiting, hashed response cache, EXIF strip on upload

Configuration

decoder/.env (copy from .env.example):

Variable Purpose
LLM_PROVIDER anthropic or groq
ANTHROPIC_API_KEY Production + screenshots
ANTHROPIC_MODEL e.g. claude-haiku-4-5
GROQ_API_KEY Fast text-only dev
DECODER_N_SAMPLES Default 16

API

Endpoint Description
GET /api/health Provider, model, sample budget
POST /api/decode-text { "conversation", "voice_sample", "region" }
POST /api/decode-image Multipart screenshot

Tests

cd backend && python -m pytest tests/ -q

45 tests - clustering, safety, abstention, parser, intake.


Deploy

Vercel (frontend) + Railway (backend) — full steps in DEPLOY.md.

Platform Root dir Key env vars
Railway backend/ ANTHROPIC_API_KEY, LLM_PROVIDER, CORS_ORIGINS
Vercel frontend/ VITE_API_URL → Railway URL

Local all-in-one: .\start.ps1 from project root.


Privacy

  • Messages not stored on server after processing
  • API keys server-side only
  • Personalization data on-device (localStorage)

See /privacy in the app or ARCHITECTURE.md - Privacy.


License

MIT - LICENSE

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages