Pular para o conteúdo principal

Class: PineconeVectorStore

Provides support for writing and querying vector data in Postgres.

Implements

Constructors

new PineconeVectorStore()

new PineconeVectorStore(params?): PineconeVectorStore

Parameters

params?: PineconeParams

Returns

PineconeVectorStore

Source

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

Properties

chunkSize

chunkSize: number

Source

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


db?

optional db: Pinecone

Source

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


indexName

indexName: string

Source

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


namespace

namespace: string

Source

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


storesText

storesText: boolean = true

Implementation of

VectorStore . storesText

Source

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


textKey

textKey: string

Source

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

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.

Implementation of

VectorStore . add

TODO

Does not create or insert sparse vectors.

Source

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


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.

Source

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


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

Source

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


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?: any

Required by VectorStore interface. Currently ignored.

Returns

Promise<void>

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

Implementation of

VectorStore . delete

Source

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


getDb()

private getDb(): Promise<Pinecone>

Returns

Promise<Pinecone>

Source

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


index()

index(): Promise<Index<RecordMetadata>>

Returns

Promise<Index<RecordMetadata>>

Source

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


metaWithoutText()

metaWithoutText(meta): any

Parameters

meta: Metadata

Returns

any

Source

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


nodeToRecord()

nodeToRecord(node): object

Parameters

node: BaseNode <Metadata>

Returns

object

id

id: any

metadata

metadata: Metadata

values

values: number[]

Source

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


persist()

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

Required by VectorStore interface. Currently ignored.

Parameters

persistPath: string

fs?: GenericFileSystem

Returns

Promise<void>

Resolved Promise.

Source

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


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?: any

Returns

Promise <VectorStoreQueryResult>

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

Implementation of

VectorStore . query

TODO

QUERY TYPES

Source

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


saveChunk()

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

Parameters

idx: Index<RecordMetadata>

chunk: any

Returns

Promise<boolean>

Source

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


textFromResultRow()

textFromResultRow(row): string

Parameters

row: ScoredPineconeRecord <Metadata>

Returns

string

Source

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


toPineconeFilter()

toPineconeFilter(stdFilters?): any

Parameters

stdFilters?: MetadataFilters

Returns

any

Source

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