0PricingLogin
AI Agents · Lesson

The Index Hierarchy: Vector, Tree, Keyword

Compare VectorStoreIndex (default), TreeIndex (summarization), and KeywordTableIndex (sparse).

Indexes in LlamaIndex

LlamaIndex calls its retrieval data structures "Indexes". There are several types, each suited to different tasks.

VectorStoreIndex (Default)

The standard embedding-based index — your daily driver:

from llama_index.core import VectorStoreIndex

index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
print(query_engine.query('What is in the handbook?'))

All lessons in this course

  1. Document Loaders and Parsers
  2. The Index Hierarchy: Vector, Tree, Keyword
  3. Query Engines and Response Synthesis
  4. Sub-Question Decomposition Strategy
← Back to AI Agents