# llamaindex-sop

Operating-system distillation of **LlamaIndex**, the leading RAG / document-agent framework. This skill is third-person analytical: it teaches an agent *how LlamaIndex thinks* about turning raw documents into a retrieval-grounded answer system. It captures the 5-layer mental model (Documents → Nodes → Indices → Retrievers → Query Engines / Response Synthesizers), the canonical "RAG bootstrap" SOP from `VectorStoreIndex` baseline through hybrid + reranker + eval-loop hardening, and ≥3 dilemma cases distilled from official docs, GitHub issues, and production post-mortems (chunk-size tradeoff, hybrid-vs-dense, agent-on-top-vs-RAG-as-tool, long-context-vs-retrieval). It also encodes the anti-patterns surfaced in LlamaIndex's own `rag_failure_mode_checklist`, defining when *not* to reach for LlamaIndex (small docs, pure structured SQL, hard real-time) and how it positions vs. LangChain/Haystack/raw vector store. Activate when the agent must build, debug, or harden a RAG pipeline over private/unstructured data, evaluate retrieval quality, or pick between RAG primitives and an agent.
