Skip to main content

Class: VectorIndexRetriever

VectorIndexRetriever retrieves nodes from a VectorIndex.

Implements

Constructors

constructor

new VectorIndexRetriever(«destructured»)

Parameters

NameType
«destructured»Object
› indexVectorStoreIndex
› similarityTopK?number

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:22

Properties

index

index: VectorStoreIndex

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:18


serviceContext

Private serviceContext: ServiceContext

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:20


similarityTopK

similarityTopK: number

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:19

Methods

getServiceContext

getServiceContext(): ServiceContext

Returns

ServiceContext

Implementation of

BaseRetriever.getServiceContext

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:78


retrieve

retrieve(query, parentEvent?, preFilters?): Promise<NodeWithScore<Metadata>[]>

Parameters

NameType
querystring
parentEvent?Event
preFilters?unknown

Returns

Promise<NodeWithScore<Metadata>[]>

Implementation of

BaseRetriever.retrieve

Defined in

packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:35