feast icon indicating copy to clipboard operation
feast copied to clipboard

Support retrieve_online_documents with embedding function

Open HaoXuAI opened this issue 1 year ago • 5 comments

We can pass an optional embedding function to retrieve_online_documents to embed data first then retrieve top k documents.

E.g,

    def retrieve_online_documents(
        self,
        feature: str,
        embedding: func,
        query: Union[str, List[float]],
        top_k: int,
        distance_metric: Optional[str] = None,
    ) -> OnlineResponse:
      if query is string and embedding:
             embedded_query = embedding(query)
      return retrieve_online_documents(..., embedded_quer)

HaoXuAI avatar Aug 27 '24 04:08 HaoXuAI

@franciscojavierarceo @tokoko let me what you think

HaoXuAI avatar Aug 27 '24 04:08 HaoXuAI

Yeah I like this idea! We could just come up with an opinionated way to do this with HuggingFace as an extra? We could call it feast[genai] or something that reduces friction for getting setup even further?

franciscojavierarceo avatar Aug 27 '24 09:08 franciscojavierarceo

One concern from me is... in a client-server execution (using feature server), would this function be applied on the client-side or the server-side? If it's server-side, passing an arbitrary function to this method is a problem. We usually store these kinds of user-provided functions in the registry, don't we? This seems like a bit of a deviation in that sense, or maybe I don't understand what the function does exactly.

tokoko avatar Aug 27 '24 10:08 tokoko

I imagine it would look like the demo and it would happen server side. Maybe instead of an arbitrary function we could just have things configurable and make it correspond to a transformer or an OpenAi call.

We can discuss today at community call!

franciscojavierarceo avatar Aug 27 '24 11:08 franciscojavierarceo

One concern from me is... in a client-server execution (using feature server), would this function be applied on the client-side or the server-side? If it's server-side, passing an arbitrary function to this method is a problem. We usually store these kinds of user-provided functions in the registry, don't we? This seems like a bit of a deviation in that sense, or maybe I don't understand what the function does exactly.

maybe we can do just the client side. not sure how the server works in feast, but my use case is just apply embedding before the vector be used.

HaoXuAI avatar Aug 29 '24 04:08 HaoXuAI

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 26 '25 03:04 stale[bot]