max_marginal_relevance_search() — langchain Function Reference
Architecture documentation for the max_marginal_relevance_search() function in test_similarity.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 0f64a7f0_7bec_0ab6_59b2_2c7d67d0e7b1["max_marginal_relevance_search()"] 2b1e88c6_438d_574a_4554_475753fefd62["DummyVectorStore"] 0f64a7f0_7bec_0ab6_59b2_2c7d67d0e7b1 -->|defined in| 2b1e88c6_438d_574a_4554_475753fefd62 style 0f64a7f0_7bec_0ab6_59b2_2c7d67d0e7b1 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/example_selectors/test_similarity.py lines 49–62
def max_marginal_relevance_search(
self,
query: str,
k: int = 4,
fetch_k: int = 20,
lambda_mult: float = 0.5,
**kwargs: Any,
) -> list[Document]:
return [
Document(
page_content=query,
metadata={"query": query, "k": k, "fetch_k": fetch_k, "other": "other"},
)
] * k
Domain
Subdomains
Source
Frequently Asked Questions
What does max_marginal_relevance_search() do?
max_marginal_relevance_search() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/example_selectors/test_similarity.py.
Where is max_marginal_relevance_search() defined?
max_marginal_relevance_search() is defined in libs/core/tests/unit_tests/example_selectors/test_similarity.py at line 49.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free