Notebooks
M
MongoDB
Rrf Rsf Demo

Rrf Rsf Demo

advanced_techniquesagentsartificial-intelligencellmsmongodb-genai-showcasenotebooksgenerative-airag

Recipocal Rank Fusion (RRF) and Relative Score Fusion (RSF) Demonstration

Open In Colab

You can view an article that explains concepts in this notebook: View Article

Setup

[ ]
Collecting pymongo
  Downloading pymongo-4.15.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (22 kB)
Collecting dnspython<3.0.0,>=1.16.0 (from pymongo)
  Downloading dnspython-2.8.0-py3-none-any.whl.metadata (5.7 kB)
Downloading pymongo-4.15.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.7 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 41.5 MB/s eta 0:00:00
Downloading dnspython-2.8.0-py3-none-any.whl (331 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 331.1/331.1 kB 18.6 MB/s eta 0:00:00
Installing collected packages: dnspython, pymongo
Successfully installed dnspython-2.8.0 pymongo-4.15.4
[ ]
Connection to MongoDB successful
InsertManyResult([1, 2, 3, 4, 5, 6, 7, 8, 9], acknowledged=True)

Example documents

[ ]

Top closest and top rated

[ ]
[ ]
[ ]

RRF: Reciprocal Rank Fusion

[ ]

Relative Score Fusion

[ ]
[ ]
[ ]
[ ]