DEV Community

Cover image for Quick tip: Using SingleStoreDB with ChatGPT to answer questions about the 2022 Winter Olympics
Akmal Chaudhri for SingleStore

Posted on • Updated on

Quick tip: Using SingleStoreDB with ChatGPT to answer questions about the 2022 Winter Olympics

Abstract

The training data cutoff for ChatGPT-3 was in September 2021. It has limited knowledge of events after that date. However, OpenAI provides an example notebook of how ChatGPT's knowledge could be extended to answer questions on events after September 2021. The example used is the 2022 Winter Olympics. In the example from OpenAI, the new data are kept in memory. However, we could use SingleStoreDB to provide long-term memory for ChatGPT.

Introduction

Two previous articles focussed on using SinglestoreDB with OpenAI:

  1. Quick tip: Using OpenAI Embeddings Search with SingleStoreDB
  2. Quick tip: Using OpenAI with SingleStoreDB to store and query vectors of Fine Food Reviews

Using the strategies and approaches described, we can provide ChatGPT with knowledge of new events after September 2021.

The code is straightforward using the methods described in the two previous articles. We need to:

  1. Replace the section marked 2. Search of the OpenAI notebook with the section marked 2. Search of the SingleStoreDB notebook.
  2. Include several extra libraries/imports as shown at the beginning of the SingleStoreDB notebook.

The SingleStoreDB notebook code can also be used standalone to demonstrate SingleStoreDB's ability to store and query vector data.

There are a variety of ways to use SingleStoreDB, such as:

  • SingleStoreDB Cloud. Create a free trial account. No credit card details are required.
  • SingleStoreDB Self-Managed. Install the software yourself and available in several editions, such as Standard and Premium.
  • SingleStoreDB Dev Image. A Docker image that provides a quick and easy way to get started with SingleStoreDB.

The two previous articles described how to use a local self-managed installation and how to use the cloud, respectively. In a future article, we'll use Docker.

Summary

Using the replacement SingleStoreDB code, we can inform ChatGPT of events after September 2021 and provide it with long-term memory.

Top comments (0)