Inspiration

Making good flashcards is slow, and remembering them is harder. A memory hook works best when it connects to something you already care about, but writing one for every card takes more effort than most people will put in. AI can do that work, but study notes, exam material and learning goals are personal, and not every request needs to leave your device.

So we built MnemoCard: a study app that uses the on-device model first, falls back to the cloud when it needs to, and builds memory hooks around your interests.

What it does

MnemoCard is an open-source, local-first flashcard and mnemonic app for web, iOS and Android.

  • Generates decks with hybrid AI. Gemini Nano (Chrome and Android) or Apple Foundation Models (iOS) run on your device, with Gemini through Firebase AI Logic as the cloud fallback. Results show where they ran. On the web, cards appear one by one as the model writes them.
  • Makes mnemonics personal. Pick your interests, and the AI is asked to set every memory hook in a scene from one of them. Pick basketball, and sycophant becomes a "psycho fan" in the stands sucking up to the star player.
  • Fills in the gaps. AI can complete empty columns such as definitions, examples, readings and pronunciations.
  • Helps you remember. You can study with FSRS spaced repetition, swipe or scroll through a For You feed, and test yourself. On the web, AI grades written answers by meaning.
  • Fits your material. You can import pasted rows or CSV/TSV files, add images and audio, show math with KaTeX, hear cards read aloud, and explore community decks.

How we built it

  • Web: React 19, Vite and Tailwind CSS
  • iOS: SwiftUI, Apple Foundation Models and Firebase AI Logic
  • Android: Jetpack Compose, ML Kit / AICore and Firebase AI Logic
  • Shared TypeScript packages: @mnemocard/core holds the study logic, including an FSRS v4.5 scheduler with no dependencies. @mnemocard/ai holds the web's prompts, schemas, validation and hybrid inference. The native apps mirror key rules in Swift and Kotlin.
  • Firebase: AI Logic for inference; App Check (reCAPTCHA Enterprise, App Attest and Play Integrity) to protect cloud requests; Remote Config to change models without a redeploy; and Authentication, Firestore, Storage and Hosting
  • Quality: Turborepo, Vitest and GitHub Actions for checks and deployment

Challenges we ran into

  • On-device models have limits. Chrome's model supports output in only a few languages, so in hybrid mode we send other languages to the cloud. On-Device mode never overrides your choice. We also fill cards in smaller batches on-device.
  • Valid JSON isn't always a good answer. A reply can be in the wrong language, put values in the wrong columns or break off halfway. We added structured output, normalizers and per-cell checks. Failed cells are requested again.
  • Streaming structured output. We wanted cards to appear immediately without giving up a single structured JSON reply. We built a scanner that picks out each finished card from the partial response. If the reply breaks off, the finished cards are kept.
  • Optional personalization got ignored. When interests were worded as optional, models fell back to plain sound-alikes. We made the interest-based scene a requirement.
  • Three platforms, three sets of behavior. Model APIs differ across web, iOS and Android, while our deck format and key prompt rules need to stay consistent.
  • Making scrolling feel like touch. On desktop, we mapped wheel movement to the same pull gesture used to rate cards on mobile, with adjustable sensitivity.

Accomplishments that we're proud of

  • Shipping web, SwiftUI and Jetpack Compose apps with hybrid AI
  • Going beyond a "generate" button, with a loop for creating, studying, testing and reviewing cards
  • Showing where AI results ran, so users can see whether a request stayed on their device
  • Streaming editable cards into the web editor without overwriting changes made during generation
  • Backing the app with security rules, App Check, usage limits and tests for the core study and AI logic

What we learned

  • Hybrid AI is a product decision, not just a fallback. Language support, model availability, task size and privacy all affect where a request should run.
  • Prompts need code behind them. Schemas help with structure, but we still had to check the content.
  • Prompt wording matters. "Use interests when helpful" and "every hook must use an interest" lead to very different results.
  • Visible progress matters. Showing what the model is doing and delivering finished cards early is far more useful than a spinner.

What's next for MnemoCard

  • Image generation: create visual mnemonics for each card, based on its memory hook and your interests
  • Fine-tuning: explore tuned models for more vivid, accurate and consistent mnemonics, especially on-device, and compare them with our current prompts
  • Mnemonic evaluation: build a way to score hook quality and learn which hooks actually improve recall
  • Closer platform parity: bring features such as streaming generation to iOS and Android
  • Synced progress: let review history follow you across devices (it currently stays on each device)
  • Offline and language coverage: handle more requests on-device as local models improve

Built With

Share this project:

Updates

Submission history