AI エージェント向け: ドキュメントインデックスは https://www.mongodb.com/ja-jp/docs/llms.txt で利用できます。すべてのページの markdown バージョンは、いずれかの URL パスに .md を追加することで利用できます。
Docs Menu

MongoDB ベクトル検索でローカル RAG 実装を構築

このチュートリアルでは、APIキーやクレジットを必要とせずに、検索拡張生成 (RAG)(RAG)をローカルに実装する方法を説明します。RG の詳細については、RAG、「 MongoDBでの検索拡張生成(RAG) 」を参照してください。

具体的には、次のアクションを実行します。

  1. Atlas のローカル配置の作成。

  2. 環境を設定します。

  3. ローカル埋め込みモデルを使用してベクトル埋め込みを生成します。

  4. データにMongoDB ベクトル検索インデックスを作成します。

  5. ローカル LLM を使用して、データに関する質問に答えます。

このチュートリアルには、一般的な前提条件に加えて次の要素が必要です。

In this section, you load an embedding model locally and generate vector embeddings by using data from the sample_airbnb database, which contains a collection called listingsAndReviews.

This code might take several minutes to run. After it's finished, you can view your vector embeddings by connecting to your local deployment from mongosh or your application using your deployment's connection string. Then you can run read operations on the sample_airbnb.listingsAndReviews collection.

sample_airbnb.listingsAndReviewsコレクションでベクトル検索を有効にするには、 MongoDB ベクトル検索インデックスを作成します。