Skip to main content

Class: VectorIndexRetriever

Retrievers retrieve the nodes that most closely match our query in similarity.

Implements

Constructors

new VectorIndexRetriever()

new VectorIndexRetriever(__namedParameters): VectorIndexRetriever

Parameters

__namedParameters: VectorIndexRetrieverOptions

Returns

VectorIndexRetriever

Defined in

packages/llamaindex/src/indices/vectorStore/index.ts:397

Properties

index

index: VectorStoreIndex

Defined in

packages/llamaindex/src/indices/vectorStore/index.ts:392


serviceContext?

optional serviceContext: ServiceContext

Implementation of

BaseRetriever.serviceContext

Defined in

packages/llamaindex/src/indices/vectorStore/index.ts:395


topK

topK: TopKMap

Defined in

packages/llamaindex/src/indices/vectorStore/index.ts:393

Accessors

similarityTopK

set similarityTopK(similarityTopK): void

@deprecated, pass similarityTopK or topK in constructor instead or directly modify topK

Parameters

similarityTopK: number

Defined in

packages/llamaindex/src/indices/vectorStore/index.ts:409

Methods

buildNodeListFromQueryResult()

protected buildNodeListFromQueryResult(result): NodeWithScore<Metadata>[]

Parameters

result: VectorStoreQueryResult

Returns

NodeWithScore<Metadata>[]

Defined in

packages/llamaindex/src/indices/vectorStore/index.ts:471


retrieve()

retrieve(__namedParameters): Promise<NodeWithScore<Metadata>[]>

Parameters

__namedParameters: RetrieveParams

Returns

Promise<NodeWithScore<Metadata>[]>

Implementation of

BaseRetriever.retrieve

Defined in

packages/llamaindex/src/indices/vectorStore/index.ts:414


retrieveQuery()

protected retrieveQuery(query, type, vectorStore, preFilters?): Promise<NodeWithScore<Metadata>[]>

Parameters

query: MessageContent

type: ModalityType

vectorStore: VectorStore

preFilters?: MetadataFilters

Returns

Promise<NodeWithScore<Metadata>[]>

Defined in

packages/llamaindex/src/indices/vectorStore/index.ts:442