Mastery — Devpost Writeup

Track 1 — Monetizable B2C · AWS Database: Amazon Aurora PostgreSQL (with pgvector) · Deployed on Vercel · #H0Hackathon Live: https://mastery-black-three.vercel.app/

Inspiration

Anyone who has studied for a certification knows the gap: the prep questions never match the material you're actually learning from. Generic question banks are disconnected from your own lecture notes, you can't tell where an answer came from, and they drill you on a flat schedule instead of focusing on what you're about to forget. We wanted prep that is grounded in your own materials, shows its sources, and adapts to how you actually remember — and we wanted to prove the whole loop end to end on a real database, not a mockup.

What it does

Mastery turns your own lecture PDF into adaptive, citation-grounded certification practice:

  1. Pick a goal — AWS Certified Cloud Practitioner (CLF-C02).
  2. Upload a lecture PDF — it's parsed into page-level chunks and embedded.
  3. Generate cited questions — relevant pages are retrieved and turned into multiple-choice questions, each carrying the exact Source: filename p.X it came from.
  4. Study adaptively — every answer feeds an FSRS spaced-repetition engine: miss a card and it returns sooner, know it well and it's pushed further out.
  5. Track mastery — a dashboard reads live from the database to show overall readiness, what's due today, how much of the exam your PDF covers, and a mastery bar per objective.

How we built it

  • Front end + API: Next.js (App Router) deployed on Vercel as serverless functions.
  • Database: Amazon Aurora PostgreSQL with the pgvector extension — the single source of truth. The same database holds relational data (objectives, documents, questions, review logs, mastery) and the vector(512) page embeddings used for semantic search, with an HNSW index for fast similarity queries. No separate vector store.
  • Connectivity: Vercel talks to Aurora over the RDS Data API (HTTPS + SigV4) — no long-lived connections to pool, which fits serverless cleanly.
  • AI: Amazon Bedrock — Titan Text Embeddings V2 (512-dim) for retrieval, and Claude for generating original MCQs grounded only in the retrieved pages.
  • Storage: uploaded PDFs in Amazon S3.
  • Scheduling & mastery: FSRS (ts-fsrs) for due dates, BKT (Bayesian Knowledge Tracing) for per-objective mastery.
  • Auth & billing: Clerk for sessions and Pro-plan gating.

Challenges we ran into

  • One statement per call on the RDS Data API. No multi-statement batches, so migrations and seeds had to be split and each call SigV4-signed by hand — we wrote a small signer instead of pulling a heavy SDK into the serverless bundle.
  • The console Query Editor only supports Aurora Serverless v1. Our cluster uses the Data API but isn't v1, so we proved pgvector usage through CloudShell (SELECT extname FROM pg_extension
    • a count of embedded chunks) rather than the in-console editor.
  • Generation was invisible. MCQ generation runs after ingest as a fire-and-forget job, so the upload UI jumped straight to "ready" while questions were still being written. We added item-count polling so the "generating cited questions" step is actually visible — and a retry path when generation produces nothing.
  • Getting adaptive scheduling to read correctly. We had to clamp FSRS ratings (a wrong answer must never schedule a card as "Easy") and load the due queue by default instead of every card, so the adaptive behavior is honest and obvious on screen.
  • A cold demo with auth. To avoid generating on camera and to show live numbers immediately, we built an idempotent seed script that populates a complete demo account.

Accomplishments that we're proud of

  • A fully working end-to-end loop on real infrastructure: upload → embed → retrieve → generate cited MCQs → study with adaptive scheduling → live mastery dashboard.
  • One database for everything. Relational + vector in a single Aurora PostgreSQL instance via pgvector — simple to reason about and easy to prove.
  • Trustworthy questions. Every item links back to the exact source page, and questions are generated only from retrieved content.
  • Genuinely adaptive review that's legible in one frame — a wrong answer visibly pulls a card sooner, a strong answer pushes it later.

What we learned

  • pgvector in Aurora removes the need for a separate vector database for a RAG-style app — fewer moving parts, one consistency model, one place to back up.
  • The RDS Data API is a great fit for serverless (no pooling) but has real ergonomics tradeoffs worth designing around early.
  • Grounding generation in retrieved chunks — and surfacing the citation in the UI — is what makes AI study content feel trustworthy rather than hallucinated.
  • Spaced repetition (FSRS) and mastery estimation (BKT) are most convincing when the scheduling change is shown to the user immediately.

What's next for Mastery

  • More certifications beyond CLF-C02, with objective auto-mapping.
  • B2B cohort analytics — team readiness and instructor dashboards for bootcamps and enterprise L&D.
  • Deeper grounding — in-PDF highlighting of the cited passage and second-pass groundedness checks.
  • Free-response grading in addition to MCQs.
  • Cost controls — explicit per-generation token/$ budget tracking on top of today's question caps.

Built With

Share this project:

Updates