Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Langchain (Python)
_similarity_search_with_relevance_scores( query: str, k: int, **kwargs ) -> List[Tuple[Document, float]]
query
str
k
int
**kwargs
Any
filter
score_threshold
Dict[str, Any]
float
List[Tuple[Document, float]]
# Search with relevance scores and threshold results = store._similarity_search_with_relevance_scores( "machine learning", k=10, score_threshold=0.5 ) print(f"Found {len(results)} documents above threshold") for doc, score in results: print(f"Relevance: {score:.2%} - {doc.page_content[:50]}...")
Was this page helpful?