Lucid — AI study app
Nearly all of the backend behind an AI study app on the App Store: ~30k lines of FastAPI, an OCR-to-LLM document pipeline, and 900+ tests in CI.
- Role
- Co-Founder & Backend Engineer
- Timeline
- 2026 – present
- Status
- Live on the App Store
- Area
- Backend / applied AI
Overview
Lucid is an AI study app that launched on the App Store in June 2026 in 12 languages, with 100+ users and 5 paying customers so far. I co-founded it and wrote nearly all of the backend — OCR upload, semantic search, AI Q&A, flashcards, and quizzes — so students can study against their own notes.
- users
- 100+
- languages
- 12
- API endpoints
- 70+
- tests in CI
- 900+
Problem
Students collect fragmented lecture slides, notes, and screenshots that are hard to search or study from.
Approach
A backend that accepts lecture images, extracts text with OCR, embeds and indexes it, and uses an LLM to answer questions and write flashcards and quizzes from the student’s own material.
01
Upload
Lecture images & notes
02
OCR
Google Vision via Cloud Tasks
03
Embed
OpenAI embeddings
04
Index
pgvector + HNSW
05
Generate
LLM via OpenRouter, with fallback
FastAPI on Cloud Run serves 70+ endpoints. OCR jobs run through Cloud Tasks, and text is embedded with OpenAI and stored in PostgreSQL with pgvector (HNSW). Supabase handles auth and row-level security, generation goes through OpenRouter with a fallback model, and Cloud Build runs migrations and a smoke test on every release.
Outcomes
- Launched on the App Store in June 2026 in 12 languages; 100+ users and 5 paying customers so far.
- Wrote ~30k lines of Python: 70+ FastAPI endpoints and 900+ pytest tests running in CI.
- Shipped on Cloud Run, with Cloud Build running migrations and a smoke test on every release.
- Added JWT auth on Supabase row-level security, per-user rate limiting (100 req/min), SSE streaming, and guest accounts that merge on sign-in.
Challenges
- Noisy lecture content and inconsistent slide quality going into OCR.
- Keeping cost and reliability in check before launch — an audit caught workers re-downloading the whole document for every page.
- Designing AI features that help students study instead of distracting them.
Stack
Python · FastAPI · PostgreSQL · pgvector · Supabase · Google Vision OCR · OpenAI · OpenRouter · Cloud Run · Cloud Tasks · pytest



