Class for interacting with the Vectara API. Extends the VectorStore class.

Hierarchy

Constructors

Properties

FilterType: VectaraFilter
embeddings: Embeddings

Methods

  • Vectara provides a way to add documents directly via their API. This API handles pre-processing and chunking internally in an optimal manner. This method is a wrapper to utilize that API within LangChain.

    Parameters

    • files: VectaraFile[]

      An array of VectaraFile objects representing the files and their respective file names to be uploaded to Vectara.

    • metadatas: undefined | Record<string, unknown> = undefined

    Returns Promise<string[]>

    A Promise that resolves to the number of successfully uploaded files.

  • Parameters

    • Optional _params: Record<string, any>

    Returns Promise<void>

  • Performs a similarity search and returns documents.

    Parameters

    • query: string

      The query string for the similarity search.

    • k: number = 10

      Optional. The number of results to return. Default is 10.

    • filter: undefined | VectaraFilter = undefined

      Optional. A VectaraFilter object to refine the search results.

    Returns Promise<Document<Record<string, any>>[]>

    A Promise that resolves to an array of Document objects.

  • Performs a similarity search and returns documents along with their scores.

    Parameters

    • query: string

      The query string for the similarity search.

    • k: number = 10

      Optional. The number of results to return. Default is 10.

    • filter: undefined | VectaraFilter = undefined

      Optional. A VectaraFilter object to refine the search results.

    Returns Promise<[Document<Record<string, any>>, number][]>

    A Promise that resolves to an array of tuples, each containing a Document and its score.

  • Return documents selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to the query AND diversity among selected documents.

    Parameters

    Returns Promise<Document<Record<string, any>>[]>

    • List of documents selected by maximal marginal relevance.

Generated using TypeDoc