Full-Text search using Lucene's standard (BM25) analyzer
Recursively cast values in a dict to a form able to json.dump
Prepare a query for vector search based on the embedding type.
This function checks if the embedding is an AutoEmbeddings instance. If it is, the query is returned as-is (string) for server-side embedding. Otherwise, the query is embedded using the embedding model's embed_query method.
MongoDB Atlas vector store integration.
MongoDBAtlasVectorSearch performs data operations on text, embeddings and arbitrary data. In addition to CRUD operations, the VectorStore provides Vector Search based on similarity of embedding vectors following the Hierarchical Navigable Small Worlds (HNSW) algorithm.
This supports a number of models to ascertain scores, "similarity" (default), "MMR", and "similarity_score_threshold". These are described in the search_type argument to as_retriever, which provides the Runnable.invoke(query) API, allowing MongoDBAtlasVectorSearch to be used within a chain.
Hybrid Search Retriever combines vector and full-text searches weighting them the via Reciprocal Rank Fusion (RRF) algorithm.
Increasing the vector_penalty will reduce the importance on the vector search. Increasing the fulltext_penalty will correspondingly reduce the fulltext score. For more on the algorithm,see https://learn.microsoft.com/en-us/azure/search/hybrid-search-ranking