File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
libs/langchain-mongodb/langchain_mongodb Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -877,6 +877,26 @@ def similarity_search_by_vector(
877877 * args : Any ,
878878 ** kwargs : Any ,
879879 ) -> list [Document ]:
880+ """Return MongoDB documents most similar to the given query vector.
881+
882+ Atlas Vector Search eliminates the need to run a separate
883+ search system alongside your database.
884+
885+ Args:
886+ query_vector: Embedding vector to search for.
887+ k: (Optional) number of documents to return. Defaults to 4.
888+ pre_filter: List of MQL match expressions comparing an indexed field
889+ post_filter_pipeline: (Optional) Pipeline of MongoDB aggregation stages
890+ to filter/process results after $vectorSearch.
891+ oversampling_factor: Multiple of k used when generating number of candidates
892+ at each step in the HNSW Vector Search.
893+ include_embeddings: If True, the embedding vector of each result
894+ will be included in metadata.
895+ kwargs: Additional arguments are specific to the search_type
896+
897+ Returns:
898+ List of documents most similar to the query vector.
899+ """
880900 tuple_list = self .vector_store ._similarity_search_with_score (
881901 query_vector ,
882902 * args ,
You can’t perform that action at this time.
0 commit comments