Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Run llama Llama index IndexStructType

From Leeroopedia
Knowledge Sources
Domains LLM Framework, Data Structures, Enum
Last Updated 2026-02-11 19:00 GMT

Overview

IndexStructType is a string enumeration that defines all recognized index structure type identifiers in LlamaIndex, used to tag and dispatch between different index backends.

Description

The IndexStructType enum inherits from both str and Enum, making each member both an enum value and a string. It serves as the canonical registry of all index structure types supported by LlamaIndex. Each index data structure class returns its corresponding IndexStructType from its get_type() class method.

The enum members are organized into several categories:

Core index types:

  • NODE ("node") -- Node-level index.
  • TREE ("tree") -- Tree-structured index (used by TreeIndex).
  • LIST ("list") -- Summary/list index (used by SummaryIndex).
  • KEYWORD_TABLE ("keyword_table") -- Keyword table index.

Vector store types:

  • DICT ("dict") -- Faiss vector store index.
  • SIMPLE_DICT ("simple_dict") -- Simple vector store index.
  • VECTOR_STORE ("vector_store") -- General vector store index (used by VectorStoreIndex).
  • MULTIMODAL_VECTOR_STORE ("multimodal") -- Multimodal vector store index.
  • Vendor-specific types: WEAVIATE, PINECONE, QDRANT, LANCEDB, MILVUS, CHROMA, MYSCALE, CLICKHOUSE, OPENSEARCH, DASHVECTOR, DEEPLAKE, EPSILLA.

Retrieval plugin:

  • CHATGPT_RETRIEVAL_PLUGIN ("chatgpt_retrieval_plugin") -- ChatGPT retrieval plugin index.

Structured store:

  • SQL ("sql") -- SQL structured store index.
  • PANDAS ("pandas") -- Pandas-based index.

Knowledge graph types:

  • KG ("kg") -- Knowledge graph index.
  • SIMPLE_KG ("simple_kg") -- Simple knowledge graph.
  • SIMPLE_LPG ("simple_lpg") -- Simple labeled property graph.
  • NEBULAGRAPH ("nebulagraph") -- NebulaGraph backend.
  • FALKORDB ("falkordb") -- FalkorDB backend.

Other types:

  • EMPTY ("empty") -- Empty index placeholder.
  • COMPOSITE ("composite") -- Composite index.
  • DOCUMENT_SUMMARY ("document_summary") -- Document summary index.

Managed index types:

  • VECTARA ("vectara") -- Vectara managed index.
  • POSTGRESML ("postgresml") -- PostgresML managed index.

Usage

IndexStructType is used throughout the LlamaIndex codebase to identify which type of index structure is being used. It is returned by the get_type() method on all IndexStruct subclasses and is referenced during index serialization, deserialization, and dispatch logic.

Code Reference

Source Location

  • Repository: Run_llama_Llama_index
  • File: llama-index-core/llama_index/core/data_structs/struct_type.py
  • Lines: 1-116

Signature

class IndexStructType(str, Enum):
    NODE = "node"
    TREE = "tree"
    LIST = "list"
    KEYWORD_TABLE = "keyword_table"
    DICT = "dict"
    SIMPLE_DICT = "simple_dict"
    WEAVIATE = "weaviate"
    PINECONE = "pinecone"
    QDRANT = "qdrant"
    LANCEDB = "lancedb"
    MILVUS = "milvus"
    CHROMA = "chroma"
    MYSCALE = "myscale"
    CLICKHOUSE = "clickhouse"
    VECTOR_STORE = "vector_store"
    OPENSEARCH = "opensearch"
    DASHVECTOR = "dashvector"
    CHATGPT_RETRIEVAL_PLUGIN = "chatgpt_retrieval_plugin"
    DEEPLAKE = "deeplake"
    EPSILLA = "epsilla"
    MULTIMODAL_VECTOR_STORE = "multimodal"
    SQL = "sql"
    KG = "kg"
    SIMPLE_KG = "simple_kg"
    SIMPLE_LPG = "simple_lpg"
    NEBULAGRAPH = "nebulagraph"
    FALKORDB = "falkordb"
    EMPTY = "empty"
    COMPOSITE = "composite"
    PANDAS = "pandas"
    DOCUMENT_SUMMARY = "document_summary"
    VECTARA = "vectara"
    POSTGRESML = "postgresml"

Import

from llama_index.core.data_structs.struct_type import IndexStructType

I/O Contract

Inputs

Name Type Required Description
N/A N/A N/A This is an enum class with no constructor parameters. Members are accessed as class attributes.

Outputs

Name Type Description
value str The string value of the enum member (e.g., "tree", "vector_store", "kg").
name str The Python name of the enum member (e.g., "TREE", "VECTOR_STORE", "KG").

Usage Examples

Basic Usage

from llama_index.core.data_structs.struct_type import IndexStructType

# Access enum members
print(IndexStructType.TREE)           # IndexStructType.TREE
print(IndexStructType.TREE.value)     # "tree"
print(IndexStructType.VECTOR_STORE)   # IndexStructType.VECTOR_STORE

# Compare types
index_type = IndexStructType.VECTOR_STORE
if index_type == IndexStructType.VECTOR_STORE:
    print("This is a vector store index")

# String comparison (since it inherits from str)
if index_type == "vector_store":
    print("String comparison also works")

# Iterate over all types
for struct_type in IndexStructType:
    print(f"{struct_type.name}: {struct_type.value}")

Using with Index Data Structures

from llama_index.core.data_structs.data_structs import IndexDict, IndexGraph, KeywordTable
from llama_index.core.data_structs.struct_type import IndexStructType

# Each data structure reports its type
assert IndexDict.get_type() == IndexStructType.VECTOR_STORE
assert IndexGraph.get_type() == IndexStructType.TREE
assert KeywordTable.get_type() == IndexStructType.KEYWORD_TABLE

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment