{"id":1537,"library":"llama-index-indices-managed-llama-cloud","title":"Llama-Index Managed Llama Cloud Indices","description":"This library provides integration for LlamaIndex to create, manage, and query indices hosted on Llama Cloud. It enables persistent, scalable, and production-ready Retrieval-Augmented Generation (RAG) solutions without needing to manage vector databases or other infrastructure directly. The current version is `0.11.1`, and it follows the frequent release cadence of the broader LlamaIndex ecosystem, often tied to Llama Cloud service updates.","status":"active","version":"0.11.1","language":"en","source_language":"en","source_url":"https://github.com/run-llama/llama_index","tags":["llama-index","rag","managed","cloud","vector-database","llm","ai"],"install":[{"cmd":"pip install llama-index-indices-managed-llama-cloud","lang":"bash","label":"Install package"}],"dependencies":[{"reason":"Core LlamaIndex framework for building LLM applications.","package":"llama-index","optional":false}],"imports":[{"note":"LlamaCloudReader is for data ingestion, LlamaCloudIndex is for managing the index itself.","wrong":"from llama_index.readers.llama_cloud import LlamaCloudReader","symbol":"LlamaCloudIndex","correct":"from llama_index.indices.managed.llama_cloud import LlamaCloudIndex"}],"quickstart":{"code":"import os\nfrom llama_index.indices.managed.llama_cloud import LlamaCloudIndex\nfrom llama_index.core.schema import Document\n\n# Set your Llama Cloud API key as an environment variable\n# You can obtain one from app.llamacloud.ai\napi_key = os.environ.get(\"LLAMA_CLOUD_API_KEY\", \"\")\nif not api_key:\n    print(\"Warning: LLAMA_CLOUD_API_KEY environment variable not set. The example will not fully function without it.\")\n\n# Define some documents to be indexed\ndocuments = [\n    Document(text=\"The quick brown fox jumps over the lazy dog.\"),\n    Document(text=\"LlamaIndex helps build LLM applications with external data.\")\n]\n\n# Create a new managed index or connect to an existing one by name.\n# If the index 'my_managed_index_example' doesn't exist, it will be created.\n# If it exists, the documents will be upserted.\nprint(f\"Attempting to create/connect to Llama Cloud Index 'my_managed_index_example'...\")\nindex = LlamaCloudIndex.from_documents(\n    documents,\n    name=\"my_managed_index_example\", # Use a unique name for your index\n    api_key=api_key\n)\nprint(f\"Successfully connected to Llama Cloud Index: {index.index_name}\")\n\n# Query the index using a query engine\nquery_engine = index.as_query_engine()\nquery_text = \"What does LlamaIndex help with?\"\nprint(f\"\\nQuery: {query_text}\")\nresponse = query_engine.query(query_text)\nprint(f\"Response: {response}\")\n","lang":"python","description":"This quickstart demonstrates how to initialize a `LlamaCloudIndex`, optionally providing documents for ingestion, and then querying it. It assumes the `LLAMA_CLOUD_API_KEY` environment variable is set for authentication with Llama Cloud."},"warnings":[{"fix":"Ensure `LLAMA_CLOUD_API_KEY` is set in your environment (e.g., `export LLAMA_CLOUD_API_KEY='your-key'`) or passed directly as `api_key='your-key'` to the `LlamaCloudIndex` constructor.","message":"The `LLAMA_CLOUD_API_KEY` environment variable or `api_key` parameter in `LlamaCloudIndex` initialization is mandatory for authentication with Llama Cloud. Forgetting to set it will result in authentication errors and prevent index operations.","severity":"gotcha","affected_versions":"All versions"},{"fix":"It is highly recommended to pin the exact versions of both `llama-index` and `llama-index-indices-managed-llama-cloud` in your `requirements.txt` or `pyproject.toml` to ensure stability: `llama-index==x.y.z` and `llama-index-indices-managed-llama-cloud==a.b.c`.","message":"The LlamaIndex ecosystem undergoes rapid development. Frequent updates in the core `llama-index` library can introduce API changes that might affect the `llama-index-indices-managed-llama-cloud` package. This can lead to breaking changes between minor versions.","severity":"breaking","affected_versions":"All versions, especially when upgrading `llama-index`."},{"fix":"Always use a distinct name for a truly new index. If you intend to update an existing index, explicitly pass `index_name` and handle document updates accordingly. Consider checking for index existence before creating if logic depends on it.","message":"When creating or connecting to an index, the `name` parameter in `LlamaCloudIndex` must be unique within your Llama Cloud project. If you call `from_documents` or `from_index_name` with an existing name, it will connect to that index. If new documents are provided, they will be upserted into the existing index, which might not be the intended behavior if you expect a fresh index.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}