[Alpha] Vector Database

Warning: This is an experimental feature. To our knowledge, this is stable, but there are still rough edges in the experience. Contributions are welcome!

Overview

Vector database allows user to store and retrieve embeddings. Feast provides general APIs to store and retrieve embeddings.

Integration

Below are supported vector databases and implemented features:

Vector Database
Retrieval
Indexing

Pgvector

[x]

[ ]

Elasticsearch

[x]

[x]

Milvus

[ ]

[ ]

Faiss

[ ]

[ ]

SQLite

[x]

[ ]

Note: SQLite is in limited access and only working on Python 3.10. It will be updated as sqlite_vec progresses.

Example

See https://github.com/feast-dev/feast-workshop/blob/rag/module_4_rag for an example on how to use vector database.

Prepare offline embedding dataset

Run the following commands to prepare the embedding dataset:

The output will be stored in data/city_wikipedia_summaries.csv.

Initialize Feast feature store and materialize the data to the online store

Use the feature_tore.yaml file to initialize the feature store. This will use the data as offline store, and Pgvector as online store.

Run the following command in terminal to apply the feature store configuration:

Note that when you run feast apply you are going to apply the following Feature View that we will use for retrieval later:

Then run the following command in the terminal to materialize the data to the online store:

Prepare a query embedding

Retrieve the top 5 similar documents

First create a feature store instance, and use the retrieve_online_documents API to retrieve the top 5 similar documents to the specified query.

Configuration

We offer two Online Store options for Vector Databases. PGVector and SQLite.

Installation with SQLite

If you are using pyenv to manage your Python versions, you can install the SQLite extension with the following command:

And you can the Feast install package via:

Last updated

Was this helpful?