To query the vectorstore, you can use the similarity_search method (or similarity_search_with_score), which takes a query string and returns a list of results:
results = vectara.similarity_score("what is LangChain?")
similarity_search_with_score also supports the following additional arguments:
k: number of results to return (defaults to 5)
lambda_val: the lexical matching factor for hybrid search (defaults to 0.025)
filter: a filter to apply to the results (default None)
n_sentence_context: number of sentences to include before/after the actual matching segment when returning results. This defaults to 0 so as to return the exact text segment that matches, but can be used with other values e.g. 2 or 3 to return adjacent text segments.
The results are returned as a list of relevant documents, and a relevance score of each document.
For a more detailed examples of using the Vectara wrapper, see one of these two sample notebooks:
Chat Over Documents with Vectara
Vectara Text Generation
previous
Unstructured
next
Vespa
 Contents
  
Installation and Setup
Usage
VectorStore
By Harrison Chase
    
      © Copyright 2023, Harrison Chase.
      
  Last updated on Jun 16, 2023.
rtdocs_stable/api.python.langchain.com/en/stable/integrations/vectara.html