MongoDB RAG Application

R
Renaudil y a 2 jours
0

Description

A RAG chatbot, with LangChain and MongoDB Atlas, with tailored responses and document uploads through AI generation and knowledge retrieval.

npx boilerapp mongodb-rag-app

文档

RAG Based Chat-bot using Langchain and MongoDB Atlas

This starter template implements a Retrieval-Augmented Generation (RAG) chatbot using LangChain and MongoDB Atlas. RAG combines AI language generation with knowledge retrieval for more informative responses. LangChain simplifies building the chatbot logic, while MongoDB Atlas' Vector database capability provides a powerful platform for storing and searching the knowledge base that fuels the chatbot's responses.

Setup

Prerequisites

Before you begin, make sure you have the following ready:

Steps to Deploy

Follow the below-mentioned steps to deploy the app on Vercel.

Step 1: Click below to navigate to the deployment page

Deploy with Vercel

Step 2: Add Environment Variables

Populate the values of the ENV variables mentioned below

OPENAI_API_KEY = "<YOUR_OPENAI_KEY>"              # API Key copied from the OpenAI portal
MONGODB_URI = "<YOUR_MONGODB_URI>"                # Connection URI to MongoDB Instance (This should be automatically created after MongoDB Atlas integration)

Step 3: Deploy

Once you have updated the above values, go ahead and click deploy to deploy the app. Wait for the app to be deployed and start serving traffic.

Step 4: Upload PDF files to create chunks

Head to the Train tab and upload a PDF document.

If everything is deployed correctly, your document should start uploading to your cluster under the chatter > training_data collection.

Your data should now start appearing as below in the collection.

image

Step 5: Create Vector Index on Atlas

Now for the RAG (QnA) to work, you need to create a Vector Search Index on Atlas so the vector data can be fetched and served to LLMs.

Create a search index as below.

  • Let’s head over to our MongoDB Atlas user interface to create our Vector Search Index. First, click on the “Search” tab and then on “Create Search Index.” You’ll be taken to this page (shown below). Please click on “JSON Editor.” image

  • Next input the values as shown in the below image and create the Vector.

    {
      "fields": [
        {
          "numDimensions": 1536,
          "path": "text_embedding\
    

Prix

Gratuit

FREE

评论 (0)

常见问题

常见问题解答 (FAQ)

有问题?我们有答案。如果您找不到想要的答案,请随时联系我们。

Boilerapp 是一个专门用于分享 Boilerplates、入门套件(Starter Kits)和项目模版的开发者社区平台。我们的目标很简单:为您节省初始配置(Setup)的时间,让您可以专注于真正重要的代码。无论您是在寻找简单的代码库还是完整的 SaaS 项目,都能在这里找到。

还有其他问题?

我们的团队随时为您提供帮助。联系我们,我们将尽快回复。

MongoDB RAG Application | BoilerApp