ChatGPT Retrieval Plugin: How It Works and Why You Need It

ChatGPT Retrieval Plugin

ChatGPT Retrieval Plugin

ChatGPT faces a tricky challenge: it struggles to answer questions from a secret collection of information. But don't worry, we have a clever solution called ChatGPT retrieval plugin. These cool tools help ChatGPT access data from a database.

For your information, Supabase, a popular platform for developers, has partnered with OpenAI to bring even more improvements to the table. Together, they have introduced a fantastic feature that allows developers to create plugins using pgvector. This partnership brings amazing opportunities for developers to make their apps even better by adding advanced features. It means they can make their apps more impressive and work faster.

When we know how things work, we'll collect important information from the Postgres documents and keep it in the Supabase database. Then, we'll put ChatGPT to the test by asking it questions using that database. Now, let's dive into the details of retrieval plugins. 

What Is ChatGPT Retrieval Plugin?

ChatGPT now has plugins that make it even smarter. These plugins help ChatGPT get the latest information, do calculations, and use extraordinary services.

One of these plugins is called a retrieval plugin. It's like a special helper made with Python. OpenAI ChatGPT retrieval plugin helps bring in outside information to our chats.

If we want to find things in PDF files or Notion knowledge bases, the retrieval plugin can help us. It knows how to search and find the information we need, so we don't have to look for it ourselves.

Here's how it works in brief:

  1. First, it breaks big documents into smaller parts. That way it's easier for ChatGPT to understand.
  2. Next, it uses a special model called OpenAI's text-embedding-ada-002 to change these parts into a simple format.
  3. Then, it saves these simplified parts in a special place called a vector database.
  4. When we ask a question, the retrieval plugin checks the vector database to find the best information that matches the question.
  5. And the best part is, you can choose the database provider you like from a list of options!

So with the help of a retrieval plugin, ChatGPT can find the right information for us by breaking documents into pieces, storing them in a special place, and quickly finding the best answers when we ask questions.

How ChatGPT Retrieval Plugin Works

ChatGPT Retrieval Plugin Function

ChatGPT Retrieval Plugin Function

ChatGPT retrieval plugin makes ChatGPT work even more effective. It uses a special method to find important information and give better answers. Let's take a closer look at how it functions, this time with more details:

Step 1: Asking the right question

When you ask ChatGPT something, the retrieval plugin takes your question and turns it into a special query. This helps it search for the best information that can answer your question.

Step 2: Searching for answers

Next, the plugin looks through a huge database of sources, like news articles, research papers, and other documents. It searches high and low to find the most relevant and helpful information.

Step 3: Giving a great response

Once the plugin finds the right information, it shares it with ChatGPT. ChatGPT then uses that information to generate a response that makes sense and gives you the best answer it can.

The retrieval plugin is efficient because it uses advanced search tricks and understands language really well. That's why it can find the most accurate and helpful information for you quickly. 

Supabase And Postgres As Datastore Options

We have two options for storing our important information: Postgres and Supabase. Let's take a look at the key distinctions between them:

  • Postgres: This option uses a specialized library called psycopg2 in Python to connect directly to the database. It's a good choice if you want a simple and straightforward way to store your data.
  • Supabase: With this option, we interact with the database using PostgREST. It's helpful if you want to add extra security to your data or if you plan to use the stored information for more than just ChatGPT.

Starting with the Postgres option is a great idea because many providers now support pgvector, which is the technology behind it. It means there are more people who can help us and make it work smoothly.

So we have two choices for storing our information, Postgres and Supabase. Postgres is a good place to start, and it's now supported by many providers. It's all about finding the right fit for our needs.

Example With Postgres Docs 

Let's create an example where we can ask ChatGPT questions about the Postgres documentation. Follow these steps:

Step 1: Get the plugin code

First, make a copy of the ChatGPT retrieval plugin from the GitHub website. Save it to your own GitHub account and download it to your computer. Read the instructions in the README.md file to understand how the project is organized.

Step 2: Install what we need

Choose Supabase as the data storage option. Remove any unnecessary parts from the project setup file and pip install Poetry (a special program for managing libraries).

Step 3: Set up Supabase

Follow the provided instructions to set up your Supabase project and database. This will help us store the information we need for the ChatGPT plugin to work. Also, set some environment variables as instructed in the project.

Step 4: Start the Postgres database

To make things easier, you can use a program called Supabase CLI. It will help you set up everything on your local machine. Just install it, go to the appropriate folder in the project, and run a specific command. This will make the Postgres database work on your computer.

Step 5: Get the OpenAI key

You need to get a special key from OpenAI to use their technology. If you already have an account, go to your settings and create a new secret key. Then export OpenAI API key as an environment variable.

Step 6: Run the plugin!

Execute a specific command to start the ChatGPT plugin. This will make it ready to answer our questions based on the stored data.

Step 7: Add data to the storage

In this example, we'll upload the Postgres documentation to the storage. Download the documentation and use a special command to upload it to the plugin. The plugin will automatically break the information into smaller parts for better understanding.

That's it! Now you can ask ChatGPT questions about the Postgres documentation using the plugin.

Enriching ChatGPT With Postgres Knowledge

ChatGPT Retrieval Plugin Postgres

ChatGPT Retrieval Plugin Postgres

To use this plugin with ChatGPT, follow these steps:

  • Open the ChatGPT dashboard and go to the Plugins section. Make sure you have access to ChatGPT Plugins and plugin development.
  • Select the Plugins model in a new chat session. Next, select the options "Plugin store" and "Develop your own plugin".
  • In the domain input, enter localhost:3333. This tells ChatGPT where to find our plugin.
  • Great! Now our plugin is part of ChatGPT. We can ask questions about Postgres and get answers based on the documentation.
  • Let's try it out! Ask ChatGPT when to use "check" and when to use "using." You will see the queries that are sent to our plugin and the responses it gives.
  • After ChatGPT gets a response from the plugin, it will use the information from the documentation to answer your question.

Now you can explore the Postgres documentation with ChatGPT and get helpful answers to your questions.

Benefits Of ChatGPT Retrieval Plugin

This plugin does astonishing things to help you find and use important documents. Let's learn about its features and benefits:

  • Easy searching: You can find the most important parts of your documents by asking questions or expressing your needs in a normal way. No need to use complicated words or phrases!
  • Sharing within organizations: Companies can use this plugin to share important documents with their employees through ChatGPT. It makes it easy to access and use the information you need.
  • Build your own: Developers can create their own version of the plugin and connect it to ChatGPT. This provides them with greater control and adaptability.
  • Special database: The plugin uses a smart technology called OpenAI's text-embedding-ada-002 to understand and store parts of documents. It saves them in a special database, making it quick to find what you need. There are also different options for the database.
  • Filters for relevant results: You can refine your search results by using filters like the source ID, date, author, or other details. This helps you get exactly what you're looking for.
  • Works with different cloud platforms: The plugin can be used on different cloud platforms like Fly.io, Heroku, or Azure Container Apps. It's flexible and can adapt to different setups.
  • Stays up-to-date: The plugin can continuously update the database with new documents using webhooks. It keeps everything fresh and ensures you have the latest information.
  • Remember and retrieve: One special feature of the plugin is that ChatGPT can save important parts of the conversation to the database. This helps ChatGPT remember things and bring them up later. It makes the chat experience more personalized and helpful.
  • Keep things secure: Developers need to be careful with the information they add to the plugin. They should only include what they have permission for and are comfortable sharing. The plugin offers different security options to protect your data.

With these features, the plugin makes it easy to search for documents, share them within organizations, and keep everything secure. Now, you can find what you need quickly and efficiently.

Use Cases For Companies

ChatGPT Retrieval Plugin Use Cases

ChatGPT Retrieval Plugin Use Cases

The ChatGPT retrieval plugin has many useful applications. Here’s how it can help different areas:

  • Customer support: Companies can use the plugin to make their customer support better. It helps them provide accurate and helpful answers to customer questions, solving problems quickly.
  • Content creation: Businesses can use the plugin to create better content. It gives them reliable information on different topics, making their content more trustworthy and informative.
  • Market research: The plugin is handy for market research. It provides external data and insights on industries, trends, and competitors. This helps businesses understand their market better and make smart decisions.
  • Employee training: The plugin is useful for training employees. It helps create training materials by providing accurate information on different subjects. This makes the training process more effective and helps employees learn faster.

With the ChatGPT retrieval plugin, companies can improve customer support, create great content, conduct market research, and enhance employee training.

Conclusion

To sum it all up, the ChatGPT retrieval plugin has awesome features that can make chatbot conversations really smart and customized. With the plugin, companies can make their customer service even better. They can also create content more easily and quickly. For market researchers, the plugin provides lots of useful information about industries, trends, and competitors. And for trainers, it helps them create better training materials.

By following these simple steps, you can easily bring your knowledge base into the ChatGPT datastore and start using it right away. Feel free to reach out for more guidance and tips on maximizing the potential of ChatGPT for your needs.