Adds documents to the AzureAISearchVectorStore.
The documents to add.
Optional
options: AzureAISearchAddDocumentsOptionsOptions for adding documents.
A promise that resolves to the ids of the added documents.
Adds vectors to the AzureAISearchVectorStore.
Vectors to be added.
Corresponding documents to be added.
Optional
options: AzureAISearchAddDocumentsOptionsOptions for adding documents.
A promise that resolves to the ids of the added documents.
Protected
createProtected
Prepares the search index definition for Azure AI Search.
The name of the index.
The SearchIndex object.
Removes specified documents from the AzureAISearchVectorStore using IDs or a filter.
Object that includes either an array of IDs or a filter for the data to be deleted.
A promise that resolves when the documents have been removed.
Protected
ensureProtected
Ensures that an index exists on the AzureAISearchVectorStore.
The Azure AI Search index client.
A promise that resolves when the AzureAISearchVectorStore index has been initialized.
Performs a hybrid search using query text.
Query text for the similarity search.
Optional
queryVector: number[]Query vector for the similarity search. If not provided, the query text will be embedded.
Optional filter options for the documents.
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.
Text to look up documents similar to.
Number of documents to return.
Number of documents to fetch before passing to the MMR algorithm.
Number between 0 and 1 that determines the degree of diversity among the results, where 0 corresponds to maximum diversity and 1 to minimum diversity.
List of documents selected by maximal marginal relevance.
Performs a hybrid search with semantic reranker using query text.
Query text for the similarity search.
Optional
queryVector: number[]Query vector for the similarity search. If not provided, the query text will be embedded.
Optional filter options for the documents.
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.
Query text for the similarity search.
Optional filter options for the documents.
Promise that resolves to a list of documents.
Performs a similarity search on the vectors stored in the collection.
Optional
filter: AzureAISearchFilterTypeOptional filter options for the documents.
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.
Query text for the similarity search.
Optional filter options for the documents.
Promise that resolves to a list of documents and their corresponding similarity scores.
Static
fromStatic method to create an instance of AzureAISearchVectorStore from a list of documents. It first converts the documents to vectors and then adds them to the database.
List of documents to be converted to vectors.
Embeddings to be used for conversion.
Database configuration for Azure AI Search.
Optional
options: AzureAISearchAddDocumentsOptionsPromise that resolves to a new instance of AzureAISearchVectorStore.
Static
fromStatic 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.
List of texts to be converted to vectors.
Metadata for the texts.
Embeddings to be used for conversion.
Database configuration for Azure AI Search.
Promise that resolves to a new instance of AzureAISearchVectorStore.
Azure AI Search vector store. To use this, you should have:
@azure/search-documents
NPM package installedIf 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.