Index
An index is the basic container and organization for your data. LlamaIndex.TS supports two indexes:
ListIndex
- will send everyNode
in the index to the LLM in order to generate a responseVectorStoreIndex
- will send the top-kNode
s to the LLM when generating a response. The default top-k is 2.
import {
Document,
VectorStoreIndex,
} from "llamaindex";
const document = new Document({ text: "test" });
const index = await VectorStoreIndex.fromDocuments(
[document]
);