Inspiration

The Problem: We live in an age of overwhelming choice. We are bombarded with thousands of choices every day: what books will we read, movies will we watch, and experiences will we explore? Yet, most people spend more time searching for the best choice than enjoying this precious time. Current recommendation systems are either too shallow or too opaque, often failing to capture the nuance of individual taste and deliver quick recommendations.

What it does

Our Mission: Serif makes discovery personal. By combining a custom-built recommendation engine with the natural language capabilities of large language models, Serif delivers an interactive, swipe-based experience that helps users connect with content that genuinely resonates. Our goal is to replace content fatigue with joy and meaningful connection.

Serif’s current iteration allows users to record a log of books they have read, rating the books with both a numerical scale and natural language. Serif’s backend then uses readers’ logs as well as other preferences they have specified to curate book recommendations for them. Want to try something different one day? Fear not, because Serif’s recommendation algorithm is adaptive to the user’s unique mood and preferences every time they look for a recommendation. That means you’ll be able to find something different when you’re looking for it.

How Serif’s swipe-based recommendation system works (broadly): When a user wants to receive a recommendation, they are given a list of genres, themes, or other aspects of books that they have historically liked. If the user likes those themes, they can swipe right to accept them (or left to reject them). Every time a user swipes right, they are given another set of book traits, which narrows down the recommendation search. After three right swipes in a row, Serif can track down a book that the user would enjoy. Using the swipe system, Serif can take into account the unique themes, genres, or book traits a user might be looking for at any given time.

How we built it

Backend: Python, OpenAI’s GPT-4.1-mini for trait extraction and explanation generation

We used a Flask-flavor Python web framework called WebPy-Framework (Made by our team member Carl: https://webpy-framework.rtfd.io). We used MongoDB for the database and integrated our application with PropelAuth for secure OAuth sign-ins.

Similarity Engine: Cosine similarity across a 40-dimensional trait space (genre, tone, theme, etc.)

Learning System: Adaptive reinforcement model with streak-based rate modulation, aversion filters, and decay over time

Frontend: Clean UX in with structured prompt pipelines

Data Storage: MongoDB NoSQL db

Serif – Algorithm Overview

Serif is an AI-powered experience engine that learns what users love and matches them with books that truly resonate. Serif is more than a recommender; it’s a dynamic system that learns with every swipe, rating, and review. Our goal is to replace endless scrolling and generic algorithms with something human, adaptive, and deeply personal.


How Serif Works

At the heart of Serif is a trait-based recommendation engine augmented by large language models (LLMs) and grounded in continuous machine learning feedback loops.

We represent both users and books as structured profiles — each composed of meaningful traits like:

  • Genre (e.g. fantasy, mystery)
  • Tone (e.g. dark, uplifting)
  • Themes (e.g. grief, identity)
  • ...

Each trait is assigned a value from 0 to 1 using a Large Language Model, forming a multi-category vector that expresses personal taste or narrative style.

Example (simplified):

{
  "genre": { "fantasy": 0.8, "romance": 0.1 },
  "tone": { "dark": 0.9, "hopeful": 0.2 },
  "themes": { "identity": 0.7, "grief": 0.6 }
}

Matching Algorithm: Cosine Similarity + Penalties

To find the best matches, we convert these profiles into flat numerical vectors and use cosine similarity:

$$ \text{similarity}(u, b) = \frac{u \cdot b}{|u| \cdot |b|} $$

This yields a base match score between 0 and 1 — a measure of how closely the book’s traits align with the user’s evolving taste.

We refine this score with two psychologically-informed penalties:

A. Novelty Penalty

Avoids recommending books too similar to recent ones:

$$ \text{score} = \text{base} - \lambda \cdot \max_i(\cos(b, r_i)) $$

Where \(r_i\) are recent match vectors.

B. Aversion Penalty

Reduces score if a book emphasizes traits the user dislikes:

$$ \text{penalty} = \sum_{\text{trait}} \left( \text{book}_t \cdot (1 - \text{user}_t) \right) \quad \text{if } \text{user}_t < 0.2 $$


Learning from Swipes

Each swipe updates the user's profile:

  • Positive swipe:

$$ u_{\text{new}} = u + r(b - u) $$

  • Negative swipe:

$$ u_{\text{new}} = u - r \cdot b $$

Where the learning rate \(r\) depends on:

  • Swipe consistency streak
  • System’s confidence in the match

Each trait also has a learned importance weight, amplified if it influences behavior repeatedly.


Learning from Reviews & Ratings (LLM-enhanced)

Serif uses GPT-4.1-mini to extract trait prominence from free-form reviews.

Example review:

"It was slow but beautiful. The characters felt real and I loved the emotional depth."

Extracted traits:

  • slow-burn → 0.9
  • lyrical → 0.8
  • grief → 0.7
  • identity → 0.6

These values are used to fine-tune both the user profile and the book profile.


Dynamic Taste Modeling

Component Math / Logic Purpose
Cosine similarity See above Base match score
Streak-based learning rate \(r = \min(\text{BASE} \cdot (1 + \text{streak}), \text{MAX})\) Faster learning for strong patterns
Review impact \(\Delta u = 0.2 \cdot \text{prominence} \cdot \text{confidence} \cdot (b - u)\) Feedback from free-form reviews
Decay \(u = u - \delta\) Natural evolution of taste over time
Trait weighting \(w_t \in [0.05, 2.0]\) Prioritize impactful traits

Match Explanations (LLM-generated)

Serif uses GPT to generate vivid, spoiler-free match explanations like:

"Blending themes of identity and grief with a dark yet lyrical tone, this story explores what it means to be human in a broken world."

These explanations reflect both the book and the user profile to build trust and engagement.


Tech Stack

  • Language Model: OpenAI GPT-4.1-mini for trait extraction and explanation
  • Similarity Engine: scikit-learn cosine similarity + dynamic weighting
  • Learning Engine: Python-based adaptive logic
  • Backend: Flask-based Python server backend (webpy-framework) executing via WSGI
  • Frontend: web-based interface using vanilla web technologies ported as a PWA for mobile

Why This Matters

Serif replaces algorithmic guesswork with a genuine sense of discovery by listening, adapting, and explaining. Every swipe, every review, every moment in Serif builds a deeper understanding of who the user is and what they love. Tailored by AI. Just for you.

Challenges we ran into

Working within time New tech e.g. MongoDB

Implementing the algorithm into the backend. It was difficult to come up with the algorithm as it had to integrate pure mathematical schemes (such as vector/tensor comparison) with NLP and probabilistic and relatively unreliable and unstructured sources of information coming from LLMs. The hardest part of the Serif algorithm pipeline was transforming natural language into vectors which could be used in recommendation calculations.

Accomplishments that we're proud of

Implemented a fully functioning trait-based taste engine from scratch

Developed LLM-driven review analysis that dynamically updates user and book profiles

Created an explainable AI system that communicates “why” a match was chosen in natural language

Made an elegant interface for exploration — minimal scrolling, maximal insight

Built a hackathon-ready MVP that could realistically scale to other domains

What we learned

This was our first time using this particular tech stack, so we ran into the usual bumps of adapting to new technologies. While we had experience with webpy-framework and PropelAuth before, we decided to try using MongoDB as our database this time because our project had a lot of unstructured data that wouldn’t work in a relational database scheme like SQL. Additionally, while we did use Bootstrap as our frontend framework, we gave ourselves a challenge by using a lot of custom styling, which allowed us to give Serif a more modern look.

We also learned more about the intersection of mathematics and CS, especially with regards to machine learning. While researching techniques for developing the recommendation algorithm, we learned about different ways to vectorize real-world objects (like books, for example) to give them semantic meaning in a mathematical context. Methods like cosine similarity (discussed above) allowed us to perform intuitive operations on these tensors (in this case, calculating their similarities relative to each other).

This hackathon also taught us how to work under pressure. We decided to join a day late (we started Saturday), and so we had to learn how to work efficiently. We were luckily able to work for 24 hours (almost totally consecutively) and we used AI integrations like Github Copilot to our advantage, offloading less intensive tasks to the LLM.

What's next for Serif

Serif is built to scale. Its core algorithm is media-agnostic and ready to expand beyond books to movies, music, podcasts, games, and live events. With a swipe-based UX and an evolving user taste model, Serif is designed for the future of personalized media discovery. We also believe Serif is monetizable without being annoying. Rather than relying on intrusive ads, we envision a system where publishers, studios, and creators promote their content to precisely matched audiences based on deep taste alignment, not brute-force exposure. That means discovery remains organic, trust is preserved, and creators reach the people most likely to love their work.

Beyond content, Serif has the power to connect people through taste. Imagine a group of friends struggling to agree on a movie; Serif can enable a rapid-fire, swipe-based group session where everybody’s feed is tailored to the group, and a match appears only when everyone swipes right. Since Serif continuously tracks and refines your preferences, it can power thoughtful moments in everyday life: helping you with better gift ideas or developing a better understanding between friends. When people understand each other’s tastes, relationships grow stronger. Serif makes that easier, too.

Serif's source code can be found on GitHub.

Built With

Share this project:

Updates