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
Source
packages/core/src/indices/vectorStore/index.ts:395
Properties
index
index:
VectorStoreIndex
Source
packages/core/src/indices/vectorStore/index.ts:390
serviceContext?
optional
serviceContext:ServiceContext
Implementation of
BaseRetriever
. serviceContext
Source
packages/core/src/indices/vectorStore/index.ts:393
topK
topK:
TopKMap
Source
packages/core/src/indices/vectorStore/index.ts:391
Accessors
similarityTopK
set
similarityTopK(similarityTopK
):void
@deprecated, pass topK in constructor instead
Parameters
• similarityTopK: number
Source
packages/core/src/indices/vectorStore/index.ts:407
Methods
buildNodeListFromQueryResult()
protected
buildNodeListFromQueryResult(result
):NodeWithScore
<Metadata
>[]
Parameters
• result: VectorStoreQueryResult
Returns
Source
packages/core/src/indices/vectorStore/index.ts:478
retrieve()
retrieve(
__namedParameters
):Promise
<NodeWithScore
<Metadata
>[]>
Parameters
• __namedParameters: RetrieveParams
Returns
Promise
<NodeWithScore
<Metadata
>[]>
Implementation of
Source
packages/core/src/indices/vectorStore/index.ts:412
retrieveQuery()
protected
retrieveQuery(query
,type
,vectorStore
,preFilters
?):Promise
<NodeWithScore
<Metadata
>[]>
Parameters
• query: MessageContent
• type: ModalityType
• vectorStore: VectorStore
• preFilters?: MetadataFilters
Returns
Promise
<NodeWithScore
<Metadata
>[]>