Class: VectorIndexRetriever
Retrievers retrieve the nodes that most closely match our query in similarity.
Implements
Constructors
constructor
• new VectorIndexRetriever(«destructured»
): VectorIndexRetriever
Parameters
Name | Type |
---|---|
«destructured» | VectorIndexRetrieverOptions |
Returns
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:32
Properties
imageSimilarityTopK
• imageSimilarityTopK: number
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:29
index
• index: VectorStoreIndex
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:27
serviceContext
• Private
serviceContext: ServiceContext
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:30
similarityTopK
• similarityTopK: number
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:28
Methods
buildNodeListFromQueryResult
▸ buildNodeListFromQueryResult(result
): NodeWithScore
<Metadata
>[]
Parameters
Name | Type |
---|---|
result | VectorStoreQueryResult |
Returns
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:122
buildVectorStoreQuery
▸ buildVectorStoreQuery(embedModel
, query
, similarityTopK
, preFilters?
): Promise
<VectorStoreQuery
>
Parameters
Name | Type |
---|---|
embedModel | BaseEmbedding |
query | string |
similarityTopK | number |
preFilters? | MetadataFilters |
Returns
Promise
<VectorStoreQuery
>
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:106
getServiceContext
▸ getServiceContext(): ServiceContext
Returns
Implementation of
BaseRetriever.getServiceContext
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:146
retrieve
▸ retrieve(query
, parentEvent?
, preFilters?
): Promise
<NodeWithScore
<Metadata
>[]>
Parameters
Name | Type |
---|---|
query | string |
parentEvent? | Event |
preFilters? | MetadataFilters |
Returns
Promise
<NodeWithScore
<Metadata
>[]>
Implementation of
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:43
sendEvent
▸ sendEvent(query
, nodesWithScores
, parentEvent
): void