Class: VectorStoreIndex
The VectorStoreIndex, an index that stores the nodes only according to their vector embeddings.
Extends
Constructors
new VectorStoreIndex()
private
new VectorStoreIndex(init
):VectorStoreIndex
Parameters
• init: VectorIndexConstructorProps
Returns
Overrides
Source
packages/core/src/indices/vectorStore/index.ts:69
Properties
docStore
docStore:
BaseDocumentStore
Inherited from
Source
packages/core/src/indices/BaseIndex.ts:60
embedModel?
optional
embedModel:BaseEmbedding
Source
packages/core/src/indices/vectorStore/index.ts:66
indexStore
indexStore:
BaseIndexStore
Overrides
Source
packages/core/src/indices/vectorStore/index.ts:65
indexStruct
indexStruct:
IndexDict
Inherited from
Source
packages/core/src/indices/BaseIndex.ts:62
serviceContext?
optional
serviceContext:ServiceContext
Inherited from
Source
packages/core/src/indices/BaseIndex.ts:58
storageContext
storageContext:
StorageContext
Inherited from
Source
packages/core/src/indices/BaseIndex.ts:59
vectorStores
vectorStores:
VectorStoreByType
Source
packages/core/src/indices/vectorStore/index.ts:67
Methods
asQueryEngine()
asQueryEngine(
options
?):QueryEngine
&RetrieverQueryEngine
Create a RetrieverQueryEngine. similarityTopK is only used if no existing retriever is provided.
Parameters
• options?
• options.nodePostprocessors?: BaseNodePostprocessor
[]
• options.preFilters?: MetadataFilters
• options.responseSynthesizer?: BaseSynthesizer
• options.retriever?: BaseRetriever
• options.similarityTopK?: number
Returns
QueryEngine
& RetrieverQueryEngine
Overrides
Source
packages/core/src/indices/vectorStore/index.ts:283
asRetriever()
asRetriever(
options
?):VectorIndexRetriever
Create a new retriever from the index.
Parameters
• options?: Omit
<VectorIndexRetrieverOptions
, "index"
>
Returns
Overrides
Source
packages/core/src/indices/vectorStore/index.ts:273
buildIndexFromNodes()
buildIndexFromNodes(
nodes
,options
?):Promise
<void
>
Get embeddings for nodes and place them into the index.