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
- Full text search
- JSON storage
This app was built as a Single Page Application (SPA) with the following components:
- Redis Stack: Vector database + JSON storage
- FastAPI (Python 3.8)
- JWT authentication using OAuth2 "password flow" and PyJWT
- Pydantic for schema and validation
- React (with Typescript)
- Redis OM for ORM
- Docker Compose for development
- MaterialUI for some UI elements
- React-Bootstrap for some UI elements
- react-admin for the admin dashboard
- Using the same token based authentication as FastAPI backend (JWT)
- Pytorch/Img2Vec and Huggingface Sentence Transformers for vector embedding creation
Some inspiration was taken from this Cookiecutter project and turned into a SPA application instead of a separate front-end server approach.
The dataset was taken from the the following Kaggle links.
The easiest option to run locally is to use the following docker-compose file to launch the prebuilt container hosted on GitHub.
version: '3.7'
services:
redis-vector-db:
image: redis/redis-stack:latest
ports:
- 6379:6379
- 8001:8001
backend:
image: ghcr.io/spartee/redis-vss-fashion:v0.2.0
environment:
DEPLOYMENT: "dev"
REDIS_DATA_URL: 'redis://redis-vector-db:6379'
REDIS_OM_URL: 'redis://redis-vector-db:6379'
REDIS_HOST: 'redis-vector-db'
REDIS_PORT: 6379
expose:
- "8888"
ports:
- "8888:8888"
depends_on:
- "redis-vector-db"
To launch, run the following
docker compose up
in same directory asdocker-compose.yml
- Navigate to
0.0.0.0:8888
in a browser
More to come here
More to come here