본문으로 건너뛰기

Class: VectorIndexRetriever

VectorIndexRetriever retrieves nodes from a VectorIndex.

Implements

Constructors

constructor

new VectorIndexRetriever(«destructured»): VectorIndexRetriever

Parameters

NameType
«destructured»Object
› imageSimilarityTopK?number
› indexVectorStoreIndex
› similarityTopK?number

Returns

VectorIndexRetriever

Defined in

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

Properties

imageSimilarityTopK

imageSimilarityTopK: number

Defined in

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


index

index: VectorStoreIndex

Defined in

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


serviceContext

Private serviceContext: ServiceContext

Defined in

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


similarityTopK

similarityTopK: number

Defined in

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

Methods

buildNodeListFromQueryResult

buildNodeListFromQueryResult(result): NodeWithScore<Metadata>[]

Parameters

NameType
resultVectorStoreQueryResult

Returns

NodeWithScore<Metadata>[]

Defined in

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


buildVectorStoreQuery

buildVectorStoreQuery(embedModel, query, similarityTopK, preFilters?): Promise<VectorStoreQuery>

Parameters

NameType
embedModelBaseEmbedding
querystring
similarityTopKnumber
preFilters?MetadataFilters

Returns

Promise<VectorStoreQuery>

Defined in

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


getServiceContext

getServiceContext(): ServiceContext

Returns

ServiceContext

Implementation of

BaseRetriever.getServiceContext

Defined in

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


retrieve

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

Parameters

NameType
querystring
parentEvent?Event
preFilters?MetadataFilters

Returns

Promise<NodeWithScore<Metadata>[]>

Implementation of

BaseRetriever.retrieve

Defined in

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


sendEvent

sendEvent(query, nodesWithScores, parentEvent): void

Parameters

NameType
querystring
nodesWithScoresNodeWithScore<Metadata>[]
parentEventundefined | Event

Returns

void

Defined in

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


textRetrieve

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

Parameters

NameType
querystring
preFilters?MetadataFilters

Returns

Promise<NodeWithScore<Metadata>[]>

Defined in

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


textToImageRetrieve

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

Parameters

NameType
querystring
preFilters?MetadataFilters

Returns

Promise<NodeWithScore<Metadata>[]>

Defined in

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