Class: VectorIndexRetriever
VectorIndexRetriever retrieves nodes from a VectorIndex.
Implements
Constructors
constructor
• new VectorIndexRetriever(«destructured»
)
Parameters
Name | Type |
---|---|
«destructured» | Object |
› index | VectorStoreIndex |
› similarityTopK? | number |
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:24
Properties
index
• index: VectorStoreIndex
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:20
serviceContext
• Private
serviceContext: ServiceContext
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:22
similarityTopK
• similarityTopK: number
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:21
Methods
buildNodeListFromQueryResult
▸ Protected
buildNodeListFromQueryResult(result
): NodeWithScore
<Metadata
>[]
Parameters
Name | Type |
---|---|
result | VectorStoreQueryResult |
Returns
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:102
buildVectorStoreQuery
▸ Protected
buildVectorStoreQuery(embedModel
, query
): Promise
<VectorStoreQuery
>
Parameters
Name | Type |
---|---|
embedModel | BaseEmbedding |
query | string |
Returns
Promise
<VectorStoreQuery
>
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:89
getServiceContext
▸ getServiceContext(): ServiceContext
Returns
Implementation of
BaseRetriever.getServiceContext
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:120
retrieve
▸ retrieve(query
, parentEvent?
, preFilters?
): Promise
<NodeWithScore
<Metadata
>[]>
Parameters
Name | Type |
---|---|
query | string |
parentEvent? | Event |
preFilters? | unknown |
Returns
Promise
<NodeWithScore
<Metadata
>[]>
Implementation of
Defined in
packages/core/src/indices/vectorStore/VectorIndexRetriever.ts:37
sendEvent
▸ Protected
sendEvent(query
, nodesWithScores
, parentEvent
): void