{"id":6392,"library":"llama-index-legacy","title":"LlamaIndex Legacy","description":"LlamaIndex Legacy is a compatibility package that contains the pre-v0.10.0 monolithic codebase of LlamaIndex, a data framework designed to build LLM applications by connecting large language models with external data sources. It is currently at version 0.9.48.post4 and is maintained for users who have not yet migrated to the modular LlamaIndex v0.10+ architecture. While the broader LlamaIndex ecosystem has a rapid release cadence, this specific legacy package receives minimal updates as it is a bridge for older codebases.","status":"deprecated","version":"0.9.48.post4","language":"en","source_language":"en","source_url":"https://github.com/run-llama/llama_index","tags":["LLM","RAG","data framework","vector index","deprecated","compatibility"],"install":[{"cmd":"pip install llama-index-legacy","lang":"bash","label":"Install LlamaIndex Legacy"}],"dependencies":[{"reason":"Requires Python versions greater than or equal to 3.8.1 and less than 4.0.","package":"python","optional":false},{"reason":"Commonly used for LLM interactions and embeddings. The legacy package bundles many dependencies, including various LLM, embedding, and vector store integrations.","package":"openai","optional":true},{"reason":"Used for data validation and parsing, a core dependency across LlamaIndex.","package":"pydantic"}],"imports":[{"note":"For users sticking to the 0.9.x API, import from `llama_index.legacy`. The new `llama_index` package (v0.10+) uses `llama_index.core` for core abstractions.","wrong":"from llama_index import VectorStoreIndex","symbol":"VectorStoreIndex","correct":"from llama_index.legacy import VectorStoreIndex"},{"note":"Used for loading documents from a local directory.","symbol":"SimpleDirectoryReader","correct":"from llama_index.legacy import SimpleDirectoryReader"},{"note":"Example for importing a specific LLM integration from the legacy package structure.","symbol":"Replicate","correct":"from llama_index.legacy.llms import Replicate"}],"quickstart":{"code":"import os\nfrom llama_index.legacy import VectorStoreIndex, SimpleDirectoryReader\n\n# Set your OpenAI API key as an environment variable\nos.environ[\"OPENAI_API_KEY\"] = os.environ.get(\"OPENAI_API_KEY\", \"YOUR_OPENAI_API_KEY\")\n\n# Create a 'data' directory and place some text files inside it\n# e.g., echo \"The quick brown fox jumps over the lazy dog.\" > data/example.txt\n\n# Load documents from the specified directory\ndocuments = SimpleDirectoryReader(\"data\").load_data()\n\n# Create a vector store index from the loaded documents\nindex = VectorStoreIndex.from_documents(documents)\n\n# Create a query engine and query the index\nquery_engine = index.as_query_engine()\nresponse = query_engine.query(\"What did the fox do?\")\n\nprint(response.response)\n","lang":"python","description":"This quickstart demonstrates how to load documents from a local directory, create a vector store index, and query it using the legacy LlamaIndex API. Ensure you have an `OPENAI_API_KEY` set as an environment variable and a `data` directory with at least one text file."},"warnings":[{"fix":"Migrate your codebase to use `llama-index` (v0.10+) and its modular components, importing from `llama_index.core` and specific integration packages (e.g., `llama_index.llms.openai`). A CLI tool is available for automated import updates.","message":"The primary LlamaIndex library underwent a significant modularization in version 0.10.0, splitting into `llama-index-core` and numerous integration-specific packages. `llama-index-legacy` is provided as a temporary bridge for pre-v0.10.0 code, but new development should use the modular `llama-index` packages.","severity":"breaking","affected_versions":"<0.10.0"},{"fix":"Replace `ServiceContext` usage with `Settings` for global configuration or pass parameters directly. Update deprecated agent classes to use the `AgentWorkflow` abstraction.","message":"The `ServiceContext` object has been deprecated in favor of a global `Settings` object or local configurations passed directly to APIs. Many agent-related classes (e.g., `AgentRunner`, `FunctionCallingAgent`) are also deprecated in favor of `AgentWorkflow`.","severity":"deprecated","affected_versions":"<0.10.0"},{"fix":"Users are strongly encouraged to migrate their applications to the latest `llama-index` package and its modular components to ensure access to new features, bug fixes, and ongoing support.","message":"The `llama-index-legacy` package itself is deprecated and has been removed from the main LlamaIndex repository. This implies that it will receive minimal or no new features and potentially limited maintenance.","severity":"deprecated","affected_versions":"All versions"},{"fix":"When migrating to the latest LlamaIndex, ensure your environment uses a supported Python version, preferably 3.10 or newer, to align with ongoing development.","message":"While `llama-index-legacy` explicitly supports Python >=3.8.1 and <4.0, the broader `llama-index` ecosystem has begun deprecating Python 3.9 in recent releases of its modular packages. Users planning a migration should be aware of future Python version requirements.","severity":"gotcha","affected_versions":"All versions (for future compatibility)"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z"}