Skip to content

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Fiona-Waters
Copy link
Contributor

@Fiona-Waters Fiona-Waters commented May 30, 2025

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
Screenshot 2025-06-04 at 12 26 38

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:

  • A custom RAG retriever (FeastRAGRetriever) that supports three search modes:
    • Text-based search
    • Vector-based search
    • Hybrid search
  • Integration with Hugging Face's transformers library and sentence-transformers
  • Configurable document formatting options

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

@Fiona-Waters Fiona-Waters changed the title [WIP] feat: Add feast rag retriver functionality feat: Add feast rag retriver functionality May 30, 2025
@Fiona-Waters Fiona-Waters force-pushed the ragretriever branch 4 times, most recently from 0abf934 to fc99dd0 Compare May 30, 2025 22:47
@Fiona-Waters Fiona-Waters force-pushed the ragretriever branch 14 times, most recently from 069fe93 to 6873c84 Compare June 5, 2025 12:28
@Fiona-Waters Fiona-Waters force-pushed the ragretriever branch 5 times, most recently from d986e6b to ec5ba98 Compare June 5, 2025 15:54
@@ -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",
Copy link
Member

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 = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants