Inspiration

The "I've seen this before" moment. Everyone has lost a detail they'd already captured — the receipt on a lunch table, the licence plate in a parking garage, the expiry date on a medicine box. The information was photographed, recorded, or typed; it just wasn't found again. The failure was never capture, it was retrieval with proof. The existing options all miss the same layer: phone galleries search by name and date only; note apps demand folders and tags at the exact moment you have no patience for them; cloud photo search needs a network, ships private material off the device, and returns "similar images" rather than a verifiable answer; general chat assistants confidently confabulate details that were never captured — and a plausible but wrong medicine expiry date is worse than no answer at all; "smart cleanup" tools decide what's irrelevant on your behalf, where deleting the only blurry photo of a medicine box is an irreversible error. So we built the missing layer: a memory with an evidence rule — one local store for every capture type, retrieval that returns the original as proof, and a forgetting policy where the machine proposes and the human decides. It's a direct fit for the hybrid-AI brief, but with a stricter rule: on-device is the default, and the cloud is a last resort.

What it does

My Memory ("Pocket Knowledge") is a second memory in your pocket, built as a Web/Chrome companion (with Android as the intended primary platform). It has three screens:

  • Save — capture a photo (camera or multi-select gallery import), a voice memo, or a note. No filename, folder, or tag is ever requested. On-device extraction returns structured JSON (summary, entities, expiryDate), and the original is stored read-only beside its embedding.
  • Ask — type a question in plain words. Local search across all capture types finds candidates offline; a short answer comes back with the source capture, date, and match score attached. Every factual claim must resolve to a real capture — otherwise you get "Not found in memory." Long cross-capture synthesis is the only path that escalates to the cloud, and even then it sends only light JSON summaries, never your originals.
  • Forget — a local curator proposes duplicates and expired items, each with a checkable reason and a link to the original. Unique health/safety/blurry captures are protected and never proposed. Nothing is deleted without your decision; approved items go to a 30-day recoverable trash with undo. You can also manually delete one memory at a time, restore it, or permanently delete it behind a stronger confirmation. It's offline-first (capture, index, and short answers work in airplane mode), labels every answer with its true inference source (on-device, cloud, or simulated), supports English/Vietnamese with English as the default, and separates a real Google sign-in from an explicitly labelled Demo mode with seed captures for judging.

How we built it

The Web build is Vite + React + TypeScript + Tailwind, with the pure logic isolated in src/lib/.

  • Hybrid inference via Firebase AI Logic, called at runtime with explicit modes. Ingest extraction uses ONLY_ON_DEVICE (Gemini Nano 4 through Chrome's Prompt API) so a private original is never forwarded to a cloud fallback. Short answers use PREFER_ON_DEVICE; only long synthesis uses ONLY_IN_CLOUD, sending JSON summaries only. The response's inferenceSource — not a guess — drives the on-device vs cloud-synthesised vs SIMULATED label in the UI and the three-counter HUD.
  • A local-first memory index. Original blobs live in UID-partitioned IndexedDB next to a 512-dimension signed lexical embedding with EN/VI synonyms and stopwords — a deliberately explicit local stand-in for the production EmbeddingGemma 2 pin, which puts photos, transcripts, and notes in one searchable space that works offline. A service worker makes reloads work without a network.
  • An evidence gate, not prompt instructions. parseClaims/verifyClaim drop any claim that can't be re-attached to a cited local capture; "no citation, no answer" and "not found is valid" are enforced in code.
  • A proposal-only forgetting engine. Cosine similarity plus extracted expiry dates feed F1 (duplicate) / F2 (expired) proposals; F4 protection filters them regardless of score; a recorded human decision is the only route to trash, which carries trashedAt/purgeAt.
  • Privacy and config boundaries. App Check guards AI Logic; Firestore receives a strict metadata field allowlist under per-user /users/{uid}/captures rules — no blobs, transcripts, or embeddings; Remote Config can tune thresholds and model names but never the forgetting law. Gallery import reads only EXIF DateTimeOriginal (never GPS/device fields), and tags/groups never sync.

Challenges we ran into

The cloud failed in the worst possible way: a correct two-receipt synthesis came back "Not found" after 13.5 seconds. The bug wasn't the model — it was our own verifier, which required every number to appear in every cited capture. We fixed it to verify against the union of cited captures, still fail-closed.

Demo data kept betraying us: eight captures shared one timestamp (5:26:09 PM), two identical lunch receipts double-counted the total, an expired OTP showed in plain text, and the English question chips garbled into "What is the mat password?" The seed turned out to be part of the product.

Vietnamese: Nano doesn't generate Vietnamese on-device, so generation stays in English while retrieval has to stay language-independent.

Accomplishments that we're proud of

The trust rule works live: every answer cites its capture, or the app refuses — asked for a passport number, it answers "Not found in memory" instead of inventing one.

"Total my lunch spending" → 445,000 VND (256,000 + 189,000) in 1 ms, answered locally with both receipts shown as sources.

The Forgetting Lab: an expired OTP stays hidden until a human decides (with a second confirmation before anything is revealed), duplicates are flagged consistently, and Keep / trash / restore work with a 30-day recoverable trash.

What we learned

The verifier matters as much as the model: our nastiest bug was in verification logic, not generation — a correct answer was being thrown away by our own checker.

Local-first is a cost story as much as a privacy story: the cloud only extracts and keeps nothing, so we pay only for inference — and there is no database of anyone's life to steal.

What's next for my-memory

Build the Android companion from the original plan — capture on the phone, same local index — and settle the sync question: metadata-only Firestore sync, or stay single-device.

Built With

Share this project:

Updates

Submission history