匠人学院 JR Academy
Skip to article
Learning guide
LlamaIndex Guide

Use LlamaIndex to connect data sources, indexing pipelines, and retrieval workflows for RAG apps.

2 chapters·4 guides·Access varies by chapter
Data Indexing
On this page

LlamaIndex Indexing

Index design determines whether retrieval finds useful evidence. Poorly prepared documents can look like a generation problem later.

#Documents and nodes

A Document is divided into Nodes. A node can carry text, file/page information and relationships. It is a unit for retrieval, filtering, citations and source tracing—not just a string fragment.

#Index choices

VectorStoreIndex embeds nodes for semantic retrieval. SummaryIndex keeps a sequence useful for document-wide synthesis. TreeIndex represents hierarchical organization. KeywordTableIndex supports term-oriented lookup. Check the installed version before choosing an integration.

#Persist and reload

python
index.storage_context.persist(persist_dir="./storage") from llama_index.core import StorageContext, load_index_from_storage storage_context = StorageContext.from_defaults(persist_dir="./storage") index = load_index_from_storage(storage_context)

#Connect a vector store

python
import chromadb from llama_index.core import StorageContext, VectorStoreIndex from llama_index.vector_stores.chroma import ChromaVectorStore db = chromadb.PersistentClient(path="./chroma_db") collection = db.get_or_create_collection("my_data") vector_store = ChromaVectorStore(chroma_collection=collection) storage_context = StorageContext.from_defaults(vector_store=vector_store) index = VectorStoreIndex.from_documents( documents, storage_context=storage_context )

This fragment assumes documents, provider configuration and compatible integration packages already exist.

#Improve the foundation first

Small chunks can lose context; large chunks can introduce noise and cost. Treat defaults as a starting point. Add useful metadata such as section/source identifiers and evaluate representative queries before changing index types repeatedly.

#Next step

Published by
JR Academy
Learning resources

Individual authors and reviewers are credited where recorded.

System Design

Core system design concepts and practical case studies

Learn the trade-offs and patterns that matter in technical interviews.

Open System Design →

Related Roadmaps

Done reading? Next steps