Embeddings interface for generating vector embeddings from text queries, enabling vector-based similarity searches.
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.
Creates a VectorStoreRetriever
instance with flexible configuration options.
Optional
kOrFields: number | Partial<VectorStoreRetrieverInput<AzureAISearchVectorStore>>If a number is provided, it sets the k
parameter (number of items to retrieve).
Optional
filter: AzureAISearchFilterTypeOptional filter criteria to limit the items retrieved based on the specified filter type.
Optional
callbacks: CallbacksOptional callbacks that may be triggered at specific stages of the retrieval process.
Optional
tags: string[]Tags to categorize or label the VectorStoreRetriever
. Defaults to an empty array if not provided.
Optional
metadata: Record<string, unknown>Additional metadata as key-value pairs to add contextual information for the retrieval process.
Optional
verbose: booleanIf true
, enables detailed logging for the retrieval process. Defaults to false
.
VectorStoreRetriever
instance based on the provided parameters.Protected
createRemoves 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.
Optional
filter?: AzureAISearchFilterTypeOptional
ids?: string | string[]A promise that resolves when the documents have been removed.
Protected
ensurePerforms 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.
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 and their corresponding similarity scores.
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.