A machine learningโpowered(LLM) recommendation system that suggests books based on metadata and semantic embeddings. Built with LangChain, Chroma vector database, and OpenAI embeddings, this project combines classical data analysis with modern NLP techniques.
๐ Features
Content-based recommendations using vector embeddings of book descriptions.
Integration with LangChain + Chroma for efficient similarity search.
Supports semantic querying (beyond exact keyword matches).
Exploratory Data Analysis (EDA) with visualizations to understand book metadata.
Modular pipeline for future extension to collaborative filtering or deep learning models.
๐ Dataset
Source: 7k Books with Metadata (Kaggle)
Cleaned dataset (books_cleaned.csv) with standardized categories and enriched descriptions.
๐ ๏ธ Installation
git clone https://github.com/your-username/book-recommender.git cd book-recommender
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
Dependencies include:
pandas, numpy, matplotlib, seaborn
langchain-community, langchain-openai, langchain-chroma
dotenv for API key management
๐ Environment Setup
Create a .env file in the project root.
Add your OpenAI API key:
OPENAI_API_KEY=your_api_key_here
๐ Usage
Run the Jupyter notebooks to reproduce results:
jupyter notebook
Rec System AI.ipynb โ Data loading, cleaning, and EDA
recom.ipynb โ Embedding generation, vector database setup, and recommendation engine
Example: from langchain_openai import OpenAIEmbeddings from langchain_chroma import Chroma
embeddings = OpenAIEmbeddings() db = Chroma(persist_directory="chroma_store", embedding_function=embeddings)
results = db.similarity_search("space adventure with strong female lead")
๐ Results
Successfully builds a content-based recommender leveraging embeddings.
Demonstrates meaningful semantic similarity between books.
๐ฎ Future Work
Add collaborative filtering (matrix factorization, nearest neighbors).
Experiment with transformer-based models for richer embeddings.
Build a lightweight web app (e.g., Streamlit) for interactive recommendations.
๐ค Contributing
Contributions are welcome! Please fork the repo and submit a pull request. Inspired by freeCodeCamp. ๐ License
MIT License.

