Home / Function/ similarity_search_with_score() — langchain Function Reference

similarity_search_with_score() — langchain Function Reference

Architecture documentation for the similarity_search_with_score() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  c3c9fc15_faf1_7d33_6d98_ed4d55612750["similarity_search_with_score()"]
  6c336ac6_f55c_1ad7_6db3_73dbd71fb625["VectorStore"]
  c3c9fc15_faf1_7d33_6d98_ed4d55612750 -->|defined in| 6c336ac6_f55c_1ad7_6db3_73dbd71fb625
  af56f371_686f_e656_d90d_d283b46d217f["_similarity_search_with_relevance_scores()"]
  af56f371_686f_e656_d90d_d283b46d217f -->|calls| c3c9fc15_faf1_7d33_6d98_ed4d55612750
  style c3c9fc15_faf1_7d33_6d98_ed4d55612750 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/vectorstores/base.py lines 417–429

    def similarity_search_with_score(
        self, *args: Any, **kwargs: Any
    ) -> list[tuple[Document, float]]:
        """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)`.
        """
        raise NotImplementedError

Subdomains

Frequently Asked Questions

What does similarity_search_with_score() do?
similarity_search_with_score() is a function in the langchain codebase, defined in libs/core/langchain_core/vectorstores/base.py.
Where is similarity_search_with_score() defined?
similarity_search_with_score() is defined in libs/core/langchain_core/vectorstores/base.py at line 417.
What calls similarity_search_with_score()?
similarity_search_with_score() is called by 1 function(s): _similarity_search_with_relevance_scores.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free