Skip to content

Latest commit

 

History

History
33 lines (17 loc) · 1.89 KB

README.md

File metadata and controls

33 lines (17 loc) · 1.89 KB

kNN Search with OpenAI

This repo contains files that can be used to setup a functional kNN search (indexing + querying) setup with ReactiveSearch and OpenSearch.

What are Pipelines?

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.

Auto Deployments

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.

Index Pipeline

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

Search Pipeline

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

Frontend

The frontend of this app is built using ReactiveSearch components. These components are used with VueJS in this example.

Read more about the frontend in the frontend directory