Giter Club home page Giter Club logo

redis-product-search's Introduction

Redis Vector Search Demo Application

This demo showcases the vector search similarity (VSS) capability within Redis Stack and Redis Enterprise. Through the RediSearch module, vector types and indexes can be added to Redis. This turns Redis into a highly performant vector database which can be used for all types of applications.

The following Redis Stack capabilities are available in this demo:

  • Vector Similarity Search
    • by image
    • by text
  • Multiple vector indexing types
    • HNSW
    • Flat (brute-force)
  • Hybrid Queries
    • Apply tags as pre-filter for vector search

Application

This app was built as a Single Page Application (SPA) with the following components:

Some inspiration was taken from this Cookiecutter project and turned into a SPA application instead of a separate front-end server approach.

Datasets

The dataset was taken from the the following Kaggle links.

Running the App

Before running the app, install Docker Desktop.

Redis Cloud (recommended)

  1. Get your Redis Cloud Database (if needed).

  2. Export Redis Endpoint Environment Variables:

    $ export REDIS_HOST=your-redis-host
    $ export REDIS_PORT=your-redis-port
    $ export REDIS_PASSOWRD=your-redis-password
  3. Run the App:

    $ docker compose -f docker-cloud-redis.yml up

The benefit of this approach is that the db will persist beyond application runs. So you can make updates and re run the app without having to provision the dataset or create another search index.

Redis Docker

$ docker compose -f docker-local-redis.yml up

Customizing (optional)

You can use the Jupyter Notebook in the data/ directory to create product embeddings and product metadata JSON files. Both files will end up stored in the data/ directory and used when creating your own container.

Create your own containers using the build.sh script and then make sure to update the .yml file with the right image name.

Using a React development env

It's typically easier to write front end code in an interactive environment, testing changes in realtime.

  1. Deploy the app using steps above.
  2. Install NPM packages (you may need to use npm to install yarn)
    $ cd gui/
    $ yarn install --no-optional
  3. Use yarn to serve the application from your machine
    $ yarn start
  4. Navigate to http://localhost:3000 in a browser.

All changes to your local code will be reflected in your display in semi realtime.

Troubleshooting

Sometimes you need to clear out some Docker cached artifacts. Run docker system prune, restart Docker Desktop, and try again.

Open an issue here on GitHub and we will try to be responsive to these. Additionally, please consider contributing.

redis-product-search's People

Contributors

spartee avatar tylerhutcherson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.