Nhảy tới nội dung

Class: PineconeVectorStore

Provides support for writing and querying vector data in Postgres.

Implements

Constructors

constructor

new PineconeVectorStore(params?)

Parameters

NameType
params?PineconeParams

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:42

Properties

chunkSize

chunkSize: number

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:40


db

Optional db: Pinecone

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:38


indexName

indexName: string

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:39


storesText

storesText: boolean = true

Implementation of

VectorStore.storesText

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:28

Methods

add

add(embeddingResults): Promise<string[]>

Adds vector record(s) to the table.

Parameters

NameTypeDescription
embeddingResultsBaseNode<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.

Implementation of

VectorStore.add

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:88


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/core/src/storage/vectorStore/PineconeVectorStore.ts:77


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.

Implementation of

VectorStore.client

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:63


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

NameTypeDescription
refDocIdstringUnique identifier for the record to delete.
deleteKwargs?anyRequired by VectorStore interface. Currently ignored.

Returns

Promise<void>

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

Implementation of

VectorStore.delete

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:124


getDb

Private getDb(): Promise<Pinecone>

Returns

Promise<Pinecone>

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:50


index

index(): Promise<Index<RecordMetadata>>

Returns

Promise<Index<RecordMetadata>>

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:67


metaWithoutText

metaWithoutText(meta): any

Parameters

NameType
metaMetadata

Returns

any

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:199


nodeToRecord

nodeToRecord(node): Object

Parameters

NameType
nodeBaseNode<Metadata>

Returns

Object

NameType
idany
metadataany
valuesnumber[]

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:208


persist

persist(persistPath, fs?): Promise<void>

Required by VectorStore interface. Currently ignored.

Parameters

NameType
persistPathstring
fs?GenericFileSystem

Returns

Promise<void>

Resolved Promise.

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:181


query

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

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

Parameters

NameTypeDescription
queryVectorStoreQueryThe VectorStoreQuery to be used
options?anyRequired by VectorStore interface. Currently ignored.

Returns

Promise<VectorStoreQueryResult>

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

TODO

QUERY TYPES

Implementation of

VectorStore.query

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:136


saveChunk

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

Parameters

NameType
idxIndex<RecordMetadata>
chunkany

Returns

Promise<boolean>

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:106


textFromResultRow

textFromResultRow(row): string

Parameters

NameType
rowScoredPineconeRecord<Metadata>

Returns

string

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:195


toPineconeFilter

toPineconeFilter(stdFilters?): any

Parameters

NameType
stdFilters?MetadataFilters

Returns

any

Defined in

packages/core/src/storage/vectorStore/PineconeVectorStore.ts:188