{"id":"llamaindex","kind":"sdk","name":"LlamaIndex","slug":"llamaindex","description":"Data framework for LLM apps: indexing, retrieval, and agents.","vendor":"LlamaIndex","languages":["python","typescript","javascript","nodejs"],"categories":["ai"],"homepage":"https://www.llamaindex.ai","docsUrl":"https://docs.llamaindex.ai","githubUrl":"https://github.com/run-llama","packages":[{"registry":"pypi","name":"llama-index","url":"https://pypi.org/project/llama-index/"},{"registry":"npm","name":"llamaindex","url":"https://www.npmjs.com/package/llamaindex"}],"tags":["rag","agents"],"skills":[{"name":"llamaparse","url":"https://skills.sh/run-llama/llamaparse-agent-skills/llamaparse","install":"npx skills add run-llama/llamaparse-agent-skills --skill llamaparse","sdk":"llamaindex","key":"llamaindex/llamaparse","description":"Use this skill when the user asks to parse the content of an unstructured file (PDF, PPTX, DOCX...)","hasContent":true,"content":"---\nname: llamaparse\ndescription: Use this skill when the user asks to parse the content of an unstructured file (PDF, PPTX, DOCX...)\ncompatibility: Needs a `LLAMA_CLOUD_API_KEY` defined within the environment and the `@llamaindex/llama-cloud@latest` typescript library installed.\nlicense: MIT\nmetadata:\n  author: LlamaIndex\n  version: \"1.0.0\"\n---\n\n# LlamaParse Skill\n\nParse unstructured documents (such as PDF, DOCX, PPTX, XLSX) with LlamaParse and extract their contents (text, markdown, images...).\n\n## Initial Setup\n\nWhen this skill is invoked, respond with:\n\n```\nI'm ready to use LlamaParse to parse files. Before we begin, please confirm that:\n\n- `LLAMA_CLOUD_API_KEY` is set as environment variable within the current environment\n- `@llamaindex/llama-cloud@latest` is installed and available within the current Node environment\n\nIf both of them are set, please provide:\n\n1. One or more files to be parsed\n2. Specific parsing options, such as tier, API version, custom prompt, processing options...\n3. Any requests you might have regarding the parsed content of the file.\n\nI will produce a Typescript script to run the parsing job and, once you approved its execution, I will report the results back to you based on your request.\n```\n\nThen wait for the user's input.\n\n---\n\n## Step 0 — Install `llama-cloud` (optional)\n\nIf the user does not have the `@llamaindex/llama-cloud` package installed, add it to the current environment by running:\n\n```bash\nnpm install @llamaindex/llama-cloud@latest\n```\n\n## Step 1 — Produce a Typescript Script\n\nOnce the user confirms the environment variables are set and provides the necessary details for the parsing job, produce a **typescript script**.\n\nAs a source of truth for the TS script, you can:\n\n- Refer to the [example.ts](scripts/example.ts) script, which covers most of the necessary configurations for LlamaParse\n- Refer to the complete LlamaParse Documentation, fetching the `https://developers.llamaindex.ai/python/cloud/llamaparse/api-v2-guide/` page.\n\n### Scripting Best Practices\n\nFollow these guidelines when generating scripts:\n\n#### 1. Always Use the Top-Level `LlamaCloud` Client\n\nUse `LlamaCloud` (the API client) for all parsing operations:\n\n```typescript\nimport LlamaCloud from \"@llamaindex/llama-cloud\";\n\n// Define a client\nconst client = new LlamaCloud({\n  apiKey: process.env[\"LLAMA_CLOUD_API_KEY\"], // This is the default and can be omitted\n});\n\n```\n\n#### 2. Two-Step Upload → Parse Pattern\n\nAlways upload first to get a file ID, then parse using the file ID. Never pass raw file bytes directly to `parse()`.\n\n```typescript\nimport { readFile, writeFile } from \"fs/promises\";\nimport { basename } from \"path\";\n\n// 1. Convert the file path into a File object\nconst buffer = await readFile(filePath);\nconst fileName = basename(filePath);\nconst file = new File([buffer], fileName);\n// 2. Upload the file to the cloud\nconst fileObj = await client.files.create({\n  file: file,\n  purpose: \"parse\",\n});\n// 3. Get the file ID\nconst fileId = fileObj.id;\n// 4. Use the file ID to parse the file\nconst result = await client.parsing.parse({\n  tier: \"agentic\",\n  version: \"latest\",\n  file_id: fileId,\n  ...\n});\n```\n\nIf the user already has a file ID (e.g. from a prior upload), skip the upload step and use it directly.\n\n#### 3. Choose the Right Tier\n\n| Tier | When to Use |\n|------|-------------|\n| `fast` | Speed is the priority; simple documents |\n| `cost_effective` | Budget-conscious; straightforward text extraction |\n| `agentic` | Complex layouts, tables, mixed content (default recommendation) |\n| `agentic_plus` | Advanced analysis, highest accuracy |\n\nDefault to `agentic` unless the user specifies otherwise or the document is simple.\n\n#### 4. Always Include the `expand` Parameter\n\nThe `expand` parameter controls what content is returned. Omitting it returns minimal data. Always specify exactly what you need:\n\n| Value | Returns |\n|-------|---------|\n| `text_full` | Plain text via `result.text_full` |\n| `markdown_full` | Markdown via `result.markdown_full` |\n| `items` | Page-level JSON via `result.items.pages` |\n| `text_content_metadata` | Per-page text metadata |\n| `markdown_content_metadata` | Per-page markdown metadata |\n| `items_content_metadata` | Per-page items metadata |\n| `images_content_metadata` | Image list with presigned URLs |\n| `output_pdf_content_metadata` | Output PDF metadata |\n| `xlsx_content_metadata` | Excel-specific metadata |\n\nOnly request metadata `*_content_metadata` variants when you need presigned URLs or per-page detail — they increase payload size.\n\n#### 5. Handle None Results Defensively\n\n`result.text_full`, `result.markdown_full`, and `result.items` may be `undefined` on failure. Always guard against this:\n\n```typescript\nconst text = result.text_full ?? \"\";\nconst markdown = result.markdown_full ?? \"\";\n```\n\n#### 6. Use Structured Options for Advanced Configuration\n\nGroup options using the correct nested keys:\n\n```typescript\nconst result = await client.parsing.parse({\n  tier: \"agentic\",\n  version: \"latest\",\n  file_id: fileId,\n  input_options: {\n    presentation: {\n      skip_embedded_data: false,\n    },\n  },\n  output_options: {\n    images_to_save: [\"screenshot\"],\n    markdown: {\n      tables: { output_tables_as_markdown: true },\n      annotate_links: true,\n    },\n  },\n  processing_options: {\n    specialized_chart_parsing: \"agentic\",\n    ocr_parameters: { languages: [\"de\", \"en\"] },\n  },\n  agentic_options: {\n    custom_prompt:\n      \"Extract text from the provided file and translate it from German to English.\",\n  },\n  expand: [\n    \"markdown_full\",\n    \"images_content_metadata\",\n    \"markdown_content_metadata\",\n  ],\n});\n```\n\nUse `agentic_options.custom_prompt` whenever the user wants to guide extraction (translation, summarization, structured extraction, etc.).\n\n#### 7. Downloading Images Requires `httpx` and Auth\n\nWhen `images_content_metadata` is in `expand`, download images via presigned URLs with Bearer auth:\n\n```typescript\nif (result.images_content_metadata) {\n  for (const image of result.images_content_metadata.images) {\n    if (image.presigned_url) {\n      const response = await fetch(image.presigned_url, {\n        headers: {\n          Authorization: `Bearer ${process.env[\"LLAMA_CLOUD_API_KEY\"]}`,\n        },\n      });\n      if (response.ok) {\n        const content = await response.bytes();\n        await writeFile(image.filename, content);\n      }\n    }\n  }\n}\n```\n\n#### 8. Use the Node shebang\n\nEvery generated script should include the node shebang:\n\n```typescript\n#!/usr/bin/env node\n```\n\n---\n\n## Step 2 — Execute the Typescript Script\n\nOnce the typescript script has been produced, you should:\n\n1. Present the script to the user and ask for permissions to run it (depending on the current permissions settings)\n2. Once you obtained permission to run, execute the script\n3. Explore the results based on the user's requests\n\n> In order to run typescript scripts, it is highly recommended to use: `npx tsx script.ts`.\n","contentSource":"skills.sh/api/download/run-llama/llamaparse-agent-skills/llamaparse","contentFetchedAt":"2026-07-27T08:59:35.347Z"},{"name":"llamaindex-development","url":"https://skills.sh/mindrally/skills/llamaindex-development","install":"npx skills add mindrally/skills --skill llamaindex-development","sdk":"llamaindex","key":"llamaindex/llamaindex-development","description":"Expert guidance for LlamaIndex development including RAG applications, vector stores, document processing, query engines, and building production AI applications.","hasContent":true,"content":"---\nname: llamaindex-development\ndescription: Expert guidance for LlamaIndex development including RAG applications, vector stores, document processing, query engines, and building production AI applications.\n---\n\n# LlamaIndex Development\n\nYou are an expert in LlamaIndex for building RAG (Retrieval-Augmented Generation) applications, data indexing, and LLM-powered applications with Python.\n\n## Key Principles\n\n- Write concise, technical responses with accurate Python examples\n- Use functional, declarative programming; avoid classes where possible\n- Prioritize code quality, maintainability, and performance\n- Use descriptive variable names that reflect their purpose\n- Follow PEP 8 style guidelines\n\n## Code Organization\n\n### Directory Structure\n\n```\nproject/\n├── data/                 # Source documents and data\n├── indexes/              # Persisted index storage\n├── loaders/              # Custom document loaders\n├── retrievers/           # Custom retriever implementations\n├── query_engines/        # Query engine configurations\n├── prompts/              # Custom prompt templates\n├── transformations/      # Document transformations\n├── callbacks/            # Custom callback handlers\n├── utils/                # Utility functions\n├── tests/                # Test files\n└── config/               # Configuration files\n```\n\n### Naming Conventions\n\n- Use snake_case for files, functions, and variables\n- Use PascalCase for classes\n- Prefix private functions with underscore\n- Use descriptive names (e.g., `create_vector_index`, `build_query_engine`)\n\n## Document Loading\n\n### Using Document Loaders\n\n```python\nfrom llama_index.core import SimpleDirectoryReader\nfrom llama_index.readers.file import PDFReader, DocxReader\n\n# Load from directory\ndocuments = SimpleDirectoryReader(\n    input_dir=\"./data\",\n    recursive=True,\n    required_exts=[\".pdf\", \".txt\", \".md\"]\n).load_data()\n\n# Load specific file types\npdf_reader = PDFReader()\ndocuments = pdf_reader.load_data(file=\"document.pdf\")\n```\n\n### Custom Loaders\n\n```python\nfrom llama_index.core.readers.base import BaseReader\nfrom llama_index.core import Document\n\nclass CustomLoader(BaseReader):\n    def load_data(self, file_path: str) -> list[Document]:\n        # Custom loading logic\n        with open(file_path, 'r') as f:\n            content = f.read()\n\n        return [Document(\n            text=content,\n            metadata={\"source\": file_path}\n        )]\n```\n\n## Text Splitting and Processing\n\n### Node Parsing\n\n```python\nfrom llama_index.core.node_parser import (\n    SentenceSplitter,\n    SemanticSplitterNodeParser,\n    MarkdownNodeParser\n)\n\n# Simple sentence splitting\nsplitter = SentenceSplitter(\n    chunk_size=1024,\n    chunk_overlap=200\n)\nnodes = splitter.get_nodes_from_documents(documents)\n\n# Semantic splitting (preserves meaning)\nfrom llama_index.embeddings.openai import OpenAIEmbedding\n\nsemantic_splitter = SemanticSplitterNodeParser(\n    embed_model=OpenAIEmbedding(),\n    breakpoint_percentile_threshold=95\n)\n\n# Markdown-aware splitting\nmarkdown_splitter = MarkdownNodeParser()\n```\n\n### Best Practices for Chunking\n\n- Choose chunk size based on your embedding model's context window\n- Use overlap to maintain context between chunks\n- Preserve document structure when possible\n- Include metadata for filtering and retrieval\n- Use semantic splitting for better coherence\n\n## Vector Stores and Indexing\n\n### Creating Indexes\n\n```python\nfrom llama_index.core import VectorStoreIndex, StorageContext\nfrom llama_index.vector_stores.chroma import ChromaVectorStore\nimport chromadb\n\n# In-memory index\nindex = VectorStoreIndex.from_documents(documents)\n\n# With persistent vector store\nchroma_client = chromadb.PersistentClient(path=\"./chroma_db\")\nchroma_collection = chroma_client.get_or_create_collection(\"my_collection\")\n\nvector_store = ChromaVectorStore(chroma_collection=chroma_collection)\nstorage_context = StorageContext.from_defaults(vector_store=vector_store)\n\nindex = VectorStoreIndex.from_documents(\n    documents,\n    storage_context=storage_context\n)\n```\n\n### Supported Vector Stores\n\n- Chroma (local development)\n- Pinecone (production, managed)\n- Weaviate (production, self-hosted or managed)\n- Qdrant (production, self-hosted or managed)\n- PostgreSQL with pgvector\n- MongoDB Atlas Vector Search\n\n### Index Persistence\n\n```python\nfrom llama_index.core import StorageContext, load_index_from_storage\n\n# Persist index\nindex.storage_context.persist(persist_dir=\"./storage\")\n\n# Load index\nstorage_context = StorageContext.from_defaults(persist_dir=\"./storage\")\nindex = load_index_from_storage(storage_context)\n```\n\n## Query Engines\n\n### Basic Query Engine\n\n```python\nfrom llama_index.core import VectorStoreIndex\n\nindex = VectorStoreIndex.from_documents(documents)\nquery_engine = index.as_query_engine(\n    similarity_top_k=5,\n    response_mode=\"compact\"\n)\n\nresponse = query_engine.query(\"What is the main topic?\")\nprint(response.response)\n```\n\n### Response Modes\n\n- `refine`: Iteratively refine answer through each node\n- `compact`: Combine chunks before sending to LLM\n- `tree_summarize`: Build tree and summarize\n- `simple_summarize`: Truncate and summarize\n- `accumulate`: Accumulate responses from each node\n\n### Advanced Query Engine\n\n```python\nfrom llama_index.core.query_engine import RetrieverQueryEngine\nfrom llama_index.core.postprocessor import SimilarityPostprocessor\n\nquery_engine = RetrieverQueryEngine.from_args(\n    retriever=index.as_retriever(similarity_top_k=10),\n    node_postprocessors=[\n        SimilarityPostprocessor(similarity_cutoff=0.7)\n    ],\n    response_mode=\"compact\"\n)\n```\n\n## Retrievers\n\n### Custom Retrievers\n\n```python\nfrom llama_index.core.retrievers import VectorIndexRetriever\n\n# Basic retriever\nretriever = VectorIndexRetriever(\n    index=index,\n    similarity_top_k=10\n)\n\n# Retrieve nodes\nnodes = retriever.retrieve(\"search query\")\n```\n\n### Hybrid Search\n\n```python\nfrom llama_index.core.retrievers import QueryFusionRetriever\n\n# Combine multiple retrieval strategies\nretriever = QueryFusionRetriever(\n    [\n        index.as_retriever(similarity_top_k=5),\n        bm25_retriever,  # Keyword-based\n    ],\n    num_queries=4,\n    use_async=True\n)\n```\n\n## Embeddings\n\n### Embedding Models\n\n```python\nfrom llama_index.embeddings.openai import OpenAIEmbedding\nfrom llama_index.embeddings.huggingface import HuggingFaceEmbedding\nfrom llama_index.core import Settings\n\n# OpenAI embeddings\nSettings.embed_model = OpenAIEmbedding(\n    model=\"text-embedding-3-small\",\n    dimensions=512  # Optional dimension reduction\n)\n\n# Local embeddings\nSettings.embed_model = HuggingFaceEmbedding(\n    model_name=\"BAAI/bge-small-en-v1.5\"\n)\n```\n\n## LLM Configuration\n\n### Setting Up LLMs\n\n```python\nfrom llama_index.llms.openai import OpenAI\nfrom llama_index.llms.anthropic import Anthropic\nfrom llama_index.core import Settings\n\n# OpenAI\nSettings.llm = OpenAI(\n    model=\"gpt-4o\",\n    temperature=0.1\n)\n\n# Anthropic\nSettings.llm = Anthropic(\n    model=\"claude-sonnet-4-20250514\",\n    temperature=0.1\n)\n```\n\n## Agents\n\n### Building Agents\n\n```python\nfrom llama_index.core.agent import ReActAgent\nfrom llama_index.core.tools import QueryEngineTool, ToolMetadata\n\n# Create tools from query engines\ntools = [\n    QueryEngineTool(\n        query_engine=documents_query_engine,\n        metadata=ToolMetadata(\n            name=\"documents\",\n            description=\"Search through documents\"\n        )\n    ),\n    QueryEngineTool(\n        query_engine=code_query_engine,\n        metadata=ToolMetadata(\n            name=\"codebase\",\n            description=\"Search through code\"\n        )\n    )\n]\n\n# Create agent\nagent = ReActAgent.from_tools(\n    tools,\n    llm=llm,\n    verbose=True\n)\n\nresponse = agent.chat(\"Find information about X\")\n```\n\n## Performance Optimization\n\n### Caching\n\n```python\nfrom llama_index.core import Settings\nfrom llama_index.core.llms import LLMCache\n\n# Enable LLM response caching\nSettings.llm = OpenAI(model=\"gpt-4o\")\nSettings.llm_cache = LLMCache()\n```\n\n### Async Operations\n\n```python\n# Use async for better performance\nresponse = await query_engine.aquery(\"question\")\n\n# Batch processing\nresponses = await asyncio.gather(*[\n    query_engine.aquery(q) for q in questions\n])\n```\n\n### Embedding Optimization\n\n- Batch embeddings when possible\n- Use smaller embedding dimensions when accuracy allows\n- Cache embeddings for repeated documents\n- Use local models for cost-sensitive applications\n\n## Error Handling\n\n```python\nfrom llama_index.core.callbacks import CallbackManager, LlamaDebugHandler\n\n# Debug handler for troubleshooting\ndebug_handler = LlamaDebugHandler()\ncallback_manager = CallbackManager([debug_handler])\n\nSettings.callback_manager = callback_manager\n```\n\n## Testing\n\n- Unit test document loaders and transformations\n- Test retrieval quality with known queries\n- Validate index persistence and loading\n- Test query engine responses\n- Monitor retrieval metrics (precision, recall)\n\n## Dependencies\n\n- llama-index\n- llama-index-embeddings-openai\n- llama-index-llms-openai\n- llama-index-vector-stores-chroma\n- chromadb\n- python-dotenv\n- pydantic\n","contentSource":"skills.sh/api/download/mindrally/skills/llamaindex-development","contentFetchedAt":"2026-07-27T08:59:35.510Z"}],"official":true,"generatedAt":"2026-07-27T09:02:29.956Z"}