Skip to content

feat: Implement and enhance remote document retrieval functionality #5487

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jyejare
Copy link
Contributor

@jyejare jyejare commented Jul 1, 2025

PR includes:

  1. Implements a new request model for remotely retrieving online documents
  2. Updates the feature server to handle document retrieval,
  3. Both V1 and V2 docvuments retrival is implemented
  4. Unit tests to ensure functionality.

jyejare added 5 commits June 26, 2025 23:12
Signed-off-by: jyejare <jyejare@redhat.com>
Signed-off-by: jyejare <jyejare@redhat.com>
Signed-off-by: jyejare <jyejare@redhat.com>
Signed-off-by: jyejare <jyejare@redhat.com>
Signed-off-by: jyejare <jyejare@redhat.com>
@jyejare jyejare requested a review from a team as a code owner July 1, 2025 09:56
@jyejare jyejare changed the title Enhance remote document retrieval functionality Implement and enhance remote document retrieval functionality Jul 1, 2025
@jyejare jyejare changed the title Implement and enhance remote document retrieval functionality feat: Implement and enhance remote document retrieval functionality Jul 1, 2025
@jyejare jyejare force-pushed the remote_retrieve_docs branch from 7d92b04 to 48f27f7 Compare July 1, 2025 10:42
Signed-off-by: jyejare <jyejare@redhat.com>
@jyejare jyejare force-pushed the remote_retrieve_docs branch from 48f27f7 to eb77f31 Compare July 1, 2025 13:31
query_embedding: Optional[List[float]] = None


class GetOnlineDocumentsRequest(BaseModel):
Copy link
Member

Choose a reason for hiding this comment

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

All fields are optional ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we are not passing entities dataframe, yes, everything is optional.

We can make features as non optional though.

top_k: int,
distance_metric: Optional[str] = None,
query_string: Optional[str] = None,
api_version: Optional[int] = 1,
Copy link
Member

Choose a reason for hiding this comment

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

default api_version 2 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I havent tested version 2 in depth for all online stores. BTW Do we have v2 implemented for all stores and confirm stability ?

If not, I think we can go with v1 as stable with opt-in to v2.

response = await run_in_threadpool(
lambda: store.retrieve_online_documents_v2(**read_params) # type: ignore
)
if request.api_version == 2:

Choose a reason for hiding this comment

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

this shouldn't be necessary. v2 vs v1 should be approximately the same where v2 was meant to incorporate more fields. If there is a difference, it's a bug.

Choose a reason for hiding this comment

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

we should remove v1 and move to v2 for all of the existing usage.

Copy link
Contributor Author

@jyejare jyejare Jul 21, 2025

Choose a reason for hiding this comment

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

@franciscojavierarceo Yes, I have seen atleast with postgres online store that v1 and v2 are retrieving different dataframes as the logic is completely different for both versions.

I agree for keeping one solid logic across all stores but only after identifying which is the best version AND THEN we should adapt the best logic having more fields. Finally I think we can remove the bad one and keep single retrieval version.

But I think the investigatin and removal from all stores should not be part of this PR, we should handle that in spearate PR.

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

Successfully merging this pull request may close these issues.

3 participants