Skip to main content

Pinecone

RAG Pipeline Quickstart with Pinecone

Approximate time to complete: 5-10 minutes, excluding prerequisites

This quickstart will walk you through creating and scheduling a pipeline that collects data from an Amazon S3 bucket, creates vector embeddings using an OpenAI embedding model, and writes the vectors to your Pinecone search index.

Before you begin

Before starting, ensure you have access to the credentials, connection parameters, and API keys as appropriate for the following:

Step 1: Create a Pinecone Index

  1. Navigate to the Pinecone application console ↗.

  2. Go to the Indexes section from the left sidebar, under Database. Click the Create Index button on the top right.

    Indexes Overview

  3. In the Create a new index page, enter the following details:

    • Index Name: Enter the name of your index (e.g., my-test-index).
    • Dimensions: Set the dimension size to 1536, for the quickstart we'll use the OpenAI v3 small embedding model at 1536 dimensions.
    • Metric: Select the similarity metric (e.g., cosine).

    Index Configuration

  4. Choose Severless for the Capacity mode (the default option), then click Create Index to complete the process.

    Capacity Mode

  5. Once the index is created, you'll be redirected to the index overview page. Click on the API keys item in the left menu.

    Index Overview

  6. To configure an integration with Vectorize, you'll need an API key. Click Create API key.

    API Keys

  7. In the Create a new API key window, enter a name for the key (e.g., testkey) and click Create API key.

    Create API Key

  8. After creating the key, click the copy icon next to the key to copy it and store it safely. You'll need it for accessing the index through the API.

    Copy API Key

Step 2: Create a RAG pipeline

Set Up Pipeline and Vector Database

  1. Open the Vectorize Application Console ↗
  2. From the dashboard, click on + New RAG Pipeline under the "RAG Pipelines" section.

New RAG Pipeline

  1. Enter a name for your pipeline. For example, you can name it quickstart-pipeline. Then Click on + New Vector DB to create a new vector database.

Name Pipeline

  1. Select Pinecone from the list of vector databases.

    New Vector DB

  2. In the Pinecone configuration screen, enter a descriptive name for the Pinecone integration, then follow the desired authentication approach.

Authentication

There are two options for configuring your Pinecone integration:

  1. Use your Pinecone API key.
  2. Use Pinecone Connect.
Authenticate with your Pinecone API key
Finding Required Information in Pinecone
  1. Enter the integration name and your Pinecone API key, then click Create Pinecone Integration.

    Pinecone Vector Database Connector Configuration

To find your Pinecone API Key:

  1. Log in to your Pinecone Console.
  2. Navigate to the API Keys section.
  3. Copy your API key or generate a new one if needed.

Pinecone API Key Location

Authenticate via Pinecone
  1. Enter the integration name, then click Authenticate with Pinecone.

    Pinecone Vector Database Connector Configuration

  2. Log in to your Pinecone account.

Pinecone Vector Database Connector Configuration

  1. Confirm the organization and project, then click Authorize.

Pinecone Vector Database Connector Configuration

  1. Click Create Pinecone Integration.

Pinecone Vector Database Connector Configuration

  1. Specify the Pinecone index, and optionally specify the Pinecone namespace.

Pinecone Index and Namespace

Configure AI Platform

  1. Click on + New AI Platform.

    Configure Pinecone

  2. Select OpenAI from the AI platform options.

    New AI Platform

  3. In the OpenAI configuration screen:

    • Enter a descriptive name for your OpenAI integration.

    • Enter your OpenAI API Key.

      Select OpenAI

  4. Leave the default values for embedding model, chunk size, and chunk overlap for the quickstart. Then click Next: Source Connector(s) to continue.

    Configure OpenAI

Add Source Connector

  1. Click + Add source connector to add a source connector to your pipeline.

    Set Embedding Model

  2. Choose Amazon S3 from the list of source connector options.

Select Amazon S3

  1. In the Amazon S3 configuration screen:
    • Name your integration. It can be the same as your bucket name, but it doesn't have to be.
    • Enter your Bucket Name exactly as it appears in AWS.
    • Provide the Access Key and Secret Key for your AWS IAM user.

Configure S3

  1. Accept the default values for file extensions and other options.
  2. Click Save Configuration.

S3 Pipeline Configuration

Finalize Pipeline Creation

  1. After configuring the S3 integration, you should see it listed under Source Connectors.
  2. Click Next: Schedule Pipeline to continue.

Confirm S3 Integration

  1. Set the schedule type and frequency for the pipeline.
  2. Leave the default values for the pipeline schedule for now.
  3. Click Create RAG Pipeline.

Configure Pipeline Schedule

Monitor Pipeline Creation and Backfilling

  1. After clicking Create RAG Pipeline, you will see the pipeline creation progress.
  2. The stages include:
    • Creating pipeline
    • Deploying pipeline
    • Starting backfilling process

Creating Pipeline

  1. Once the pipeline is created and deployed, it will begin the backfilling process.
  2. You can monitor the pipeline status and view the progress of document ingestion and vector creation.
  3. If your S3 bucket is empty, the pipeline will show 0 Documents, 0 Chunks, and 0 Vectors.

Pipeline Backfilling

Step 3: Upload Files to Your S3 Bucket

Prepare Sample Data

  1. Download the friends-scripts.zip file from the following location:

Download: Friends Scripts (ZIP file)

  1. After downloading the friends-scripts.zip file, extract it to a location on your local machine.
  2. On most operating systems, you can do this by right-clicking the zip file and selecting Extract All or Unzip.

Upload Files to S3

  1. Log into your AWS S3 account and navigate to the Buckets section.
  2. Filter to find your bucket by typing its name in the search bar.
  3. Click on your bucket name to open the detailed bucket view.

Find Your Bucket

  1. Click on the Upload button in the top right corner of the bucket's detail view.

Open Bucket

  1. You can either drag and drop the extracted files from the friends-scripts directory into the upload area, or click on Add files to browse your local machine and select them manually.

    Click Upload

  2. After adding the files, you should see them listed under the Files and folders section of the upload screen.

  3. Once you've confirmed that all the files are listed, click on the Upload button at the bottom of the screen to start the upload process.

    Your files will now be uploaded to your S3 bucket.

Files Listed for Upload

Verify Pipeline Processing

  1. Within a few seconds after the upload is complete, you should see the content of your files start to populate in the RAG pipeline.
  2. The backfilling process will show progress as it reads and processes the documents from your S3 bucket.

Backfilling Progress

  1. Total Documents and Total Chunks will increase as the documents are embedded and processed.
  2. You can track the number of documents being embedded and vectors being written.
  3. After a minute or two of processing, you should see the total number of uploaded documents reflected in the pipeline's statistics.
  4. If you used the Friends Scripts documents as recommened, you will see 228 documents displayed in the Total Documents field.

Uploaded Documents Processed

Step 4: Play with Your Data in the RAG Sandbox

Access the RAG Sandbox

  1. From the main pipeline overview, click on the RAG Pipelines menu item to view your active pipelines.

Open RAG Pipeline Menu

  1. Find your pipeline in the list of pipelines.
  2. Click on the magnifying glass icon under the RAG Sandbox column to open the sandbox for your selected pipeline.

Open RAG Sandbox

Query Your Data

  1. In the sandbox, you can ask questions about the data you've ingested.
  2. Type a question related to your dataset in the Question field. For example, "What characteristics define the relationship between Ross and Monica?" if you're working with the Friends TV show scripts.
  3. Click Submit to send the question.

Ask a Question

Review Results

  1. After submitting your question, the sandbox will retrieve relevant chunks from your vector database and display them in the Retrieved Context section.
  2. The response from the language model (LLM) will be displayed in the LLM Response section.
    • The Retrieved Context section shows the chunks that were matched with your question.
    • The LLM Response section provides the final output based on the retrieved chunks.

Retrieved Chunks and LLM Response

  1. You can continue to ask different questions or refine your queries to explore your dataset further.
  2. The sandbox allows for dynamic interactions with the data stored in your vector database.

That's it! You're now able to explore your data using the RAG Sandbox.

Was this page helpful?