Pinecone Local is an in-memory Pinecone Vector Database emulator available as a Docker image.

This page shows you how to use Pinecone Local to develop and test your applications locally or in a CI (continuous integration) pipeline without connecting to a Pinecone cloud account or incurring usage or storage fees.

Pinecone Local is suitable only for local development and testing. Records loaded into Pinecone Local do not persist after it is stopped. See Limitations and Unsupported features for details.

Pinecone Local is in early access.

Before you begin

  • Make sure Docker is installed and running on your local machine.

  • Pinecone Local works with Python SDK v4.1.2 or later, Node.js SDK v3.0.x or later, Java SDK v2.1.0 or later, and Go SDK v1.1.1 or later.

    If you are using an older SDK version, upgrade to the latest version as follows:

1. Start Pinecone Local

Copy the following code to a file and save it as docker-compose.yaml:

services:
  index1:
    image: ghcr.io/pinecone-io/pinecone-index:latest
    platform: linux/amd64
    environment:
      PORT: 5081
      INDEX_TYPE: serverless
      DIMENSION: 2 
      METRIC: cosine
    ports:
      - "5081:5081"
  index2:
    image: ghcr.io/pinecone-io/pinecone-index:latest
    platform: linux/amd64
    environment:
      PORT: 5082
      INDEX_TYPE: pod
      DIMENSION: 2 
      METRIC: dot-product
    ports:
      - "5082:5082"

In this file, each service defines an index that Pinecone Local will create on startup. For each index, update the environment variables as needed:

  • PORT: Specify the port number for the index to listen on.
  • INDEX_TYPE: Specify the type of Pinecone index to create. Accepted values: serverless or pod.
  • DIMENSION: Specify the dimension of vectors you will store in the index.
  • METRIC: Specify the distance metric for calculating the similarity between vectors in the index. Accepted values: cosine, euclidean, or dot-product.

To start Pinecone Local, run the following command:

docker compose up -d

You’ll see a message with details about each index, including the port it listens on:

 ✔ Container pclocal-index1-1                                                                                                                            Created0.1s 
 ✔ Container pclocal-index2-1                                                                                                                            Created0.1s 
Attaching to pclocal-index1-1, pclocal-index2-1
pclocal-index1-1  | 2024-09-11T17:55:01 [INFO] - Serving a serverless pinecone index with dimension 2 and metric cosine on port 5081
pclocal-index2-1  | 2024-09-11T17:55:01 [INFO] - Serving a pod pinecone index with dimension 2 and metric dot-product on port 5082

2. Develop and test your app

Reading and writing data to Pinecone Local works the same as when using a Pinecone cloud account. However, note the following differences:

  • Pinecone Local does not authenticate client requests. No API key is required for Go and curl. For Python, Node, and Java, an API key must be passed, but the value does not matter.

  • To target an index, you must specify its host and port number. It is not possible to target an index by name.

Be sure to review the limitations and unsupported features of Pinecone Local before using it for development and testing.

Example

3. Stop Pinecone Local

Pinecone Local is an in-memory emulator. Records loaded into Pinecone Local do not persist after Pinecone Local is stopped.

To stop and remove the Docker containers for Pinecone Local, run the following command:

docker compose down

Limitations

Pinecone Local has the following limitations:

  • Pinecone Local is available only as a Docker image.
  • Pinecone Local is an in-memory emulator and is not suitable for production. Records loaded into Pinecone Local do not persist after it is stopped.
  • Pinecone Local does not authenticate client requests. API keys are ignored.
  • Pinecone Local is based on the 2024-07 stable API. There are no Pinecone Local versions for other versions of the API.
  • Max number of records per index: 100,000

Unsupported features

Pinecone Local does not currently support the following features:

Was this page helpful?