VectorStoreIndex
Defined in: packages/core/src/indices/vectorStore/index.ts:52
The VectorStoreIndex, an index that stores the nodes only according to their vector embeddings.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new VectorStoreIndex(
init):VectorStoreIndex
Defined in: packages/core/src/indices/BaseIndex.ts:22
Parameters
Section titled “Parameters”Returns
Section titled “Returns”VectorStoreIndex
Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”vectorStores
Section titled “vectorStores”vectorStores:
VectorStoreByType
Defined in: packages/core/src/indices/BaseIndex.ts:19
Inherited from
Section titled “Inherited from”embeddings
Section titled “embeddings”embeddings:
EmbeddingsByType
Defined in: packages/core/src/indices/BaseIndex.ts:20
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”insert()
Section titled “insert()”insert(
document):Promise<void>
Defined in: packages/core/src/indices/BaseIndex.ts:38
Insert a document into the index.
Parameters
Section titled “Parameters”document
Section titled “document”Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”retriever()
Section titled “retriever()”retriever(
options?):BaseRetriever
Defined in: packages/core/src/indices/BaseIndex.ts:61
Alias for asRetriever
Parameters
Section titled “Parameters”options?
Section titled “options?”any
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”init()
Section titled “init()”
staticinit(options):Promise<VectorStoreIndex>
Defined in: packages/core/src/indices/vectorStore/index.ts:58
The async init function creates a new VectorStoreIndex.
Parameters
Section titled “Parameters”options
Section titled “options”VectorIndexOptions = {}
Returns
Section titled “Returns”Promise<VectorStoreIndex>
fromDocuments()
Section titled “fromDocuments()”
staticfromDocuments(documents,args):Promise<VectorStoreIndex>
Defined in: packages/core/src/indices/vectorStore/index.ts:98
High level API: split documents, get embeddings, and build index.
Parameters
Section titled “Parameters”documents
Section titled “documents”VectorIndexOptions & object = {}
Returns
Section titled “Returns”Promise<VectorStoreIndex>
fromVectorStores()
Section titled “fromVectorStores()”
staticfromVectorStores(vectorStores,embeddings):Promise<VectorStoreIndex>
Defined in: packages/core/src/indices/vectorStore/index.ts:160
Parameters
Section titled “Parameters”vectorStores
Section titled “vectorStores”embeddings
Section titled “embeddings”Returns
Section titled “Returns”Promise<VectorStoreIndex>
fromVectorStore()
Section titled “fromVectorStore()”
staticfromVectorStore(vectorStore,embeddings):Promise<VectorStoreIndex>
Defined in: packages/core/src/indices/vectorStore/index.ts:179
Parameters
Section titled “Parameters”vectorStore
Section titled “vectorStore”embeddings
Section titled “embeddings”Returns
Section titled “Returns”Promise<VectorStoreIndex>
asRetriever()
Section titled “asRetriever()”asRetriever(
options?):VectorIndexRetriever
Defined in: packages/core/src/indices/vectorStore/index.ts:191
Create a new retriever from the index.
Parameters
Section titled “Parameters”options?
Section titled “options?”Omit<object & object, "index"> | Omit<object & object, "index">
Returns
Section titled “Returns”Overrides
Section titled “Overrides”insertNodes()
Section titled “insertNodes()”insertNodes(
nodes,options?):Promise<void>
Defined in: packages/core/src/indices/vectorStore/index.ts:197
Parameters
Section titled “Parameters”options?
Section titled “options?”docStoreStrategy?
Section titled “docStoreStrategy?”Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”insertText()
Section titled “insertText()”insertText(
text,metadata?,options?):Promise<void>
Defined in: packages/core/src/indices/vectorStore/index.ts:224
Convenience method to insert text directly into the index. Creates a Document from the text and inserts it into the vector store.
Parameters
Section titled “Parameters”The text to insert (string or array of strings)
string | string[]
metadata?
Section titled “metadata?”Optional metadata to attach to the document(s)
options?
Section titled “options?”Optional insert options
docStoreStrategy?
Section titled “docStoreStrategy?”Returns
Section titled “Returns”Promise<void>
Promise that resolves when the text is inserted
deleteRefDoc()
Section titled “deleteRefDoc()”deleteRefDoc(
refDocId):Promise<void>
Defined in: packages/core/src/indices/vectorStore/index.ts:236
Parameters
Section titled “Parameters”refDocId
Section titled “refDocId”string
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”deleteRefDocFromStore()
Section titled “deleteRefDocFromStore()”
protecteddeleteRefDocFromStore(vectorStore,refDocId):Promise<void>
Defined in: packages/core/src/indices/vectorStore/index.ts:242
Parameters
Section titled “Parameters”vectorStore
Section titled “vectorStore”refDocId
Section titled “refDocId”string
Returns
Section titled “Returns”Promise<void>