Lesson 11: Cheat Sheet

Final review

Read this the night before. Then test yourself with Q&A Practice.

One-liners

TopicSay this
What is LAFINA?An offline-first AI student companion for Android that plans with you, talks with you, and calls you when it matters.
Core problemScattered planning tools, plus alert fatigue from easy-to-ignore notifications.
Core ideaProactive simulated calls + a companion students actually use + the student confirms every AI change.
Offline-firstThe phone’s SQLite database is the source of truth. Cloud is optional.
UnderstandingRules first, then an on-device model, then DeepSeek online. Always validated.
SafetyAI proposes, the student confirms. Review cards, revision checks, receipts, Undo.
Reminder callAlarmManager → admission checks → full-screen call → speak → Whisper → acknowledge or snooze.
Call LAFINAStudent-initiated voice chat. Online = ElevenLabs + DeepSeek. Offline = Whisper + rules + phone TTS.
SyncTransactional outbox, version-based conflicts, 7 entity types.
Ask USTPRAG with citations. Offline FTS5, online Pinecone + DeepSeek. “Couldn’t verify” when unsupported.
PrivacyNothing leaves the phone for a guest. Keys on the server. Consent for audio.

Numbers

FactValue
App versionv1.0.7
Minimum Android11 (API 30), target API 36
Architecturearm64-v8a (x86_64 for emulators)
React Native / React / TypeScript0.86 / 19.2 / 5.9
SQLite schema version28
Application tables36
Declared foreign keys3
Sync entity types7
Max synced chats per account20
Fast-path “confident” threshold0.85
Chat agent limits4 steps, 5 tool calls per step
Whisper modelggml-tiny.en-q5_1
Whisper latency targetsMedian ~1.5 s, 95th percentile < 3 s
Reminder: misheard replies before auto-snooze3
Default snooze5 minutes
Reminder lead timeUp to 24 hours
Adaptive timing clamp−30 to +15 minutes, ≥ 5 samples
Offline call20 min max, ends after 3 silent listens, 0.7 s end pause
Push-to-talk end pause~1 s
Themes12 (light and dark variants)
On-device model sizesSmolLM2 ~105 MB · Gemma 3 270M ~253 MB · Qwen 2.5 0.5B ~491 MB · Gemma 3 1B ~806 MB

Names to know

NameWhat it is
whisper.cppOn-device speech-to-text
Silero VADDetects when speech starts and stops
llama.cppRuns GGUF language models on the phone
react-native-ttsPhone’s built-in voice
OP-SQLite / FTS5Local database / full-text search
AlarmManagerAndroid alarm scheduling
PDFBox / ML KitCOR PDF text / image OCR
FastAPI on VercelLAFINA backend
NeonCloud PostgreSQL
DeepSeekOnline conversation and planning help
ElevenLabsOnline voice and live calls
PineconeVector search for the handbook
EWMA, KNN, Random ForestAdaptive reminder timing

Diagrams: what each shows

DiagramShowsKey point
Context (Level 0)LAFINA as one process + Student, DeepSeek, Pinecone, ElevenLabsStores are inside the boundary
Use caseStudent, Android OS, backend → 15 use cases«include» = must, «extend» = optional
DFD Level 18 processes, D1–D7 storesRecord + outbox in one transaction (2.0)
ERD36 tables, 3 declared FKsMost links are logical, enforced in code
ArchitectureAndroid + Electron clients → backend → Neon + AI providersLive voice: signed WebSocket after authorization

Paper vs. app (be ready)

PaperAppWhy
Real phone callSimulated in-app callNo SIM or carrier, works offline
Kokoro TTSPhone TTS + ElevenLabsFaster, lighter
SmolLM2 for everythingRules first, selectable modelsSpeed and predictability
Closed-domain, no chit-chatCompanion with open conversation onlineStudents use a companion daily

If you blank on a question

Fall back on the four ideas: offline-first, the AI proposes and the student confirms, proactive calls, a companion. Most answers start from one of them.