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.

Worth knowing§
- 77 backend test cases across 8 files, aimed at billing, quotas and sign-in.
- A topic match under 0.55 confidence is dropped rather than shown as a guess.
How it works§
- 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.
- 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.
- 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.
- 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.
- 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.js 16, also used in Time Manager, Squash Review, Jarvis for Projects, and Meridian
- TypeScript, also used in Sisyphus, Time Manager, Squash Review, Jarvis for Projects, Meridian, and Ship It Tracker
- Express
- SQLite (WAL), also used in Datacenter Tracker, Time Manager, Jarvis for Projects, and agento
- Tesseract.js
- Moonshot AI, also used in Ship It Tracker
- React Flow
- Jest
