Skip to content

Expanded Support for Vectara's Search API #2206

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 5 commits into
base: main
Choose a base branch
from

Conversation

Kae7in
Copy link

@Kae7in Kae7in commented Aug 8, 2023

Add support for Context Config, Generative Summarization, and more

This PR gives users of LangChainJS's Vectara integration more fine-grained control over Vectara's Search API.

New similaritySearchWithSummary() method allows for use of Vectara's Generative Summarization feature.

New optional fields on similaritySearch() methods:

  • The contextConfig exposes additional query context properties that the system may use to refine the results.
  • The start field controls the starting position within the list of results.
  • The rerankingConfig enables reranking of results, to further increase relevance in certain scenarios.
  • The summary field allows you to use Vectara's "Gounded Generation", a groundbreaking way of producing generative summaries on top of your own data.

Other additions:

  • An optional similaritySearchWithSummary(...) method has been added to the base VectorStore class, which also paves the way for other Vector databases that might implement similar summarization techniques in the near future.
  • Tests added for all of the above.

About me:

@vercel
Copy link

vercel bot commented Aug 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Aug 20, 2023 4:00am

@dosubot dosubot bot added the auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features label Aug 8, 2023
@@ -212,6 +254,62 @@ export class VectaraStore extends VectorStore {
return documentsAndScores;
Copy link

Choose a reason for hiding this comment

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

This PR adds a new method similaritySearchWithSummary that makes an external HTTP request using fetch to the Vectara API endpoint. This comment is flagging the change for maintainers to review the addition of the new request.

@Kae7in Kae7in changed the title Support for Vectara's Context Config, Generative Summarization, and more Expand Support for Vectara's Search API Aug 8, 2023
@Kae7in Kae7in changed the title Expand Support for Vectara's Search API Expanded Support for Vectara's Search API Aug 8, 2023
@jacoblee93
Copy link
Collaborator

jacoblee93 commented Aug 8, 2023

This is great - do you think this could make sense as a new searchType like MMR on MongoDB?

https://github.com/hwchase17/langchainjs/pull/2170/files

That way, you could initialize a retriever in this mode and it would automatically call similaritySearchWithSummary

If the summary functionality is also possible with specific args to similaritySearch or you don't think it's worth it, let's not add this method to the base class.

@jacoblee93 jacoblee93 self-assigned this Aug 8, 2023
@jacoblee93 jacoblee93 added question Further information is requested close PRs that need one or two touch-ups to be ready labels Aug 8, 2023
@Kae7in
Copy link
Author

Kae7in commented Aug 8, 2023

This is great - do you think this could make sense as a new searchType like MMR on MongoDB?

https://github.com/hwchase17/langchainjs/pull/2170/files

That way, you could initialize a retriever in this mode and it would automatically call similaritySearchWithSummary

If the summary functionality is also possible with specific args to similaritySearch or you don't think it's worth it, let's not add this method to the base class.

Thanks for suggesting this! I'll take a look at this approach soon. I definitely didn't feel great about adding an entire method that will throw an error by default for most VectorStore integrations. I'll see about making this better. Might ping you with some questions.

@danielchalef
Copy link
Contributor

+1 for a new search type. We'll be adding this to Zep soon.

@ofermend
Copy link
Contributor

ofermend commented Aug 16, 2023 via email

@jacoblee93
Copy link
Collaborator

Hey @Kae7in is this ready for review?

@ofermend
Copy link
Contributor

ofermend commented Sep 5, 2023

Hey @Kae7in , @jacoblee93 - any updates on this?
Pls let me know if we can help

@ofermend
Copy link
Contributor

Update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features close PRs that need one or two touch-ups to be ready question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants