-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: Add feast rag retriver functionality #5405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
0abf934
to
fc99dd0
Compare
069fe93
to
6873c84
Compare
d986e6b
to
ec5ba98
Compare
Signed-off-by: Fiona Waters <[email protected]>
…ation Signed-off-by: Fiona Waters <[email protected]>
ec5ba98
to
40dfde0
Compare
@@ -163,7 +168,10 @@ ci = [ | |||
"types-setuptools", | |||
"types-tabulate", | |||
"virtualenv<20.24.2", | |||
"feast[aws, azure, cassandra, clickhouse, couchbase, delta, docling, duckdb, elasticsearch, faiss, gcp, ge, go, grpcio, hazelcast, hbase, ibis, ikv, k8s, mcp, milvus, mssql, mysql, opentelemetry, spark, trino, postgres, pytorch, qdrant, redis, singlestore, snowflake, sqlite_vec]" | |||
"transformers>=4.36.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed from here, adding rag to feast[..]
pulls those dependencies.
@@ -107,6 +107,11 @@ postgres = ["psycopg[binary,pool]==3.2.5"] | |||
postgres-c = ["psycopg[c,pool]==3.2.5"] | |||
pytorch = ["torch==2.2.2", "torchvision>=0.17.2"] | |||
qdrant = ["qdrant-client>=1.12.0"] | |||
rag = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rag can also be included in nlp group https://github.com/feast-dev/feast/blob/master/pyproject.toml#L168
What this PR does / why we need it:
This PR adds a FeastRagRetriever that inherits from the HuggingFace Transformers RagRetriever class. It allows for integration with feast functionality allowing RAG to be performed more easily using the Feature Store.
Low Level Design created by @jyejare

The following has been added:
rag_retriever.py (New file)
This module implements a custom RAG retriever by combining Feast feature store capabilities with transformer-based models. The implementation provides:
vector_store.py (New file)
This module implements an abstract VectorStore class, and a FeastVectorStore class that inherits from it. The FeastVectorStore takes in a FeatureStore, FeatureView and features using these to query the store via the existing retrieve_online_documents_v2 function.
setup.py (Additions to existing file)
Adding entries for RAG dependencies allowing for installation with
pip install feast[rag]
.init.py (Additions to existing file)
Adding entries for new classes added in rag_retriever.py and vector_store.py
pyproject.toml (Additions to existing file)
The dependencies required for the RAG implementation have been added here.
The relevant dependencies have also been added to the relevant requirements.txt files.
test_rag.py (New file)
Unit tests to cover the added functionality.
Which issue(s) this PR fixes:
Related to #5391 but get_top_docs has not been implemented here as the FeastIndex is a dummy index - the retrieval functionality exists in the FeastRagRetriever via the FeastVector store which uses
retrieve_online_documents_v2
.Misc