Skip to main content

Class: PineconeVectorStore

Provides support for writing and querying vector data in Pinecone.

Extends

Constructors

new PineconeVectorStore()

new PineconeVectorStore(params?): PineconeVectorStore

Parameters

params?: PineconeParams

Returns

PineconeVectorStore

Overrides

BaseVectorStore.constructor

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:54

Properties

apiKey

apiKey: string

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:52


chunkSize

chunkSize: number

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:49


db?

optional db: Pinecone

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:46


embedModel

embedModel: BaseEmbedding

Inherited from

BaseVectorStore.embedModel

Defined in

packages/llamaindex/src/vector-store/types.ts:92


indexName

indexName: string

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:47


isEmbeddingQuery?

optional isEmbeddingQuery: boolean

Inherited from

BaseVectorStore.isEmbeddingQuery

Defined in

packages/llamaindex/src/vector-store/types.ts:94


namespace

namespace: string

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:48


storesText

storesText: boolean = true

Overrides

BaseVectorStore.storesText

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:36


textKey

textKey: string

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:50

Methods

add()

add(embeddingResults): Promise<string[]>

Adds vector record(s) to the table.

Parameters

embeddingResults: BaseNode<Metadata>[]

The Nodes to be inserted, optionally including metadata tuples.

Returns

Promise<string[]>

Due to limitations in the Pinecone client, does not return the upserted ID list, only a Promise resolve/reject.

TODO

Does not create or insert sparse vectors.

Overrides

BaseVectorStore.add

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:111


clearIndex()

clearIndex(): Promise<void>

Delete all records for the current index. NOTE: This operation is not supported by Pinecone for "Starter" (free) indexes.

Returns

Promise<void>

The result of the delete query.

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:100


client()

client(): Promise<Pinecone>

Connects to the Pinecone account specified in environment vars. This method also checks and creates the named index if not found.

Returns

Promise<Pinecone>

Pinecone client, or the error encountered while connecting/setting up.

Overrides

BaseVectorStore.client

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:86


delete()

delete(refDocId, deleteKwargs?): Promise<void>

Deletes a single record from the database by id. NOTE: Uses the collection property controlled by setCollection/getCollection.

Parameters

refDocId: string

Unique identifier for the record to delete.

deleteKwargs?: object

Required by VectorStore interface. Currently ignored.

Returns

Promise<void>

Promise that resolves if the delete query did not throw an error.

Overrides

BaseVectorStore.delete

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:147


index()

index(): Promise<Index<RecordMetadata>>

Returns

Promise<Index<RecordMetadata>>

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:90


metaWithoutText()

metaWithoutText(meta): Record<string, unknown>

Parameters

meta: Metadata

Returns

Record<string, unknown>

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:275


nodeToRecord()

nodeToRecord(node): object

Parameters

node: BaseNode<Metadata>

Returns

object

id

id: string

metadata

metadata: Metadata

values

values: number[]

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:284


persist()

persist(persistPath): Promise<void>

Required by VectorStore interface. Currently ignored.

Parameters

persistPath: string

Returns

Promise<void>

Resolved Promise.

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:210


query()

query(query, _options?): Promise<VectorStoreQueryResult>

Query the vector store for the closest matching data to the query embeddings

Parameters

query: VectorStoreQuery

The VectorStoreQuery to be used

_options?: object

Required by VectorStore interface. Currently ignored.

Returns

Promise<VectorStoreQueryResult>

Zero or more Document instances with data from the vector store.

TODO

QUERY TYPES

Overrides

BaseVectorStore.query

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:159


saveChunk()

protected saveChunk(idx, chunk): Promise<boolean>

Parameters

idx: Index<RecordMetadata>

chunk: PineconeRecord[]

Returns

Promise<boolean>

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:129


textFromResultRow()

textFromResultRow(row): string

Parameters

row: ScoredPineconeRecord<Metadata>

Returns

string

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:271


toPineconeFilter()

toPineconeFilter(stdFilters?): undefined | object

Parameters

stdFilters?: MetadataFilters

Returns

undefined | object

Defined in

packages/llamaindex/src/vector-store/PineconeVectorStore.ts:214