Speed language learning for the ADHD brain. Decipher is a structured language acquisition app built around Tim Ferriss's DiSSS/CaFE methodology — not thematic vocabulary lists and gamification fluff, but the minimum effective dose of grammar and high-frequency vocabulary that actually gets you to conversational fluency.
This is an app concept in active development. French is the trial language. Not yet in production.
French first. Other languages coming.
Duolingo optimizes for daily streaks. Decipher optimizes for getting to 1,200 words as fast as possible — the threshold where French conversation becomes viable.
| Duolingo | Decipher | |
|---|---|---|
| Vocabulary order | Thematic ("travel", "food") | Frequency-ranked (most-used first) |
| Grammar | Implicit, slow emergence | Explicit 20-minute deconstruction up front |
| Speaking practice | Text-to-speech drills | Live AI voice conversation with real-time correction |
| Spaced repetition | Proprietary, opaque | ts-fsrs (open FSRS-5 algorithm) |
| Target user | Anyone who wants to "learn a language" | People with a deadline or a specific fluency goal |
Before touching vocabulary, you complete a 20-minute grammar session using 12 carefully chosen sentences that expose every core structural pattern in French — possessives, object pronouns, question formation, negation, modal verbs, near future, and more. Based directly on the Tim Ferriss DiSSS framework. You come out with a personal grammar cheat sheet, not a textbook.
Vocabulary is sequenced by real-world frequency — you learn de, être, avoir before boulangerie. Each card runs through the open-source FSRS-5 spaced repetition algorithm (via ts-fsrs), so reviews are scheduled based on your actual memory model, not a fixed timer.
A LiveKit Agents pipeline connects you to a real-time AI French tutor. Deepgram handles speech-to-text, Claude plays the tutor (adapting language level to your vocabulary count, correcting errors naturally, using the i+1 method), ElevenLabs delivers natural French TTS. Multiple guided scenarios — Parisian café, street market, asking directions, restaurant, meeting someone at a conference — plus freeform mode.
Designed for ADHD brains — dopamine loops that reinforce actual learning, not just app opens:
- XP with streak bonuses, first-learn bonuses, and mastery bonuses
- Levels 1–8: Absolute Beginner → Tourist → Phrase Hunter → Sentence Builder → Conversationalist → Fluent → Near-Native → Master
- Achievement system across vocab milestones, streaks, conversation, and grammar
- Fluency progress bar — raw word count to conversational (1,200 words), not abstract crowns or gems
- Deadline mode: enter your trip date and see a countdown on your dashboard
- Implemented: landing page, dashboard, vocab queue/session UI, vocab rating API, lightweight FSRS-style scheduling writeback, deconstruction lesson page with completion save, progress page with speaking insights + issue mix trends, speaking scenarios + tracked start/end session flow, LiveKit token minting and in-browser room connect/disconnect controls, participant metadata wiring for learner context, session event capture endpoint for transcript updates, Prisma schema, seed data, LiveKit agent worker scaffold, auth-mothballed local dev user mode.
- In progress: deeper correction extraction quality and production hardening of live orchestration.
- Planned: full onboarding, production voice orchestration, richer progress analytics.
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| Database | PostgreSQL via Prisma 7 |
| Auth | Privy (multi-user), with local dev fallback when Privy env vars are unset |
| Spaced repetition | ts-fsrs (FSRS-5 algorithm) |
| Voice pipeline | LiveKit Agents 1.x |
| Speech-to-text | Deepgram |
| Text-to-speech | ElevenLabs |
| LLM | Claude (Anthropic) |
| Animations | Framer Motion 12 |
| Styling | Tailwind CSS v4 |
Full product research and methodology doc in research/ferriss-language-app.md — covers the DiSSS/CaFE framework in detail, gap analysis vs existing apps, full app spec, and the French-specific implementation plan.
- Node.js 20+
- PostgreSQL database (or Docker)
- API keys for: Anthropic, LiveKit, Deepgram, ElevenLabs
git clone https://github.com/yourusername/decipher.git
cd decipher
npm installCreate a .env file:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/decipher"
# Privy auth (required for multi-user mode)
NEXT_PUBLIC_PRIVY_APP_ID=...
PRIVY_APP_SECRET=...
# Session signing secret for app-owned httpOnly cookie
AUTH_SESSION_SECRET=...
# Local dev fallback identity (used only when Privy vars are unset)
DEV_CLERK_ID=dev-local-user
DEV_EMAIL=dev-local-user@local.dev
# LiveKit (https://livekit.io)
LIVEKIT_API_KEY=...
LIVEKIT_API_SECRET=...
LIVEKIT_URL=wss://your-project.livekit.cloud
# AI services
ANTHROPIC_API_KEY=sk-ant-...
DEEPGRAM_API_KEY=...
ELEVENLABS_API_KEY=...
ELEVENLABS_VOICE_ID_FR=pNInz6obpgDQGcFmaJgB # optional — defaults to AdamFor SSR route protection (/dashboard, /learn/*, /speak, /progress), configure Privy to
issue the privy-token cookie in your environment.
# Option A: start local Postgres via Docker
npm run db:up
# Run migrations
npm run db:migrate
# Seed French vocabulary (top 100 frequency words) + achievement definitions
npm run db:seed
# Optional: stop local Postgres container
npm run db:downThe Next.js app and the voice agent worker run as two separate processes.
# Terminal 1 — Next.js app
npm run dev
# Terminal 2 — LiveKit voice agent worker
npm run agent:devThe Next.js app runs on http://localhost:3000. The /speak page currently shows scenarios and readiness state while room launch/session orchestration is being finalized.
In production:
npm run build && npm start
npm run agent:startHosted worker (recommended, not local):
# one-time
fly auth login
fly launch --name decipher-voice-worker --no-deploy --config fly.worker.toml
# set worker runtime secrets
fly secrets set \
LIVEKIT_URL=... \
LIVEKIT_API_KEY=... \
LIVEKIT_API_SECRET=... \
LIVEKIT_AGENT_NAME=decipher-agent \
DEEPGRAM_API_KEY=... \
ELEVENLABS_API_KEY=... \
ANTHROPIC_API_KEY=... \
-a decipher-voice-worker
# deploy/update worker
fly deploy -c fly.worker.toml -a decipher-voice-worker
fly status -a decipher-voice-worker
fly logs -a decipher-voice-workerSign up → Set goal + deadline → Deconstruction Dozen (20 min)
→ Vocab flashcards (daily, FSRS-scheduled)
→ AI voice conversation practice
→ Track progress to 1,200-word milestone
- Grammar first — the Deconstruction Dozen reveals the grammar framework before you memorize a single word. 20 minutes now saves hours of confusion later.
- Vocab daily — the dashboard surfaces your cards due today. FSRS handles the scheduling; you just rate each card (Again / Hard / Good / Easy).
- Speak early — guided scenarios are designed for beginners. The agent uses only words you're likely to know, plus a few above your current level.
decipher/
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── page.tsx # Landing page
│ │ ├── dashboard/ # Main hub — XP bar, stats, next action CTA
│ │ ├── learn/
│ │ │ ├── vocab/ # FSRS flashcard session
│ │ │ └── deconstruct/ # Deconstruction Dozen lesson content
│ │ ├── api/
│ │ │ ├── vocab/rate/ # Rating writeback + scheduling + XP/streak updates
│ │ │ ├── grammar/complete/ # Deconstruction completion + grammar XP/achievement
│ │ │ └── speak/session/ # Start/end conversation persistence + event capture
│ │ ├── speak/ # Speaking scenarios + session readiness UI
│ │ └── progress/ # Stats + unlocked achievements
│ ├── agent/
│ │ └── index.ts # LiveKit Agents worker — runs as separate process
│ ├── lib/
│ │ ├── db.ts # Prisma client singleton
│ │ ├── livekit/token.ts # LiveKit JWT token minting for room join
│ │ ├── xp.ts # XP constants, level curve, level titles
│ │ └── achievements.ts # Achievement slug definitions
│ ├── data/
│ │ ├── french-top100.ts # Frequency-ordered seed vocabulary (100 words)
│ │ └── deconstruction-dozen.ts # 12 grammar-revealing sentences with notes
│ └── components/
│ └── game/ # XpBar, XpToast, AchievementUnlock
└── prisma/
├── schema.prisma # DB schema
└── seed.ts # Seeds vocabulary + achievement definitions
Planned additions:
src/app/api/...route handlers for live speaking room orchestration and progress writessrc/app/speaklive room launch/session lifecycle UX
The agent worker (src/agent/index.ts) is a standalone LiveKit Agents process. When a user starts a conversation session, the Next.js API creates a LiveKit room and passes user context — known vocabulary, grammar profile, goal type, scenario — via room metadata. The agent picks this up on join and constructs a personalized system prompt that:
- Adjusts the French/English ratio based on vocabulary count (60/40 for beginners, 80/20 intermediate, near-100% advanced)
- Uses only words the learner is likely to know, plus a few at the i+1 level
- Corrects errors naturally by repeating the correct form in context, without pausing to lecture
- Publishes utterances via LiveKit data messages for session logging and error tracking
Voice pipeline:
Deepgram STT → Claude (OpenAI-compat layer) → ElevenLabs TTS
Available conversation scenarios: ordering coffee, meeting someone, shopping at a market, asking for directions, dinner at a restaurant, freeform.
Detailed runtime + debugging guide: VOICE_RUNTIME_ARCHITECTURE.md
Key models:
- User — session identity (
clerkIdfield currently used for local dev identity), XP, level, streak, language config, goal type, deadline - GrammarProfile — Deconstruction Dozen completion status, pattern scores, generated cheat sheet (Markdown)
- LanguageWord — frequency-ranked vocabulary with pronunciation, example sentences, mnemonic hints
- UserVocabulary — per-user FSRS state: stability, difficulty, due date, reps, lapses, state (New/Learning/Review/Relearning)
- ConversationSession — full transcripts, XP earned, accuracy percentage, words encountered, error log
- Achievement / UserAchievement — achievement catalog and per-user unlock records
- StreakEntry — daily streak history for calendar visualization
XP is earned for everything that represents actual learning:
| Action | XP |
|---|---|
| Correct flashcard | 10 |
| First time seeing a word | +20 bonus |
| Word mastered (enters Review state) | 50 |
| 3-in-a-row streak | +15 bonus |
| 5-in-a-row streak | +25 bonus |
| Complete a vocab session | 30 |
| Perfect session (100% accuracy) | 75 |
| Each minute in conversation | 5 |
| Using a word you just learned in conversation | 15 |
| Complete Deconstruction Dozen | 100 |
| 7-day streak | 150 |
| 30-day streak | 500 |
Level thresholds follow an exponential curve: 100 × 1.5^(level-1) XP per level.
French is the trial language. The architecture supports any language:
- Add frequency-ordered vocabulary to
src/data/following theWordSeedtype infrench-top100.ts - Create Deconstruction Dozen sentences for the target language
- Add the language code, flag, and name to
DashboardClient.tsx - Seed the data via
npm run db:seed - Set a voice ID for ElevenLabs in
.env(e.g.ELEVENLABS_VOICE_ID_ES) - Add conversation scenarios to the agent's
SCENARIOSobject insrc/agent/index.ts
This is an early-stage personal project. PRs welcome, especially for:
- Additional language data (vocabulary seeds + Deconstruction Dozen sentences)
- New conversation scenarios in the voice agent
- Progress page and achievement display UI
- Mobile responsiveness improvements
- Onboarding flow (goal setting, deadline entry)
MIT