{"id":1539,"library":"llama-index","title":"LlamaIndex","description":"LlamaIndex is a data framework for LLM applications, providing tools to ingest, structure, and access private or domain-specific data with large language models. It facilitates building RAG (Retrieval Augmented Generation) applications, agents, and more. The current version is 0.14.20, with a rapid release cadence that often includes new integrations and improvements across its modular ecosystem.","status":"active","version":"0.14.20","language":"en","source_language":"en","source_url":"https://github.com/run-llama/llama_index","tags":["LLM","RAG","vector database","NLP","AI agents","data framework"],"install":[{"cmd":"pip install llama-index","lang":"bash","label":"Base installation"},{"cmd":"pip install llama-index-llms-openai llama-index-embeddings-openai","lang":"bash","label":"Common integrations (e.g., OpenAI)"}],"dependencies":[{"reason":"Commonly used LLM provider. Must be installed separately (e.g., via `llama-index-llms-openai`).","package":"openai","optional":false},{"reason":"Used heavily for data validation and configuration. The minimum required version might increase with future LlamaIndex updates.","package":"pydantic","optional":false}],"imports":[{"symbol":"VectorStoreIndex","correct":"from llama_index.core import VectorStoreIndex"},{"symbol":"SimpleDirectoryReader","correct":"from llama_index.core import SimpleDirectoryReader"},{"note":"`ServiceContext` was deprecated in LlamaIndex 0.10.0 and replaced by the global `Settings` object for configuring LLM, embedding model, and other core components.","wrong":"from llama_index.core import ServiceContext","symbol":"Settings","correct":"from llama_index.core import Settings"},{"note":"As of LlamaIndex 0.10.0, LLM and Embedding models are imported from their specific integration packages (e.g., `llama_index.llms.openai`).","wrong":"from llama_index.llms import OpenAI","symbol":"OpenAI","correct":"from llama_index.llms.openai import OpenAI"},{"note":"As of LlamaIndex 0.10.0, LLM and Embedding models are imported from their specific integration packages (e.g., `llama_index.embeddings.openai`).","wrong":"from llama_index.embeddings import OpenAIEmbedding","symbol":"OpenAIEmbedding","correct":"from llama_index.embeddings.openai import OpenAIEmbedding"}],"quickstart":{"code":"import os\nfrom llama_index.core import VectorStoreIndex, SimpleDirectoryReader, Settings\nfrom llama_index.llms.openai import OpenAI\nfrom llama_index.embeddings.openai import OpenAIEmbedding\n\n# Ensure you have OPENAI_API_KEY set in your environment variables\n# For quick testing, a dummy key is used, but a real key is needed for actual API calls.\nos.environ[\"OPENAI_API_KEY\"] = os.environ.get(\"OPENAI_API_KEY\", \"sk-DUMMY\")\n\n# Create a dummy data directory and file for the example\nif not os.path.exists(\"data\"): \n    os.makedirs(\"data\")\nwith open(\"data/sample_doc.txt\", \"w\") as f:\n    f.write(\"LlamaIndex is a data framework for building LLM applications.\")\n    f.write(\"It helps connect custom data sources to large language models.\")\n\ntry:\n    # Configure the global Settings object (replaces ServiceContext)\n    Settings.llm = OpenAI(model=\"gpt-3.5-turbo\")\n    Settings.embed_model = OpenAIEmbedding(model=\"text-embedding-ada-002\")\n    Settings.chunk_size = 1024\n\n    # 1. Load documents from a directory\n    documents = SimpleDirectoryReader(\"data\").load_data()\n\n    # 2. Create an index from the documents\n    index = VectorStoreIndex.from_documents(documents)\n\n    # 3. Create a query engine and query the index\n    query_engine = index.as_query_engine()\n    response = query_engine.query(\"What is LlamaIndex?\")\n\n    print(f\"Query: What is LlamaIndex?\")\n    print(f\"Response: {response.response}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure you have `OPENAI_API_KEY` set and `llama-index-llms-openai` and `llama-index-embeddings-openai` installed.\")\nfinally:\n    # Clean up dummy file and directory\n    if os.path.exists(\"data/sample_doc.txt\"):\n        os.remove(\"data/sample_doc.txt\")\n    if os.path.exists(\"data\"):\n        os.rmdir(\"data\")\n","lang":"python","description":"This quickstart demonstrates how to load a document, create a vector index, and query it using the default OpenAI LLM and embedding models. It highlights the use of the `Settings` object for configuration, which replaced `ServiceContext` in LlamaIndex 0.10.0+."},"warnings":[{"fix":"Migrate your code to use `llama_index.core.Settings` for configuration. For example, instead of `ServiceContext.from_defaults(llm=..., embed_model=...)`, use `Settings.llm = ...` and `Settings.embed_model = ...`. Refer to the official migration guide for 0.10.0.","message":"LlamaIndex underwent a major architectural refactor in version 0.10.0. The `ServiceContext` class was deprecated and replaced by the global `Settings` object for configuring LLMs, embedding models, and other components. Many core classes moved or were renamed.","severity":"breaking","affected_versions":">=0.10.0"},{"fix":"Explicitly install the required integration packages using `pip install` (e.g., `pip install llama-index-llms-openai`). Imports also changed to reflect this modularity (e.g., `from llama_index.llms.openai import OpenAI`).","message":"The library transitioned to a modular package structure in 0.10.0. While `llama-index` is a metapackage, specific LLM, embedding, vector store, and other integrations are now separate packages (e.g., `llama-index-llms-openai`, `llama-index-embeddings-openai`).","severity":"breaking","affected_versions":">=0.10.0"},{"fix":"Upgrade your Python environment to Python 3.10 or higher. The library officially requires `>=3.10` and `<4.0`.","message":"Support for Python 3.9 was deprecated and eventually removed from various sub-packages.","severity":"deprecated","affected_versions":">=0.14.18 (gradual removal)"},{"fix":"Ensure relevant API keys (e.g., `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`) are set as environment variables or passed directly to the client constructors where applicable.","message":"LlamaIndex often requires API keys or credentials for external services (e.g., OpenAI, Anthropic, various vector databases). It does not manage these directly.","severity":"gotcha","affected_versions":"*"},{"fix":"Pin your `llama-index` dependencies to specific versions, or thoroughly test your application when updating. Review the GitHub release notes before upgrading.","message":"Due to rapid development and frequent releases, minor versions can sometimes introduce breaking changes or significant refactors without a new major version number. Always check release notes for your specific version.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}