Index
An index is the basic container for organizing your data. Besides managed indexes using LlamaCloud, LlamaIndex.TS supports three indexes:
VectorStoreIndex- will send the top-kNodes to the LLM when generating a response. The default top-k is 2.SummaryIndex- will send everyNodein the index to the LLM in order to generate a responseKeywordTableIndexextracts and provides keywords fromNodes to the LLM
import { Document, VectorStoreIndex } from "llamaindex";
const document = new Document({ text: "test" });
const index = await VectorStoreIndex.fromDocuments([document]);