asimilarity_search_with_score() — langchain Function Reference
Architecture documentation for the asimilarity_search_with_score() function in base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD b83b1114_c070_167d_53c8_7429b7de5b01["asimilarity_search_with_score()"] 6c336ac6_f55c_1ad7_6db3_73dbd71fb625["VectorStore"] b83b1114_c070_167d_53c8_7429b7de5b01 -->|defined in| 6c336ac6_f55c_1ad7_6db3_73dbd71fb625 37ad19f9_1964_1b28_9306_a16c8d128f6e["_asimilarity_search_with_relevance_scores()"] 37ad19f9_1964_1b28_9306_a16c8d128f6e -->|calls| b83b1114_c070_167d_53c8_7429b7de5b01 style b83b1114_c070_167d_53c8_7429b7de5b01 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/vectorstores/base.py lines 431–448
async def asimilarity_search_with_score(
self, *args: Any, **kwargs: Any
) -> list[tuple[Document, float]]:
"""Async run similarity search with distance.
Args:
*args: Arguments to pass to the search method.
**kwargs: Arguments to pass to the search method.
Returns:
List of tuples of `(doc, similarity_score)`.
"""
# This is a temporary workaround to make the similarity search
# asynchronous. The proper solution is to make the similarity search
# asynchronous in the vector store implementations.
return await run_in_executor(
None, self.similarity_search_with_score, *args, **kwargs
)
Domain
Subdomains
Source
Frequently Asked Questions
What does asimilarity_search_with_score() do?
asimilarity_search_with_score() is a function in the langchain codebase, defined in libs/core/langchain_core/vectorstores/base.py.
Where is asimilarity_search_with_score() defined?
asimilarity_search_with_score() is defined in libs/core/langchain_core/vectorstores/base.py at line 431.
What calls asimilarity_search_with_score()?
asimilarity_search_with_score() is called by 1 function(s): _asimilarity_search_with_relevance_scores.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free