Skip to content
Nathan Zhou

Ocr-kb-matcher (KIP)

Turns photos and PDFs of study notes into a topic map, flashcards and a review schedule.

Ocr-kb-matcher, or KIP, is a web app for students. Upload notes, past papers or photos of handwritten pages, and the text is pulled out and matched against a graph of the course's topics. Each matched topic is marked as covered and joins a spaced-repetition review queue, with flashcards, a cheat sheet and notes written for it. A Next.js front end talks to an Express API, with SQLite for storage and Moonshot AI for the matching and writing.

Status
A 1.0 beta that runs end to end but is not open to the public yet: it is waiting on the filing a site needs to be hosted in China, payments are not switched on, and two more subject packs are still to come.
From a photo of your notes to a knowledge graph, flashcards, a quiz and a review schedule.

Worth knowing§

How it works§

  1. 01

    The topic match is checked in code, not trusted from the prompt. The model must return topic IDs from your own graph; an unknown ID earns one retry with the full list of valid IDs, and anything still unknown, or matched with under 0.55 confidence, is dropped.

  2. 02

    Only images go through OCR. PDFs, Word and PowerPoint files and plain text are read from their own text layer, so a file that already holds text never picks up OCR errors, and the extracted text is saved before any AI step, so a model failure later loses nothing.

  3. 03

    A match does more than label the upload: matched topics get an estimated mastery level and enter an SM-2 review schedule, then flashcards, a cheat sheet and notes are written for each. One topic failing is logged, and the rest of the job still finishes.

  4. 04

    A worker claims a job with a single SQL statement — update where pending, returning the row — so two workers can never take the same upload, and jobs left mid-run are reset at start-up. It replaced a JSON file store that could race.

  5. 05

    Usage limits are enforced in one conditional update, so parallel requests can't overrun a quota, and calls to the model go through a circuit breaker that opens when more than half of recent calls fail and tries again after 30 seconds.

Built with§

Next project · 08 / 10

Meridian

My design system: 82 React components on one set of tokens, copied into apps by a CLI.

Read it