Class: VectorStoreIndex
The VectorStoreIndex, an index that stores the nodes only according to their vector embedings.
Hierarchy
Constructors
constructor
• new VectorStoreIndex(init
): VectorStoreIndex
Parameters
Name | Type |
---|---|
init | VectorIndexConstructorProps |
Returns
Overrides
Defined in
packages/core/src/indices/vectorStore/index.ts:74
Properties
docStore
• docStore: BaseDocumentStore
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:62
embedModel
• embedModel: BaseEmbedding
Defined in
packages/core/src/indices/vectorStore/index.ts:70
imageEmbedModel
• Optional
imageEmbedModel: MultiModalEmbedding
Defined in
packages/core/src/indices/vectorStore/index.ts:72
imageVectorStore
• Optional
imageVectorStore: VectorStore
Defined in
packages/core/src/indices/vectorStore/index.ts:71
indexStore
• indexStore: BaseIndexStore
Overrides
Defined in
packages/core/src/indices/vectorStore/index.ts:69
indexStruct
• indexStruct: IndexDict
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:65
serviceContext
• Optional
serviceContext: ServiceContext
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:60
storageContext
• storageContext: StorageContext
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:61
vectorStore
• vectorStore: VectorStore
Overrides
Defined in
packages/core/src/indices/vectorStore/index.ts:68
Methods
asQueryEngine
▸ asQueryEngine(options?
): RetrieverQueryEngine
<MetadataFilters
>
Create a new query engine from the index. It will also create a retriever and response synthezier if they are not provided.
Parameters
Name | Type | Description |
---|---|---|
options? | Object | you can supply your own custom Retriever and ResponseSynthesizer |
options.nodePostprocessors? | BaseNodePostprocessor [] | - |
options.preFilters? | MetadataFilters | - |
options.responseSynthesizer? | BaseSynthesizer | - |
options.retriever? | BaseRetriever <MetadataFilters > | - |
Returns
RetrieverQueryEngine
<MetadataFilters
>
Overrides
Defined in
packages/core/src/indices/vectorStore/index.ts:283
asRetriever
▸ asRetriever(options?
): VectorIndexRetriever
Create a new retriever from the index.
Parameters
Name | Type |
---|---|
options? | Omit <VectorIndexRetrieverOptions , "index" > |
Returns
Overrides
Defined in
packages/core/src/indices/vectorStore/index.ts:277
buildIndexFromNodes
▸ buildIndexFromNodes(nodes
, options?
): Promise
<void
>
Get embeddings for nodes and place them into the index.
Parameters
Name | Type |
---|---|
nodes | BaseNode <Metadata >[] |
options? | Object |
options.logProgress? | boolean |