Repository navigation
v9.1.0 lets a document index embed text for you, so Pinecone can embed a field's text on write and your query text on search. Read responses now report billed egress, the client retries transient connection failures, and HTTP 413 has its own error class. It targets the same 2026-07 API as v9.0.0, and nothing is removed or renamed.
What's new
Integrated embedding in document indexes
Declare embed (dense) or sparseEmbed (sparse) on a string field, upsert plain text, and search with query text. Pinecone embeds documents and queries with the same hosted model. (guide, e06adb9)
import { Pinecone } from '@pinecone-database/pinecone';
const pc = new Pinecone();
// Declare a string field that Pinecone embeds for you.
await pc.indexes.create({
name: 'articles',
schema: { fields: { body: { type: 'string', embed: {} } } },
waitUntilReady: true,
});
// Write plain-text documents; Pinecone embeds each body.
const documents = pc.index('articles').namespace('en').documents;
await documents.upsert({
documents: [
{ _id: 'a1', body: 'Aqueducts carried water by gravity' },
{ _id: 'a2', body: 'The Colosseum seated 50,000 people' },
{ _id: 'a3', body: 'Hypocausts heated the public baths' },
],
});
// Search with plain text; Pinecone embeds the query too.
const results = await documents.search({
scoreBy: [{ type: 'embed', field: 'body', query: 'how did Rome move water' }],
topK: 2,
});
console.log(results.matches);- Choose a model with
embed: { model: 'llama-text-embed-v2', dimension: 1024 }. Omitted keys use the model's defaults, andpc.indexes.describereports the resolved configuration. - An
embedorsparse_embedclause must be the only clause inscoreBy. - Send at most 96 documents per upsert or update, instead of the usual 1,000. Requests over a size limit throw
Errors.PineconePayloadTooLargeError(see below). - Text is stored and indexed for full-text search by default. Set
storeText: falseto embed text without storing it. You can't return unstored fields or search them withtext/query_stringclauses. - Responses report embedding tokens in
usage.embedTotalTokens. - New exported types:
IntegratedEmbeddingStringField,CreateEmbedConfig,CreateSparseEmbedConfig,ResponseEmbedConfig, andResponseSparseEmbedConfig.
Read responses report egress bytes
query, fetch, fetchByMetadata, listPaginated, searchRecords, and documents.search/fetch/list now report usage.egressBytes, the billed size of the response in bytes. The field is omitted when the server doesn't report it. (1e25972)
const result = await index.query({ topK: 5, vector: [0.1, 0.2, 0.3] });
console.log(result.usage?.egressBytes);HTTP 413 has its own error class
HTTP 413 (Payload Too Large) now throws Errors.PineconePayloadTooLargeError, for example when an upsert sends more than 96 documents to an index with integrated embedding. Split the request into smaller batches and retry. (e40c44b)
Behavior changes
- A 413 used to surface as
Errors.PineconeUnmappedHttpError. If your code checks for that class to catch oversized requests, check forErrors.PineconePayloadTooLargeErrorinstead. (e40c44b)
Fixes
- Transient connection failures are retried. Requests that fail with
TypeError: fetch failedand a cause ofUND_ERR_SOCKET,UND_ERR_CONNECT_TIMEOUT, orUND_ERR_HEADERS_TIMEOUTnow retry with the same backoff as 5xx responses. If retries run out, you still getPineconeConnectionErrorwith the original error oncause. Other network errors, such asENOTFOUND, and failures after response headers arrive aren't retried. Fixes #354. Thanks to @OsamaAnsar for #434. (155f537) - Legacy getters work with integrated embedding.
model.dimension,model.metric, andmodel.vectorTypenow read from a string field'sembedwhen it's the index's only dense vector, instead of throwingPineconeIndexPropertyError. (e40c44b)
Documentation
- Indexes created with
pc.indexes.createForModelare now called legacy integrated indexes, used throughupsertRecords/searchRecords. They still work. For new projects, we recommend document indexes withembed/sparseEmbed. (466f4d3) - The README quickstart now uses integrated embedding on a document index.
Upgrading
npm install @pinecone-database/pinecone@^9.1.0What's Changed
- feat(documents): Add support for integrated embedding in document indexes (
embed/sparseEmbed) by @austin-denoble in e06adb9 - Add
usage.egressBytesto data plane read responses by @austin-denoble in 1e25972 - fix: retry transient connection failures (undici socket/timeout errors) by @OsamaAnsar in #434
- fix: keep
PineconeConnectionErrorafter transient retries are exhausted, dropUND_ERR_BODY_TIMEOUTby @austin-denoble in 155f537 - fix: resolve legacy getters for string-field embed and map HTTP 413 by @austin-denoble in e40c44b
- docs: Document integrated embedding and label createForModel indexes as legacy by @austin-denoble in 466f4d3
- Regenerate
2026-07to pull in integrated embedding config changes by @austin-denoble in 729d36d - Regenerate
2026-07for BYOC docs changes, keep public types stable by @austin-denoble in e9144b9 - Improve
fieldvsfieldsvalidation test coverage by @austin-denoble in 9fb9328 - ci: publish release candidates as the intended release version by @austin-denoble in b1fc03a
- chore: drop deprecated glob@10 and fix npm audit vulnerabilities by @austin-denoble in 00b77f3
- chore: group Dependabot updates for GitHub Actions and npm dev deps by @austin-denoble in 22cecbd
- build(deps-dev): dev dependency updates by @dependabot in 6afc6c7, 21520ac, 0939cf1, 6bcfde0, d329e1b
New Contributors
- @OsamaAnsar made their first contribution in #434
Full Changelog: v9.0.0...v9.1.0