Skip to main content
skill CX Codex

llamaindex-development — Claude Code skill: what it does and install

Guides coding assistants in building Python RAG applications with LlamaIndex. Helps generate document parsers, vector indexes, and query engines.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Mindrally/skills --skill llamaindex-development -a claude-code
Open on GitHub

What llamaindex-development does

This skill instructs the agent on Python workflows for LlamaIndex. It enforces PEP 8 guidelines. The agent prioritizes functional routines over custom classes and follows a clear folder layout with loaders/ and query_engines/.

It provides patterns for ingesting documents, running semantic node parsing, and persisting indexes via StorageContext. Supported storage backends include Chroma, pgvector, Pinecone, and Qdrant.

You get templates for hybrid search using QueryFusionRetriever alongside post-processing filters. Connecting external stores or remote embeddings requires credentials set up in your project environment.

What it helps with

  • organize a modular LlamaIndex codebase using standard directory patterns
  • split documents into semantic chunks with SemanticSplitterNodeParser
  • set up hybrid retrieval combining vector search and BM25 keywords
  • persist and reload vector indexes using StorageContext

Example prompts for the agent

  • Write a script to load PDFs from ./data and index them into a local Chroma collection
  • Create a hybrid retriever using QueryFusionRetriever with BM25 and vector search
  • Configure a RetrieverQueryEngine with a similarity threshold of 0.7

How to install llamaindex-development

1Skills CLI (Vercel)

npx skills add Mindrally/skills --skill llamaindex-development -a claude-code

2Manually: put the files in place

~/.claude/skills/llamaindex-development/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/llamaindex-development/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about llamaindex-development

How to install llamaindex-development in Claude Code?

Run npx skills add Mindrally/skills --skill llamaindex-development -a claude-code. The rule file will be placed in ~/.claude/skills/llamaindex-development/SKILL.md.

What does llamaindex-development do?

It provides architecture rules, code conventions, and Python templates for building LlamaIndex RAG applications, retrievers, and query engines.

Which vector databases are covered by this skill?

It includes configurations for Chroma, Pinecone, Weaviate, Qdrant, MongoDB Atlas, and PostgreSQL with pgvector.

Source text

SKILL.md · Apache-2.0
---
name: llamaindex-development
description: Expert guidance for LlamaIndex development including RAG applications, vector stores, document processing, query engines, and building production AI applications.
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# LlamaIndex Development

You are an expert in LlamaIndex for building RAG (Retrieval-Augmented Generation) applications, data indexing, and LLM-powered applications with Python.

## Key Principles

- Write concise, technical responses with accurate Python examples
- Use functional, declarative programming; avoid classes where possible
- Prioritize code quality, maintainability, and performance
- Use descriptive variable names that reflect their purpose
- Follow PEP 8 style guidelines

## Code Organization

### Directory Structure

```
project/
├── data/                 # Source documents and data
├── indexes/              # Persisted index storage
├── loaders/              # Custom document loaders
├── retrievers/           # Custom retriever implementations
├── query_engines/        # Query engine configurations
├── prompts/              # Custom prompt templates
├── transformations/      # Document transformations
├── callbacks/            # Custom callback handlers
├── utils/                # Utility functions
├── tests/                # Test files
└── config/               # Configuration files
```

### Naming Conventions

- Use snake_case for files, functions, and variables
- Use PascalCase for classes
- Prefix private functions with underscore
- Use descriptive names (e.g., `create_vector_index`, `build_query_engine`)

## Document Loading

### Using Document Loaders

```python
from llama_index.core import SimpleDirectoryReader
from llama_index.readers.file import PDFReader, DocxReader

# Load from directory
documents = SimpleDirectoryReader(
    input_dir="./data",
    recursive=True,
    required_exts=[".pdf", ".txt", ".md"]
).load_data()

# Load specific file types
pdf_reader = PDFReader()
documents = pdf_reader.load_data(file="document.pdf")
```

### Custom Loaders

```python
from llama_index.core.readers.base import BaseReader
from llama_index.core import Document

class CustomLoader(BaseReader):
    def load_data(self, file_path: str) -> list[Document]:
        # Custom loading logic
        with open(file_path, 'r') as f:
            content = f.read()

        return [Document(
            text=content,
            metadata={"source": file_path}
        )]
```

## Text Splitting and Processing

### Node Parsing

```python
from llama_index.core.node_parser import (
    SentenceSplitter,
    SemanticSplitterNodeParser,
    MarkdownNodeParser
)

# Simple sentence splitting
splitter = SentenceSplitter(
    chunk_size=1024,
    chunk_overlap=200
)
nodes = splitter.get_nodes_from_documents(documents)

# Semantic splitting (preserves meaning)
from llama_index.embeddings.openai import OpenAIEmbedding

semantic_splitter = SemanticSplitterNodeParser(
    embed_model=OpenAIEmbedding(),
    breakpoint_percentile_threshold=95
)

# Markdown-aware splitting
markdown_splitter = MarkdownNodeParser()
```

### Best Practices for Chunking

- Choose chunk size based on your embedding model's context window
- Use overlap to maintain context between chunks
- Preserve document structure when possible
- Include metadata for filtering and retrieval
- Use semantic splitting for better coherence

## Vector Stores and Indexing

### Creating Indexes

```python
from llama_index.core import VectorStoreIndex, StorageContext
from llama_index.vector_stores.chroma import ChromaVectorStore
import chromadb

# In-memory index
index = VectorStoreIndex.from_documents(documents)

# With persistent vector store
chroma_client = chromadb.PersistentClient(path="./chroma_db")
chroma_collection = chroma_client.get_or_create_collection("my_collection")

vector_store = ChromaVectorStore(chroma_collection=chroma_collection)
storage_context = StorageContext.from_defaults(vector_store=vector_store)

index = VectorStoreIndex.from_documents(
    documents,
    storage_context=storage_context
)
```

### Supported Vector Stores

- Chroma (local development)
- Pinecone (production, managed)
- Weaviate (production, self-hosted or managed)
- Qdrant (production, self-hosted or managed)
- PostgreSQL with pgvector
- MongoDB Atlas Vector Search

### Index Persistence

```python
from llama_index.core import StorageContext, load_index_from_storage

# Persist index
index.storage_context.persist(persist_dir="./storage")

# Load index
storage_context = StorageContext.from_defaults(persist_dir="./storage")
index = load_index_from_storage(storage_context)
```

## Query Engines

### Basic Query Engine

```python
from llama_index.core import VectorStoreIndex

index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine(
    similarity_top_k=5,
    response_mode="compact"
)

response = query_engine.query("What is the main topic?")
print(response.response)
```

### Response Modes

- `refine`: Iteratively refine answer through each node
- `compact`: Combine chunks before sending to LLM
- `tree_summarize`: Build tree and summarize
- `simple_summarize`: Truncate and summarize
- `accumulate`: Accumulate responses from each node

### Advanced Query Engine

```python
from llama_index.core.query_engine import RetrieverQueryEngine
from llama_index.core.postprocessor import SimilarityPostprocessor

query_engine = RetrieverQueryEngine.from_args(
    retriever=index.as_retriever(similarity_top_k=10),
    node_postprocessors=[
        SimilarityPostprocessor(similarity_cutoff=0.7)
    ],
    response_mode="compact"
)
```

## Retrievers

### Custom Retrievers

```python
from llama_index.core.retrievers import VectorIndexRetriever

# Basic retriever
retriever = VectorIndexRetriever(
    index=index,
    similarity_top_k=10
)

# Retrieve nodes
nodes = retriever.retrieve("search query")
```

### Hybrid Search

```python
from llama_index.core.retrievers import QueryFusionRetriever

# Combine multiple retrieval strategies
retriever = QueryFusionRetriever(
    [
        index.as_retriever(similarity_top_k=5),
        bm25_retriever,  # Keyword-based
    ],
    num_queries=4,
    use_async=True
)
```

## Embeddings

### Embedding Models

```python
from llama_index.embeddings.openai import OpenAIEmbedding
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
from llama_index.core import Settings

# OpenAI embeddings
Settings.embed_model = OpenAIEmbedding(
    model="text-embedding-3-small",
    dimensions=512  # Optional dimension reduction
)

# Local embeddings
Settings.embed_model = HuggingFaceEmbedding(
    model_name="BAAI/bge-small-en-v1.5"
)
```

## LLM Configuration

### Setting Up LLMs

```python
from llama_index.llms.openai import OpenAI
from llama_index.llms.anthropic import Anthropic
from llama_index.core import Settings

# OpenAI
Settings.llm = OpenAI(
    model="gpt-4o",
    temperature=0.1
)

# Anthropic
Settings.llm = Anthropic(
    model="claude-sonnet-4-20250514",
    temperature=0.1
)
```

## Agents

### Building Agents

```python
from llama_index.core.agent import ReActAgent
from llama_index.core.tools import QueryEngineTool, ToolMetadata

# Create tools from query engines
tools = [
    QueryEngineTool(
        query_engine=documents_query_engine,
        metadata=ToolMetadata(
            name="documents",
            description="Search through documents"
        )
    ),
    QueryEngineTool(
        query_engine=code_query_engine,
        metadata=ToolMetadata(
            name="codebase",
            description="Search through code"
        )
    )
]

# Create agent
agent = ReActAgent.from_tools(
    tools,
    llm=llm,
    verbose=True
)

response = agent.chat("Find information about X")
```

## Performance Optimization

### Caching

```python
from llama_index.core import Settings
from llama_index.core.llms import LLMCache

# Enable LLM response caching
Settings.llm = OpenAI(model="gpt-4o")
Settings.llm_cache = LLMCache()
```

### Async Operations

```python
# Use async for better performance
response = await query_engine.aquery("question")

# Batch processing
responses = await asyncio.gather(*[
    query_engine.aquery(q) for q in questions
])
```

### Embedding Optimization

- Batch embeddings when possible
- Use smaller embedding dimensions when accuracy allows
- Cache embeddings for repeated documents
- Use local models for cost-sensitive applications

## Error Handling

```python
from llama_index.core.callbacks import CallbackManager, LlamaDebugHandler

# Debug handler for troubleshooting
debug_handler = LlamaDebugHandler()
callback_manager = CallbackManager([debug_handler])

Settings.callback_manager = callback_manager
```

## Testing

- Unit test document loaders and transformations
- Test retrieval quality with known queries
- Validate index persistence and loading
- Test query engine responses
- Monitor retrieval metrics (precision, recall)

## Dependencies

- llama-index
- llama-index-embeddings-openai
- llama-index-llms-openai
- llama-index-vector-stores-chroma
- chromadb
- python-dotenv
- pydantic

© Mindrally · Apache-2.0 · Mindrally/skills

Similar skills

Everything for AI and ML →

From the same set214

esbuild-bundler Teaches agents best practices for esbuild across browser and Node.js environments. Useful when configuring TypeScript, bundles, and dev servers. CX Codex +1 697installs supabase-development Gives the agent a working set of Supabase rules: schema design, RLS policies, auth, realtime subscriptions and Edge Functions. CX Codex +1 699installs monorepo A skill that hands your agent a rulebook for monorepos built on TypeScript, React, Next.js and Expo with Turbo. Useful when several apps and shared packages live in one repo. CX Codex +1 694installs less-best-practices This skill guides coding assistants on Less architecture, modular project layout, variable scales, and reusable mixins. Keep stylesheet specificity low and maintainable. CX Codex +1 692installs meta-prompt A skill with meta-prompting templates that critique model responses, walk through a solution path and give it a score. Handy when you need to check answer quality. CX Codex +1 691installs cloudflare-development A skill that hands your agent Cloudflare edge practices: Workers, Pages, KV, D1, R2 and Durable Objects. Useful when the agent writes worker code or edits wrangler.toml. CX Codex +1 689installs remix A skill that turns your coding agent into a Remix and TypeScript helper, with ready patterns for data loading, mutations and nested routes. CX Codex +1 686installs salesforce-dx A skill that makes your coding agent follow Salesforce DX conventions: Apex, triggers, LWC, scratch orgs and SFDX CLI workflows. CX Codex +1 688installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor