Documentation
Classes
PineconeDatastore

Class: PineconeDatastore<DocMeta>

Extends

Type parameters

Parameter
DocMeta extends BaseMeta

Constructors

new PineconeDatastore(args)

new PineconeDatastore<DocMeta>(args): PineconeDatastore<DocMeta>

Parameters

ParameterTypeDescription
argsobject-
args.cache?CacheStorage<string, QueryResult<DocMeta>>Enables caching for queries. Must implement .get(key) and .set(key, value), both of which can be either sync or async.

Some examples include: new Map(), quick-lru (opens in a new tab), or any keyv adaptor (opens in a new tab).
args.cacheKey?CacheKey<Query<DocMeta, QueryFilter<DocMeta>>, string>A function that returns a cache key for the given params.

A simple example would be: (params) => JSON.stringify(params)

The default cacheKey function uses hash-object (opens in a new tab) to create a stable sha256 hash of the params.
args.contentKeykeyof DocMetaThe metadata key of the content that is embedded.
The value associated with the key must be a string.
args.context?Ctx-
args.debug?booleanWhether or not to add default console.log event handlers
args.embeddingModelEmbeddingModel-
args.events?Events<DocMeta, QueryFilter<DocMeta>>-
args.namespace?string-
args.pinecone?PineconeClient<DocMeta>-

Returns

PineconeDatastore<DocMeta>

Overrides

AbstractDatastore.constructor

Source

src/datastore/pinecone/datastore.ts:14 (opens in a new tab)

Properties

PropertyTypeDescriptionInheritanceSource
datastoreProvider"pinecone"-AbstractDatastore.datastoreProvidersrc/datastore/pinecone/datastore.ts:11 (opens in a new tab)
datastoreType"embedding"-AbstractDatastore.datastoreTypesrc/datastore/pinecone/datastore.ts:10 (opens in a new tab)

Methods

addEvents()

addEvents(events): PineconeDatastore<DocMeta>

Add event handlers to the datastore.

Parameters

ParameterType
eventsEvents<DocMeta, QueryFilter<DocMeta>>

Returns

PineconeDatastore<DocMeta>

Inherited from

AbstractDatastore.addEvents

Source

src/datastore/datastore.ts:153 (opens in a new tab)


delete()

delete(docIds): Promise<void>

Parameters

ParameterType
docIdsstring[]

Returns

Promise<void>

Overrides

AbstractDatastore.delete

Source

src/datastore/pinecone/datastore.ts:153 (opens in a new tab)


deleteAll()

deleteAll(): Promise<void>

Returns

Promise<void>

Overrides

AbstractDatastore.deleteAll

Source

src/datastore/pinecone/datastore.ts:157 (opens in a new tab)


getEvents()

getEvents(): Events<DocMeta, QueryFilter<DocMeta>>

Get the current event handlers

Returns

Events<DocMeta, QueryFilter<DocMeta>>

Inherited from

AbstractDatastore.getEvents

Source

src/datastore/datastore.ts:148 (opens in a new tab)


query()

query(query, context?): Promise<QueryResult<DocMeta>>

Parameters

ParameterType
queryQuery<DocMeta, QueryFilter<DocMeta>>
context?Ctx

Returns

Promise<QueryResult<DocMeta>>

Inherited from

AbstractDatastore.query

Source

src/datastore/datastore.ts:53 (opens in a new tab)


runQuery()

runQuery(query, context?): Promise<QueryResult<DocMeta>>

Parameters

ParameterType
queryQuery<DocMeta, QueryFilter<DocMeta>>
context?Ctx

Returns

Promise<QueryResult<DocMeta>>

Overrides

AbstractDatastore.runQuery

Source

src/datastore/pinecone/datastore.ts:30 (opens in a new tab)


setEvents()

setEvents(events): PineconeDatastore<DocMeta>

Set the event handlers to a new set of events. Removes all existing event handlers. Set to empty object {} to remove all events.

Parameters

ParameterType
eventsEvents<DocMeta, QueryFilter<DocMeta>>

Returns

PineconeDatastore<DocMeta>

Inherited from

AbstractDatastore.setEvents

Source

src/datastore/datastore.ts:162 (opens in a new tab)


upsert()

upsert(docs, context?): Promise<void>

Parameters

ParameterType
docsDoc<DocMeta>[]
context?Ctx

Returns

Promise<void>

Overrides

AbstractDatastore.upsert

Source

src/datastore/pinecone/datastore.ts:74 (opens in a new tab)