| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This project demonstrates how to use Feast to power a Retrieval-Augmented Generation (RAG) application. The RAG architecture combines retrieval of documents (using vector search) with In-Context-Learning (ICL) through a Large Language Model (LLM) to answer user questions accurately using structured and unstructured data.
Install the necessary packages:
pip install feast torch transformers openaiInitialize and inspect the feature store:
feast applyMaterialize features into the online store:
store.write_to_online_store(feature_view_name='city_embeddings', df=df)Run a query:
feast apply store.write_to_online_store(feature_view_name='city_embeddings', df=df)context_data = store.retrieve_online_documents_v2(
features=[
"city_embeddings:vector",
"city_embeddings:item_id",
"city_embeddings:state",
"city_embeddings:sentence_chunks",
"city_embeddings:wiki_summary",
],
query=query,
top_k=3,
distance_metric='COSINE',
).to_df()
display(context_data)📊 Example Output When querying: Which city has the largest population in New York?
The model provides:
The largest city in New York is New York City, often referred to as NYC. It is the most populous city in the United States, with an estimated population of 8,335,897 in 2022.
| Back | FazBrowse Home | New Git URL |