-
-
GIF
Reading the uploaded annotated page
-
send annotated book page photo through phone
-
manual selection of annotations
-
linking annotations to the printed passage
-
Saving books with annotations and marked passages
-
Saved books
-
Easily find the annotations, printed passages and books
-
Architecture of Commonplace Book
Inspiration
For those who love annotating books, there is no easy way to save the annotations digitally without compromising privacy. Book annotations often contain sensitive or personal information which the reader wouldn't want to be read by a cloud AI.
But now with Commonplace Book, we can save handwritten annotations digitally using Firebase AI Logic Hybrid Inference; On-device model analyses the handwritten notes and cloud model analyses the printed passages. Save the handwritten annotations, printed passages, sticky notes, page tabs by book title and retrieve them easily with Commonplace Book.
What it does

Reads annotated pages of a book (handwritten note, marked printed passages, sticky note, page tab) from a photo automatically or through manual selection and classifies them into handwritten note and printed passage.
Annotated book page photo can be uploaded from phones securely to the desktop web app by scanning a QR code.
Notes can be linked to the marked passage automatically or manually.
On-device model transcribes the handwritten note and the printed passage.
Printed passage is sent to the cloud model on demand for fetching the book details.
Annotated passages with book details can be saved.
Saved books can be retrieved by searching by notes, passages, book title or author.
How I built it (Technical Requirements)

Commonplace Book finds the handwritten notes and marked passages from an annotated book using on-device model for privacy, it sends the printed passages to the cloud model on approval from the user for finding the book details. Commonplace Book uses WebRTC to securely upload photos of book pages to the desktop web application.
Chrome reads the photo through Firebase AI Logic with ONLY_ON_DEVICE. If Chrome mistakes a handwritten note for a printed quotation, it tries once more to read the marked print on device. If that read also fails to identify the printed words, the app leaves the quotation out of the Cloud AI preview. User then needs to manually select the handwritten notes and printed passages by drawing boxes over the book page image which is transcribed by the on-device model. Send to Cloud AI uses the previewed print and header for text enrichment with PREFER_IN_CLOUD.
A subsequent Google Search grounded call uses those clues(without handwritten notes) and any suggested title or author to identify the book. The app shows the edition details when Gemini(cloud) returns a book title and cites at least one web source. It then uses "Google Books API" to get the cover of the book.
Book data along with annotations and the linked marked passages are stored in the Firebase Realtime Database(owner-only) using anonymous accounts.
Note: "How Commonplace Book uses Firebase AI Logic" section in the project repo "README" links to the source files to demonstrate the use of Firebase AI Logic at runtime.
Challenges I ran into
I do not posses Gemini Nano 4 capable Android device, So I built Commonplace Book as a web app and implemented photo upload via WebRTC so that annotated book page photo can easily be uploaded from phones.
Accomplishments that we're proud of
I built Commonplace Book to solve a problem I've faced for a very long time within the stipulated period of the hackathon.
What I learned
Firebase AI Logic Hybrid Inference SDK is very intuitive to build Hybrid AI apps across different platforms.
What's next for Commonplace Book
Monetization of Commonplace Book for the public release.
Built With
- firebase
- firebase-ai-logic-hybrid-inference-sdk
- google-cloud
