This repo contains files that can be used to setup a functional kNN search (indexing + querying) setup with ReactiveSearch and OpenSearch.
Pipelines lets users define flows that are invoked based on paths. These flows can have custom stages (defined using JavaScript) or they can utilize pre built stages to override the default behaviour of a route.
In this example, we are utilizing pipelines to override the index
and search
endpoints to add an extra step that adds vector data based on a few fields and saves it to OpenSearch.
The pipelines are automatically deployed from this repository by using the pipelines-action which uses GitHub Actions to auto deploy the pipelines and does a lot more. Read here.
As explained above, an indexing pipeline is defined that automatically adds vector data for the Text
and Summary
fields and saves them as knn_vector
in OpenSearch. These vectors are calculated using the OpenAI's Embedding API.
Read more about this pipeline in the index directory
The search pipeline is just an usual search pipeline with an extra step to inject the vector data.
Read more about this pipeline in the search directory
The frontend of this app is built using ReactiveSearch components. These components are used with VueJS in this example.