Class: VectorStoreIndex
The VectorStoreIndex, an index that stores the nodes only according to their vector embedings.
Hierarchy
Constructors
constructor
• Private
new VectorStoreIndex(init
)
Parameters
Name | Type |
---|---|
init | VectorIndexConstructorProps |
Overrides
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:64
Properties
docStore
• docStore: BaseDocumentStore
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:156
embedModel
• embedModel: BaseEmbedding
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:60
imageEmbedModel
• Optional
imageEmbedModel: MultiModalEmbedding
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:62
imageVectorStore
• Optional
imageVectorStore: VectorStore
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:61
indexStore
• indexStore: BaseIndexStore
Overrides
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:59
indexStruct
• indexStruct: IndexDict
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:159
serviceContext
• serviceContext: ServiceContext
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:154
storageContext
• storageContext: StorageContext
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:155
vectorStore
• vectorStore: VectorStore
Overrides
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:58
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? | unknown | - |
options.responseSynthesizer? | ResponseSynthesizer | - |
options.retriever? | BaseRetriever | - |
Returns
Overrides
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:244
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:240
buildIndexFromNodes
▸ buildIndexFromNodes(nodes
): Promise
<void
>
Get embeddings for nodes and place them into the index.
Parameters
Name | Type |
---|---|
nodes | BaseNode <Metadata >[] |
Returns
Promise
<void
>
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:178
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:305
deleteRefDocFromStore
▸ Protected
deleteRefDocFromStore(vectorStore
, refDocId
): Promise
<void
>
Parameters
Name | Type |
---|---|
vectorStore | VectorStore |
refDocId | string |
Returns
Promise
<void
>
Defined in
packages/core/src/indices/vectorStore/VectorStoreIndex.ts:319
getImageNodeEmbeddingResults
▸ getImageNodeEmbeddingResults(nodes
, logProgress?
): Promise
<BaseNode
<Metadata
>[]>
Get the embeddings for image nodes.