You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/core_docs/docs/integrations/vectorstores/memory.ipynb
+52-3
Original file line number
Diff line number
Diff line change
@@ -164,7 +164,7 @@
164
164
},
165
165
{
166
166
"cell_type": "code",
167
-
"execution_count": 4,
167
+
"execution_count": 3,
168
168
"id": "aa0a16fa",
169
169
"metadata": {},
170
170
"outputs": [
@@ -199,7 +199,7 @@
199
199
},
200
200
{
201
201
"cell_type": "code",
202
-
"execution_count": 5,
202
+
"execution_count": 4,
203
203
"id": "5efd2eaa",
204
204
"metadata": {},
205
205
"outputs": [
@@ -232,7 +232,7 @@
232
232
},
233
233
{
234
234
"cell_type": "code",
235
-
"execution_count": 6,
235
+
"execution_count": 5,
236
236
"id": "f3460093",
237
237
"metadata": {},
238
238
"outputs": [
@@ -265,6 +265,55 @@
265
265
"await retriever.invoke(\"biology\");"
266
266
]
267
267
},
268
+
{
269
+
"cell_type": "markdown",
270
+
"id": "423d779a",
271
+
"metadata": {},
272
+
"source": [
273
+
"### Maximal marginal relevance\n",
274
+
"\n",
275
+
"This vector store also supports maximal marginal relevance (MMR), a technique that first fetches a larger number of results (given by `searchKwargs.fetchK`), with classic similarity search, then reranks for diversity and returns the top `k` results. This helps guard against redundant information:"
276
+
]
277
+
},
278
+
{
279
+
"cell_type": "code",
280
+
"execution_count": 6,
281
+
"id": "56817a1c",
282
+
"metadata": {},
283
+
"outputs": [
284
+
{
285
+
"name": "stdout",
286
+
"output_type": "stream",
287
+
"text": [
288
+
"[\n",
289
+
" Document {\n",
290
+
" pageContent: 'The powerhouse of the cell is the mitochondria',\n",
0 commit comments