Skip to content

Pinecone

StartKit.AI seamlessly integrates with Pinecone, a vector database that’s essential for building and scaling AI applications.

You can think of Pinecone as your AI’s memory. It’s where the AI stores extra textual data to be retrieved later. This is sometimes referred to as “Retrieval Augmented Generation” (RAG) or simply “embeddings”.

You can read more about RAG in our advanced guide here.

Pinecone is recommended but not essential, so if you don’t want to setup Pinecone right now then you can skip this step.

Setup Pinecone

  1. Visit Pinecone’s website: https://pinecone.io

  2. Create an Account: Follow the prompts to create a new account. You’ll need to provide some basic information about yourself and your organization.

  3. API Key: Once your account is set up, you will be provided with an API key.

  4. Add the API Key to the .env file:

PINECONE_API_KEY=<your_key>
  1. You’ll also need to create a Pinecone index. Simply click the blue “Create Index” button in the Pinecone dashboard.

Name the index whatever you like, and set the dimensions to 1,536. For more info about embedding dimensions, check out our guide for RAG.

Pinecone Index Setup

Select the Serverless capacity mode, and click “Create Index”.

Config .env

  1. Copy the URL of your new Pinecone instance and add that to the .env file.

Pinecone Index Setup Done

PINECONE_INDEX_HOST=https://startkit-ai-798f24b.svc.apw5-4e34-81fa.pinecone.io

In order to secure requests, the Pinecone connection needs a bearer token. We use a random 32 character string for this. This script will create a random 32 character string and adds it to your .env file:

Terminal window
sed -i.bak "s/^EMBEDDINGS_BEARER_TOKEN=.*/EMBEDDINGS_BEARER_TOKEN=$(openssl rand -base64 24 | tr -dc A-Za-z0-9 | head -c 32)/" .env

Installing Python and Poetry

To query Pinecone we’re using an open-source library built by OpenAI called their chatgpt-retrieval-plugin. This is what ChatGPT uses itself for fetching and storing it’s memory.

This library requires python, pip, and poetry to be installed on your system. If you’re running OSX or Linux you probably already have python and pip installed. But if not you can install them from the python website here.

Once you have pip installed you can use it to install poetry:

pip install poetry

Now the plugin will run automatically when you run StartKit.AI for the first time.

Done!

Done! StartKit.AI will now use your Pinecone index for it’s memory!