Skip to content
ProvidersPinecone

Pinecone

Reference for the Pinecone adapter, which wraps the Pinecone client and uses native namespaces and metadata filters.

The Pinecone adapter wraps a Pinecone client from @pinecone-database/pinecone. Indexes and namespaces map one to one, so the adapter emulates nothing.

import { Pinecone } from "@pinecone-database/pinecone";
import { createPineconeStore } from "vecstore-sdk/pinecone";

const store = createPineconeStore({
  client: new Pinecone({ apiKey }),
  indexSpec: { serverless: { cloud: "aws", region: "us-east-1" } },
});

Install the client alongside the SDK:

bun add vecstore-sdk @pinecone-database/pinecone

The adapter needs @pinecone-database/pinecone 7 or later, which introduced the object-parameter data plane calls it uses.

Index creation

createIndex needs a deployment spec. indexSpec defaults to serverless on AWS in us-east-1. Pass indexSpec to change it. createIndex waits until the index is ready before it returns.

Delete by filter

Serverless indexes reject delete({ filter }). The adapter returns an unsupported error with feature: "deleteByFilter". To delete matching records, delete by ids instead, or query first and delete the returned ids, repeating until a query returns nothing, since one query returns at most topK matches.

What the adapter stores

ConcernPinecone
IndexIndex
NamespaceNative
IdNative
MetadataMetadata
MetricSet on the index

On this page