---
name: "llamaindex-advanced-rag-pipeline"
description: "Build enterprise retrieval-augmented generation with hierarchical node parsing and reranking."
metadata:
  author: "LlamaIndex"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "build advanced rag llamaindex"
  - "use sentence window retriever"
  - "add reranker llamaindex"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# LlamaIndex Advanced RAG Retrieval Pipeline

Constructs production RAG systems using LlamaIndex: HierarchicalNodeParser, AutoMergingRetriever, SentenceWindowNodeParser, and Cohere / BGE cross-encoder rerankers.

## When to Invoke
Invoke this skill whenever you need to:
- build advanced rag llamaindex
- use sentence window retriever
- add reranker llamaindex

## Execution SOP & Rules
1. Chunk documents with SentenceWindowNodeParser or HierarchicalNodeParser for contextual richness.
2. Use VectorIndexRetriever with similarity_top_k=10 followed by a post-processor reranker to top 3.
3. Apply metadata filters (e.g. document date, author, department) to constrain search spaces.
4. Log retrieval latency and evaluate answer faithfulness using LlamaIndex response evaluators.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
