langchain-ai / langchain-google

MIT License
112 stars 138 forks source link

Feature Request: Support for Fetching Previous/Next Segments in VertexAISearchRetriever #502

Closed lgesuellip closed 1 month ago

lgesuellip commented 1 month ago

Hey Team,

I am working on this feature to support fetching previous/next segments in VertexAISearchRetriever.

I worked at Pampa Labs, and we discussed this feature on the Langchain Ambassadors slack channel. Erick Friis suggested tagging you @lkuligin.

Description

Currently, the VertexAISearchRetriever from langchain_google_community does not support fetching previous and next segments of documents for unstructured data. This is crucial for us to improve the quality of the fetched documents for our LLM.

The Google Discovery Engine API, including its Python library google.cloud.discoveryengine_v1beta, directly supports fetching previous and next segments. Relevant documentation can be found here.

Request

Note

We are not addressing chunk support at this time, as it will be handled as a separate project.

lkuligin commented 1 month ago

SGTM

Would you like to send a PR, please?