🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@mastra/pinecone

Package Overview
Dependencies
Maintainers
6
Versions
710
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
This package has malicious versions linked to the ongoing "Mastra AI framework compromise" supply chain attack.

Affected versions:

1.0.2
View campaign page

@mastra/pinecone

Pinecone vector store provider for Mastra

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
6.6K
149.55%
Maintainers
6
Weekly downloads
 
Created
Source

@mastra/pinecone

Vector store implementation for Pinecone, using the official @pinecone-database/pinecone SDK with added telemetry support.

Installation

pnpm add @mastra/pinecone

Usage

import { PineconeVector } from '@mastra/pinecone';

const vectorStore = new PineconeVector({
  id: 'my-pinecone',
  apiKey: 'your-api-key',
});

// Create a new index
await vectorStore.createIndex({ indexName: 'my-index', dimension: 1536, metric: 'cosine' });

// Add vectors
const vectors = [[0.1, 0.2, ...], [0.3, 0.4, ...]];
const metadata = [{ text: 'doc1' }, { text: 'doc2' }];
const ids = await vectorStore.upsert({ indexName: 'my-index', vectors, metadata });

// Query vectors
const results = await vectorStore.query({
  indexName: 'my-index',
  queryVector: [0.1, 0.2, ...],
  topK: 10,
  filter: { text: { $eq: 'doc1' } },
  includeVector: false,
});

Configuration

Required:

  • id: Unique identifier for this vector store instance
  • apiKey: Your Pinecone API key

Optional:

  • controllerHostUrl: Custom Pinecone controller host URL
  • cloud: Cloud provider for new index creation ('aws' | 'gcp' | 'azure', default: 'aws')
  • region: Region for new index creation (default: 'us-east-1')

Features

  • Serverless deployment on AWS (us-east-1)
  • Vector similarity search with cosine, euclidean, and dot product metrics
  • Automatic batching for large upserts (100 vectors per request)
  • Built-in telemetry support
  • Metadata filtering
  • Optional vector inclusion in query results
  • Automatic UUID generation for vectors
  • Built on top of @pinecone-database/pinecone SDK

Methods

  • createIndex({indexName, dimension, metric?}): Create a new index
  • upsert({indexName, vectors, metadata?, ids?}): Add or update vectors
  • query({indexName, queryVector, topK?, filter?, includeVector?}): Search for similar vectors
  • updateVector({ indexName, id?, filter?, namespace?, update }): Update a single vector by ID or metadata filter
  • deleteVector({ indexName, id }): Delete a single vector by ID
  • deleteVectors({ indexName, ids?, filter?, namespace? }): Delete multiple vectors by IDs or metadata filter
  • listIndexes(): List all indexes
  • describeIndex(indexName): Get index statistics
  • deleteIndex(indexName): Delete an index
  • Pinecone Documentation
  • Pinecone Node.js SDK

FAQs

Package last updated on 19 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts