This quick project was built as a part of a talk on semantic search to demonstrate the difference between traditional keyword search and semantic search in the context of movies. The goal is to showcase how semantic search can provide more relevant and accurate results compared to simple keyword-based search which most websites like IMDb offer.
Follow these instructions to set it up locally.
- NodeJS
- NPM
- Docker
-
Clone the repository.
-
Install the required packages in both the client and the server directories:
npm install
-
Set up the movie database:
- Ensure you have a dataset of movies. You can use an existing dataset or ask for a DB URI from Nedwize
-
Run the application on Docker with
docker compose
:docker compose up
-
Add the following environment variables in a
.env
file in the server directory.MONGO_DB_URI= CHROMA_DB_URI=http://localhost:8000 CHROMA_DB_CREDENTIALS= CHROMA_DB_AUTH_PROVIDER=chromadb.auth.token_authn.TokenAuthenticationServerProvider
-
Trigger the
/api/movies/feed
API to create vector embeddings of the movie dataset. (Feel free to search and tweak with theBATCH_SIZE
variable to batch embeddings creation according to your specs, I set it to100
on a Macbook Pro M1 16GB) -
Test the application out.
- Access the application through your web browser at
http://localhost:3030
. - Enter a search query in the search bar.
- Toggle between
Boring Search
andCool Search
to see the difference in results.
Feel free to raise a PR! Your help is appreciated. Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Open a pull request.
If you have any questions or feedback, feel free to open an issue.
Happy Searching!
- Deploy on a subdomain