Skip to content

Release v8.0.0

Choose a tag to compare

@austin-denoble austin-denoble released this 16 Jun 21:29

This version of the Pinecone Node SDK depends on version 2026-04 of the Pinecone API. You can read more about versioning here. This v8 SDK release line should continue to receive fixes as long as the 2026-04 API version is in support.

Breaking Changes

Assistant file operations are now asynchronous

The 2026-04 API made all file mutation operations asynchronous. uploadFile and deleteFile now return an OperationModel that tracks the in-progress operation rather than resolving once the file is ready.

uploadFile return type changed

uploadFile previously returned an AssistantFileModel describing the created file. It now returns an OperationModel.

Before (v7):

const file = await assistant.uploadFile({ path: 'report.pdf' });
console.log(file.id);     // file ID, immediately usable
console.log(file.status); // 'Processing' | 'Available' | 'Failed'

After (v8):

const operation = await assistant.uploadFile({ path: 'report.pdf' });
console.log(operation.id);     // operation ID — use this to poll
console.log(operation.fileId); // the file ID being created
console.log(operation.status); // 'Processing' | 'Completed' | 'Failed'

// Poll until the file is ready
let op = operation;
while (op.status === 'Processing') {
  await new Promise((r) => setTimeout(r, 2000));
  op = await assistant.describeOperation({ operationId: operation.id });
}

deleteFile signature and return type changed

deleteFile previously accepted { fileId: string } and returned void. It now accepts a bare fileId: string and returns an OperationModel.

Before (v7):

await assistant.deleteFile({ fileId: 'abc123' });

After (v8):

const operation = await assistant.deleteFile('abc123');
console.log(operation.status); // 'Processing' | 'Completed' | 'Failed'

Features

upsertFile: create or replace a file at a stable ID

Upload a file at a caller-supplied ID. If a file with that ID already exists its content is replaced; otherwise a new file is created. Unlike uploadFile, the ID is stable across calls and metadata is not accepted.

const operation = await assistant.upsertFile({
  assistantFileId: 'openapi-spec',
  path: './openapi-2026-04.yaml',
});

describeOperation and listOperations: poll async file operations

uploadFile, upsertFile, and deleteFile all return an OperationModel immediately. Use describeOperation to check progress on a specific operation, or listOperations to list recent operations across an assistant.

// Poll a single operation
const op = await assistant.describeOperation({ operationId: operation.id });
console.log(op.status);          // 'Processing' | 'Completed' | 'Failed'
console.log(op.percentComplete); // 0–100

// List recent operations (retained for 30 days)
const ops = await assistant.listOperations({
  status: 'Completed',
  limit: 20,
});

Preview: Schema-based indexes and full-text search (alpha)

⚠️ Alpha surface — all pc.preview.* APIs target the 2026-01.alpha API version and are not covered by the SDK's backward-compatibility guarantee. Signatures may change before these operations graduate to stable.

This release introduces pc.preview, a new namespace that exposes Pinecone's alpha control-plane and data-plane APIs for schema-based indexes. Schema-based indexes let you declare your fields, their types, and their embedding models up front rather than inferring them at write time — enabling integrated full-text search alongside dense and sparse vector search.

Creating a schema-based index

import { Pinecone } from '@pinecone-database/pinecone';
const pc = new Pinecone();

const indexModel = await pc.preview.indexes.create({
  name: 'my-schema-index',
  schema: {
    fields: {
      // Full-text search field with integrated BM25 embeddings
      body: {
        type: 'semantic_text',
        model: 'multilingual-e5-large',
      },
      // Dense vector field for ANN search
      embedding: {
        type: 'dense_vector',
        dimension: 1536,
        metric: 'cosine',
      },
    },
  },
  waitUntilReady: true,
});

Upserting documents

Documents are schema-aware records. The only required field is _id; all other fields map to your declared schema, or metadata fields.

const idx = pc.preview.index({ name: 'my-schema-index' });

await idx.upsertDocuments('my-namespace', {
  documents: [
    {
      _id: 'doc-1',
      title: 'Pinecone overview',
      body: 'Pinecone is a vector database for building AI applications.',
      tags: ['vector-db', 'ai'],
    },
    {
      _id: 'doc-2',
      title: 'Getting started',
      body: 'Learn how to create your first index and run a search.',
      tags: ['tutorial'],
    },
  ],
});

Searching documents

Search is driven by a scoreBy array, where each entry specifies a scoring method and the field to score against. You can mix scoring methods in a single request for hybrid search.

// Full-text BM25 search against the `body` field
const results = await idx.searchDocuments('my-namespace', {
  scoreBy: [{ type: 'text', field: 'body', query: 'vector database' }],
  topK: 5,
});

// Dense vector ANN search against the `embedding` field
const vectorResults = await idx.searchDocuments('my-namespace', {
  scoreBy: [{ type: 'dense_vector', field: 'embedding', values: [0.1, 0.2, ...] }],
  topK: 10,
});

// Lucene query string search across all text-searchable fields
const queryStringResults = await idx.searchDocuments('my-namespace', {
  scoreBy: [{ type: 'query_string', query: 'title:(getting started) AND tags:tutorial' }],
  topK: 5,
});

Scoring method types: text (BM25), dense_vector, sparse_vector, query_string (Lucene).

Fetching and deleting documents

// Fetch specific documents by ID
const fetched = await idx.fetchDocuments('my-namespace', {
  ids: ['doc-1', 'doc-2'],
});

// Delete by IDs
await idx.deleteDocuments('my-namespace', { ids: ['doc-1'] });

// Delete by filter
await idx.deleteDocuments('my-namespace', {
  filter: { tags: { $in: ['tutorial'] } },
});

Index management via pc.preview.indexes

The full control-plane is available under pc.preview.indexes: create, list, describe, configure, and delete.

const indexes = await pc.preview.indexes.list();
const model   = await pc.preview.indexes.describe('my-schema-index');

await pc.preview.indexes.configure('my-schema-index', {
  deletionProtection: 'enabled',
});

Bug Fixes

temperature now forwarded on all assistant chat paths

temperature was accepted in ChatOptions and ChatCompletionOptions since v7.1 but was silently dropped in all four chat functions before reaching the wire. It now reaches the API on chat, chatStream, chatCompletion, and chatCompletionStream.

const response = await assistant.chat({
  messages: [{ role: 'user', content: 'Explain this concisely.' }],
  temperature: 0.2,
});

What's Changed

New Contributors

Full Changelog: v7.2.0...v8.0.0