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/VectorStoreIndex.ts:67
Properties
docStore
• docStore: BaseDocumentStore
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:157
embedModel
• embedModel: BaseEmbedding
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:63
imageEmbedModel
• Optional
imageEmbedModel: MultiModalEmbedding
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:65
imageVectorStore
• Optional
imageVectorStore: VectorStore
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:64
indexStore
• indexStore: BaseIndexStore
Overrides
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:62
indexStruct
• indexStruct: IndexDict
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:160
serviceContext
• serviceContext: ServiceContext
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:155
storageContext
• storageContext: StorageContext
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:156
vectorStore
• vectorStore: VectorStore
Overrides
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:61
Methods
asQueryEngine
▸ asQueryEngine(options?
): BaseQueryEngine
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 | - |
Returns
Overrides
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:267
asRetriever
▸ asRetriever(options?
): VectorIndexRetriever
Create a new retriever from the index.
Parameters
Name | Type |
---|---|
options? | any |
Returns
Overrides
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:263
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 |
Returns
Promise
<void
>
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:187
deleteRefDoc
▸ deleteRefDoc(refDocId
, deleteFromDocStore?
): Promise
<void
>
Parameters
Name | Type | Default value |
---|---|---|
refDocId | string | undefined |
deleteFromDocStore | boolean | true |
Returns
Promise
<void
>
Overrides
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:336
deleteRefDocFromStore
▸ deleteRefDocFromStore(vectorStore
, refDocId
): Promise
<void
>
Parameters
Name | Type |
---|---|
vectorStore | VectorStore |
refDocId | string |
Returns
Promise
<void
>
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:350
getImageNodeEmbeddingResults
▸ getImageNodeEmbeddingResults(nodes
, options?
): Promise
<ImageNode
<Metadata
>[]>
Calculates the embeddings for the given image nodes.
Parameters
Name | Type | Description |
---|---|---|
nodes | ImageNode <Metadata >[] | An array of ImageNode objects representing the nodes for which embeddings are to be calculated. |
options? | Object | An optional object containing additional parameters. |
options.logProgress? | boolean | A boolean indicating whether to log progress to the console (useful for debugging). |
Returns
Promise
<ImageNode
<Metadata
>[]>
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:376
getNodeEmbeddingResults
▸ getNodeEmbeddingResults(nodes
, options?
): Promise
<BaseNode
<Metadata
>[]>
Calculates the embeddings for the given nodes.
Parameters
Name | Type | Description |
---|---|---|
nodes | BaseNode <Metadata >[] | An array of BaseNode objects representing the nodes for which embeddings are to be calculated. |
options? | Object | An optional object containing additional parameters. |
options.logProgress? | boolean | A boolean indicating whether to log progress to the console (useful for debugging). |