LlamaIndex
LlamaIndex is an open-source data framework for building LLM applications by connecting private data sources to LLMs. It provides data connectors, indexing, and retrieval tools to augment LLMs with custom data. It is for developers building RAG, document agents, and other LLM-powered applications.
✨ Key features
- Data connectors for APIs, PDFs, SQL, and more
- Structures data with indices and graphs
- Advanced retrieval and query interface
- High-level API for quick start
- Low-level APIs for customization
- 300+ integrations on LlamaHub
🎯 Use cases
- Build retrieval-augmented generation (RAG) pipelines
- Create document agents for parsing and extraction
- Index and query private documents
- Integrate with LangChain, Flask, or ChatGPT
📦 Installation
🧰 Requirements: Python 3.x, optional API keys for LLM providers (e.g., OpenAI) or local models via Ollama.
# custom selection of integrations to work with core
pip install llama-index-core
pip install llama-index-llms-openai
pip install llama-index-llms-ollama
pip install llama-index-embeddings-huggingface
🚀 Usage
import os
os.environ["OPENAI_API_KEY"] = "YOUR_OPENAI_API_KEY"
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader
documents = SimpleDirectoryReader("YOUR_DATA_DIRECTORY").load_data()
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
query_engine.query("YOUR_QUESTION")
⚠️ Good to know
The README notes that it is not updated as frequently as the documentation, and new integrations may be declined if they don't meaningfully integrate.
❓ FAQ
What is the difference between llama-index and llama-index-core?
llama-index is a starter package that includes core and selected integrations, while llama-index-core is the core library that you can customize with integrations from LlamaHub.
How do I use LlamaIndex with non-OpenAI LLMs?
You can set the LLM via Settings.llm, for example using Ollama, and also set the tokenizer and embedding model accordingly.
How do I persist and reload the index?
Use index.storage_context.persist() to save to disk, and load_index_from_storage with a StorageContext to reload.
📊 Repository
🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.