Azure AI Search vector store. To use this, you should have:

  • the @azure/search-documents NPM package installed
  • an endpoint and key to the Azure AI Search instance

If you directly provide a SearchClient instance, you need to ensure that an index has been created. When using and endpoint and key, the index will be created automatically if it does not exist.

Hierarchy (view full)

Constructors

Properties

Methods

  • Performs a hybrid search using query text.

    Parameters

    • query: string

      Query text for the similarity search.

    • Optional queryVector: number[]

      Query vector for the similarity search. If not provided, the query text will be embedded.

    • k: number = 4
    • filter: undefined | AzureAISearchFilterType = undefined

      Optional filter options for the documents.

    Returns Promise<[Document, number][]>

    Promise that resolves to a list of documents and their corresponding similarity scores.

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

    Parameters

    • query: string

      Text to look up documents similar to.

    • options: MaxMarginalRelevanceSearchOptions<this["FilterType"]>

    Returns Promise<Document[]>

    List of documents selected by maximal marginal relevance.

  • Performs a hybrid search with semantic reranker using query text.

    Parameters

    • query: string

      Query text for the similarity search.

    • Optional queryVector: number[]

      Query vector for the similarity search. If not provided, the query text will be embedded.

    • k: number = 4
    • filter: undefined | AzureAISearchFilterType = undefined

      Optional filter options for the documents.

    Returns Promise<[Document, number][]>

    Promise that resolves to a list of documents and their corresponding similarity scores.

  • Performs a similarity search using query type specified in configuration. If the query type is not specified, it defaults to similarity search.

    Parameters

    • query: string

      Query text for the similarity search.

    • k: number = 4
    • filter: undefined | AzureAISearchFilterType = undefined

      Optional filter options for the documents.

    Returns Promise<Document[]>

    Promise that resolves to a list of documents and their corresponding similarity scores.

  • Performs a similarity search on the vectors stored in the collection.

    Parameters

    Returns Promise<[Document, number][]>

    Promise that resolves to a list of documents and their corresponding similarity scores.

  • Performs a similarity search using query type specified in configuration. If the query type is not specified, it defaults to similarity hybrid search.

    Parameters

    • query: string

      Query text for the similarity search.

    • k: number = 4
    • filter: undefined | AzureAISearchFilterType = undefined

      Optional filter options for the documents.

    Returns Promise<[Document, number][]>

    Promise that resolves to a list of documents and their corresponding similarity scores.

  • Static method to create an instance of AzureAISearchVectorStore from a list of texts. It first converts the texts to vectors and then adds them to the collection.

    Parameters

    • texts: string[]

      List of texts to be converted to vectors.

    • metadatas: object | object[]

      Metadata for the texts.

    • embeddings: EmbeddingsInterface

      Embeddings to be used for conversion.

    • config: AzureAISearchConfig

      Database configuration for Azure AI Search.

    Returns Promise<AzureAISearchVectorStore>

    Promise that resolves to a new instance of AzureAISearchVectorStore.

  • Protected

    Ensures that an index exists on the AzureAISearchVectorStore.

    Parameters

    • indexClient: SearchIndexClient

      The Azure AI Search index client.

    Returns Promise<void>

    A promise that resolves when the AzureAISearchVectorStore index has been initialized.

Generated using TypeDoc