Skip to main content
Returns documents selected using maximal marginal relevance to balance relevance and diversity.
Available in Embedded and JS/TS SDK. The Python SDK does not currently support MMR search.

Parameters

Returns

List[Document]: List of diverse, relevant Document objects

Example Usage

By Vector Variant

The Embedded library also provides max_marginal_relevance_search_by_vector for searching with a pre-computed embedding vector:
Parameters:Example:

Async

The Embedded library provides an async version of this method prefixed with a:
JS/TS methods are natively async — all signatures above already return Promise<...>. No separate async variant is needed.