docs/adr/ADR-0010-vector-database-integration.md
Accepted
Feast is an abstraction layer for ML infrastructure that integrates with diverse online and offline data sources. With the rise of Large Language Model (LLM) applications, particularly Retrieval Augmented Generation (RAG), there was a need to support:
These capabilities align naturally with Feast's existing concepts of feature views, materialization, and online serving, but required a new retrieval interface for similarity search.
Extend Feast's online store interface with a retrieve_online_documents method that performs approximate nearest neighbor (ANN) search.
Treat embeddings/vectors as features within existing feature views. Add a new retrieval interface to online stores:
class OnlineStore:
def retrieve_online_documents(
self,
config: RepoConfig,
table: FeatureView,
requested_feature: str,
embedding: List[float],
top_k: int,
distance_metric: Optional[str] = None,
) -> List[Tuple[Optional[datetime], Optional[Dict[str, ValueProto]]]]:
...
Online stores that implement vector search:
from feast import FeatureStore
store = FeatureStore(".")
# Retrieve top-k similar documents
results = store.retrieve_online_documents(
feature="document_embeddings:embedding",
query=query_embedding,
top_k=5,
)
retrieve_online_documents method is added to the OnlineStore interface, allowing each store implementation to use its native vector search capabilities.sdk/python/feast/infra/online_stores/examples/rag/, examples/online_store/pgvector_tutorial/, examples/online_store/milvus_tutorial/