💡 Inspiration
I ask AI questions every day: how compound interest works, why I forget things after a late night, what a closure is. The answers are great. A week later, almost all of it is gone. The chat history is still there, but nobody scrolls back through a hundred conversations to review.
Psychology has known why for over a century. Ebbinghaus's forgetting curve shows memory decays roughly exponentially unless it is refreshed:
$$ R(t) = e^{-t/S} $$
where $R$ is the chance of recalling something after $t$ days and $S$ is how stable that memory is. Every well-timed review increases $S$, so the curve flattens.
So I asked: what if every question you ask AI automatically became something you'd remember? That became KnowBack (知回): "What you ask comes back."
🛠️ What it does
- Ask: type, speak or snap a photo. The AI explains clearly.
- Auto knowledge cards: after each answer, KnowBack extracts the key idea, an everyday example and the original question, and files it under the right subject (Coding, Health, Finance…). No note-taking.
- Spaced review: a daily stack of cards, colour-coded by subject. Each card can come up as a flashcard, a multiple-choice question, or an "explain it in your own words" prompt that the AI grades.
- See your knowledge: memory status (strong / steady / fading), a knowledge graph linking related ideas, and a mind map for every card.
- Backy the squirrel: a pet companion who sends at most two gentle push reminders a day, collects pine cones when you review, and grows a beanstalk as you learn.
🧠 How I built it
- Front end: a plain-JavaScript PWA built from ES modules, with no framework and no build step. It is phone-first with a responsive desktop layout and supports 10 interface languages.
- Back end: a small Node.js server (deployed on Render) that proxies model calls. API keys never reach the browser.
- Accounts & sync: Supabase (Postgres plus security-definer RPC functions with row-level security). Learning data stays on the device by default; cloud sync is end-to-end encrypted with the user's own passphrase.
- Scheduling: my own dependency-free implementation of FSRS-5, a modern spaced-repetition algorithm. Its power forgetting curve is
$$ R(t, S) = \left(1 + \frac{19}{81}\cdot\frac{t}{S}\right)^{-0.5} $$
and the next interval is chosen so that recall probability falls to the desired retention $r$ (default $r = 0.9$):
$$ I(r, S) = \frac{81}{19}\, S \left(r^{-2} - 1\right) \quad\Rightarrow\quad I(0.9, S) = S $$
After each review, stability $S$ and difficulty $D$ are updated from the grade (forgot / fuzzy / got it / easy).
- Push reminders: Web Push implemented directly with Node's
crypto(VAPID ES256 plusaes128gcmpayload encryption), because the deploy has nonpm installstep. To keep data private, the server never sees your cards: the phone computes its own reminder times (09:00 if cards are due; 20:00 only if you haven't reviewed that day) and registers only times and counts.pg_cronpings the server every 10 minutes to send whatever is due. - Built with AI: I vibe-coded the project with Claude Code. I acted as product designer and reviewer; Claude wrote and tested most of the code, with about 186 automated tests and 100+ commits.
- Art & video: the mascot and illustrations were generated and kept consistent with LibTV. The promo video is rendered frame by frame from real app recordings, with an original synthesised score.
🚧 Challenges
- Turning chat into clean knowledge. Model answers vary a lot in format. Extraction has to produce one focused card per idea, file it correctly and never invent sources. When extraction fails, the answer is still saved.
- Reminders without spying. Reminders need to know when cards are due, but review data lives on the device. The solution was letting the device plan its own reminder slots and sending the server only times and counts.
- No dependencies, strict security. A Content-Security-Policy with no inline styles, no third-party runtime libraries, and keys that never touch logs or the repo. Writing Web Push encryption by hand meant checking every byte against RFC 8291 and RFC 8292.
- Ten languages done properly. Placeholders, plurals and spacing differ per language. A missing space after a colon in English ("words:SPF") taught me to build sentences with
{placeholders}and add a test that catches the pattern. - Making review feel good, not like homework. Getting colours, motion and Backy's personality right took many iterations, from muted Morandi tones to vivid frosted glass.
📚 What I learned
- How spaced-repetition algorithms actually model memory, and why scheduling matters more than how many times you reread.
- Privacy-first architecture: deciding what the server doesn't need to know.
- Web Push internals, Supabase row-level security, and PWA limits on iOS.
- How to work with an AI pair programmer: clear specs, small verified steps, and always checking the real app on a phone.
🔮 What's next
Real-device testing of push on iOS and Android, friends who review together, and smarter cards that link new questions to what you already know.
Built With
- claude
- claude-code
- css3
- fsrs
- github
- glm-4-flash
- google-docs-api
- html5
- javascript
- jsqr
- libtv
- node.js
- pg-cron
- postgresql
- pwa
- python
- render
- row-level-security
- service-worker
- supabase
- twilio
- web-push
- web-speech-api
- zhipu-ai