Organizing My Library with Semantic Search
My reading is organized by labels on Goodreads. While this manual classification system has served me well, it relies entirely on my subjective categorization at the moment of reading.
Inspired by this post by Joel Lehman, I explored a different way to organize my readings based on "the vibe" or semantic feeling of the text.
I exported my most recent Goodreads dataset and processed it using Python and vector embeddings. This method converts the title, author, my custom shelves and my personal reviews into vectors, so I can query my library using abstract concepts rather than traditional genre tags.
Approach
I used the sentence-transformers library, a framework for generating dense vector representations of text.
The first step was importing the Goodreads export with pandas and cleaning the bookshelves column. The raw data contains administrative tags generated by the platform, such as "to-read" and "currently-reading", which don't reflect the thematic content or "vibe" of a book. A filtering function strips these labels, so only my custom genre tags (e.g. "history-bio", "life-hack") remain.
Then I built a composite "rich text" field for each entry by concatenating the title, author, cleaned tags and my personal rating. This string is the input for the all-MiniLM-L6-v2 transformer model, which converts it into a high-dimensional vector, or embedding. To retrieve results, the system calculates the cosine similarity between the vector of a search query and the vectors of the books, ranking them by proximity.
Thematic alignment
The model captures the thematic essence of my reading list when the query is conceptually distinct. Searching for "philosophical books that make me question reality" retrieved titles that align closely with my own perception of the genre:
- Thoughts of a Philosophical Fighter Pilot
- Why Buddhism Is True
- The Mind's I: Fantasies and Reflections on Self and Soul
The semantic search synthesizes my custom tags, such as "philosophy" and "mind", with the semantic content of the titles. The Mind's I is particularly validating, as it is explicitly concerned with the nature of consciousness.
Similarly, a query for "books about startups" yielded an accurate list, led by Zero to One and The $100 Startup. These are on my "business" shelf, and the model correctly identified their focus on new ventures rather than general economics.
The limits of semantic interpretation
While the model excels at explicit topics, it struggles with idiomatic or cultural concepts. This becomes evident when querying for "beach reads".
In common language, a beach read is a light, engaging book suitable for a vacation. The model instead interprets the query literally, looking for connections to beaches and shores:
- Kafka on the Shore
- The Liberator: One World War II Soldier's 500-Day Odyssey from the Beaches of Sicily to the Gates of Dachau
- Dune
Kafka on the Shore might arguably fit a vacation mood, but The Liberator is a historical account of World War II, included only because of "Beaches of Sicily" in the subtitle. Dune likely appears because of its desert setting, despite being a dense work of science fiction.
Lexical overlap vs. thematic vibe
The same pattern appeared in other queries. Searching for a "fast-paced thriller with high stakes" returned Thinking, Fast and Slow by Daniel Kahneman, a dense work on psychology and behavioral economics. The model prioritized the word "Fast" in the title over the meaning of "fast-paced" as a genre descriptor.
The query "cozy aesthetic with happy ending" returned Marketing Aesthetics: once again, the model latched onto a word in the title, although a book on brand management offers little in the way of a cozy narrative.
Final thoughts
Applying NLP to my reading history succeeded in clustering books with clear subject matter, such as philosophy and business, reinforcing the usefulness of my original shelves. It faltered with abstract vibes and idioms.
I plan to improve the tool in 2026 to get recommendations from my "to-read" shelf, and to clear as much as I can of a backlog of 369 books.