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_score( query: str, k: int = 4, filter: Optional[Dict[str, Any]] = None, **kwargs ) -> List[Tuple[Document, float]]
query
str
k
int
filter
Optional[Dict[str, Any]]
**kwargs
Any
List[Tuple[Document, float]]
# Search with scores results = store.similarity_search_with_score("neural networks", k=3) for doc, score in results: print(f"Score: {score:.4f}") print(f"Content: {doc.page_content[:100]}...") print(f"Metadata: {doc.metadata}") print("---") # Filter results by score threshold threshold = 0.7 high_score_results = [ (doc, score) for doc, score in results if score >= threshold ]
Was this page helpful?
Contact support