Skip to content

VectorStoreIndex

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:75

The VectorStoreIndex, an index that stores the nodes only according to their vector embeddings.

storageContext: StorageContext

Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:52

BaseIndex.storageContext


docStore: BaseDocumentStore

Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:53

BaseIndex.docStore


indexStruct: IndexDict

Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:55

BaseIndex.indexStruct


indexStore: BaseIndexStore

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:76

BaseIndex.indexStore


optional embedModel: BaseEmbedding

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:77


vectorStores: VectorStoreByType

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:78

asQueryTool(params): QueryEngineTool

Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:94

Returns a query tool by calling asQueryEngine. Either options or retriever can be passed, but not both. If options are provided, they are passed to generate a retriever.

QueryToolParams

QueryEngineTool

BaseIndex.asQueryTool


insert(document): Promise<void>

Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:110

Insert a document into the index.

Document

Promise<void>

BaseIndex.insert


retriever(options?): BaseRetriever

Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:127

Alias for asRetriever

any

BaseRetriever

BaseIndex.retriever


queryEngine(options?): BaseQueryEngine

Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:135

Alias for asQueryEngine

you can supply your own custom Retriever and ResponseSynthesizer

BaseRetriever

BaseSynthesizer

BaseQueryEngine

BaseIndex.queryEngine


queryTool(params): QueryEngineTool

Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:147

Alias for asQueryTool Either options or retriever can be passed, but not both. If options are provided, they are passed to generate a retriever.

QueryToolParams

QueryEngineTool

BaseIndex.queryTool


static init(options): Promise<VectorStoreIndex>

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:92

The async init function creates a new VectorStoreIndex.

VectorIndexOptions

Promise<VectorStoreIndex>


getNodeEmbeddingResults(nodes, options?): Promise<BaseNode<Metadata>[]>

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:173

Calculates the embeddings for the given nodes.

BaseNode<Metadata>[]

An array of BaseNode objects representing the nodes for which embeddings are to be calculated.

An optional object containing additional parameters.

boolean

A boolean indicating whether to log progress to the console (useful for debugging).

(progress, total) => void

Promise<BaseNode<Metadata>[]>


buildIndexFromNodes(nodes, options?): Promise<void>

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:202

Get embeddings for nodes and place them into the index.

BaseNode<Metadata>[]

boolean

(progress, total) => void

Promise<void>


static fromDocuments(documents, args): Promise<VectorStoreIndex>

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:220

High level API: split documents, get embeddings, and build index.

Document<Metadata>[]

VectorIndexOptions & object = {}

Promise<VectorStoreIndex>


static fromVectorStores(vectorStores): Promise<VectorStoreIndex>

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:265

VectorStoreByType

Promise<VectorStoreIndex>


static fromVectorStore(vectorStore): Promise<VectorStoreIndex>

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:284

BaseVectorStore

Promise<VectorStoreIndex>


asRetriever(options?): VectorIndexRetriever

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:288

Create a new retriever from the index.

Omit<object & object, "index"> | Omit<object & object, "index">

VectorIndexRetriever

BaseIndex.asRetriever


asQueryEngine(options?): RetrieverQueryEngine

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:298

Create a RetrieverQueryEngine. similarityTopK is only used if no existing retriever is provided.

BaseRetriever

BaseSynthesizer

MetadataFilters

unknown

BaseNodePostprocessor[]

number

RetrieverQueryEngine

BaseIndex.asQueryEngine


asChatEngine(options): ContextChatEngine

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:331

Convert the index to a chat engine.

VectorIndexChatEngineOptions = {}

The options for creating the chat engine

ContextChatEngine

A ContextChatEngine that uses the index’s retriever to get context for each query

BaseIndex.asChatEngine


protected insertNodesToStore(newIds, nodes, vectorStore): Promise<void>

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:351

string[]

BaseNode<Metadata>[]

BaseVectorStore

Promise<void>


insertNodes(nodes, options?): Promise<void>

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:375

BaseNode<Metadata>[]

boolean

(progress, total) => void

Promise<void>

BaseIndex.insertNodes


deleteRefDoc(refDocId, deleteFromDocStore): Promise<void>

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:396

string

boolean = true

Promise<void>

BaseIndex.deleteRefDoc


protected deleteRefDocFromStore(vectorStore, refDocId): Promise<void>

Defined in: .build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:408

BaseVectorStore

string

Promise<void>