| Name | Type | Description |
|---|---|---|
query* | str | The query string to search for. |
initial_roots | Sequence[str] | Default: ()Optional list of document IDs to use for initializing search.
The top |
k | int | Default: 4Number of Documents to return. Defaults to 4. |
fetch_k | int | Default: 100 |
adjacent_k | int | Default: 10 |
depth | int | Default: 2 |
lambda_mult | float | Default: 0.5 |
score_threshold | float | Default: float('-inf') |
filter | dict[str, Any] | None | Default: None |
**kwargs | Any | Default: {} |
Retrieve documents from this graph store using MMR-traversal.
This strategy first retrieves the top fetch_k results by similarity to
the question. It then selects the top k results based on
maximum-marginal relevance using the given lambda_mult.
At each step, it considers the (remaining) documents from fetch_k as
well as any documents connected by edges to a selected document
retrieved based on similarity (a "root").
Number of initial Documents to fetch via similarity.
Will be added to the nodes adjacent to initial_roots.
Defaults to 100.
Number of adjacent Documents to fetch. Defaults to 10.
Maximum depth of a node (number of edges) from a node retrieved via similarity. Defaults to 2.
Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5.
Only documents with a score greater than or equal this threshold will be chosen. Defaults to -infinity.
Optional metadata to filter the results.
Additional keyword arguments.