/major-ai-skills:llamaindexfrom major-ai-skills
Build production LlamaIndex ingestion, VectorStoreIndex, and query engines with chunk/metadata discipline, idempotent pipelines, and retrieval eval agents miss.
Ships in major-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
LlamaIndex connects LLMs to private data via loaders → node parsers → indexes → retrievers → response synthesizers. Ingestion builds nodes + embeddings into a vector store (local or @qdrant / @chromadb); query time retrieves nodes and synthesizes answers with source citations. Prefer IngestionPipeline for repeatable jobs, but treat pipeline runs as fail-closed: verify docstore/vector consistency after errors (historically, failed transforms could poison hashes or drop chunks—pin recent llama-index-core and re-check counts).
┌─────────────────────────────────────────────────────────────┐
│ LlamaIndex RAG loop │
│ │
│ Ingestion │
│ Documents → NodeParser (chunk/overlap) → Embeddings │
│ → Docstore + VectorStore (+ optional cache) │
│ │
│ Query │
│ QueryEngine / ChatEngine │
│ ├── Retriever (top_k, filters, hybrid) │
│ ├── Postprocessors (rerank, similarity cutoff) │
│ └── Response synthesizer + source_nodes │
│ │
│ Eval │
│ └── Hit-rate@k on labeled Qs before prompt polish │
└─────────────────────────────────────────────────────────────┘
Use when
Do not use when
@openai-api / @anthropic-api.@langchain / LangGraph.source, tenant_id, as_of, ACL tags) on every node; filter at query time.Settings; re-embed the whole corpus when the embed model changes.source_nodes (path/page/score) whenever factual claims matter.import os
from llama_index.core import (
Settings,
StorageContext,
VectorStoreIndex,
SimpleDirectoryReader,
load_index_from_storage,
)
from llama_index.core.node_parser import SentenceSplitter
from llama_index.llms.openai import OpenAI
from llama_index.embeddings.openai import OpenAIEmbedding
Settings.llm = OpenAI(model="gpt-4.1-mini", temperature=0)
Settings.embed_model = OpenAIEmbedding(model="text-embedding-3-small")
Settings.node_parser = SentenceSplitter(chunk_size=512, chunk_overlap=64)
PERSIST = "storage/policies"
def build_or_load_index(data_dir: str = "data/policies") -> VectorStoreIndex:
if os.path.isdir(PERSIST) and os.listdir(PERSIST):
storage = StorageContext.from_defaults(persist_dir=PERSIST)
return load_index_from_storage(storage)
docs = SimpleDirectoryReader(data_dir).load_data()
for d in docs:
d.metadata.setdefault("tenant_id", "default")
d.metadata.setdefault("source", d.metadata.get("file_path", "unknown"))
index = VectorStoreIndex.from_documents(docs, show_progress=True)
index.storage_context.persist(persist_dir=PERSIST)
return index
index = build_or_load_index()
engine = index.as_query_engine(
similarity_top_k=4,
response_mode="compact",
)
resp = engine.query("What is the refund window for annual plans?")
print(resp)
for n in resp.source_nodes:
print(n.metadata.get("source"), n.score, n.node.get_content()[:120])
from llama_index.core.ingestion import IngestionPipeline
from llama_index.core.node_parser import SentenceSplitter
from llama_index.embeddings.openai import OpenAIEmbedding
pipeline = IngestionPipeline(
transformations=[
SentenceSplitter(chunk_size=512, chunk_overlap=64),
OpenAIEmbedding(model="text-embedding-3-small"),
],
)
# Prefer explicit vector_store + docstore for multi-process serving (@qdrant)
nodes = pipeline.run(documents=docs, show_progress=True)
assert nodes, "ingestion produced zero nodes — refuse silent success"
Validation loop:
# Count docs vs nodes; run labeled questions; log empty retrieval rate
python -c "from app import index; print(index.vector_store)" # smoke
| Signature | Likely cause | Fix path |
|---|---|---|
| Irrelevant context | Chunk size wrong / no metadata filters | Retune splitter; add filters; rerank |
| Empty / thin answers | Bad reader paths; zero docs loaded | Count load_data(); fix paths/permissions |
| “Document missing” after failed ingest | Pipeline wrote hashes/deletes before embed succeeded | Upgrade llama-index-core; wipe poisoned hashes; re-run; assert counts |
| Only last chunk of each doc present | Historical upsert dict-by-ref_doc_id bug | Upgrade core; re-ingest; verify node count ≫ doc count |
| Embedding mismatch / nonsense scores | Embed model changed without re-index | Full re-embed; version collection name |
| Token blowups / truncated synth | top_k too high / huge chunks | Lower k; compress; similarity cutoff |
| Cross-tenant leak | Missing tenant_id filter | Mandatory metadata filter + app authZ |
| PDF garbage text | Layout/table-heavy PDF | Specialized loaders / OCR; don’t blame the LLM first |
@prefect jobs) from online query paths.@qdrant or @chromadb for multi-process / multi-host serving—not only in-memory stores.source_nodes in the API.policies_v3_emb3small) when embed model or chunking changes.@ai-evaluation-dataset).llama-index-core, llama-index-llms-*, embeddings, vector stores)—pin all used extras.@langchain — orchestration / multi-tool agents@qdrant / @chromadb — production vector stores@openai-api / @anthropic-api — underlying providers@prefect — scheduled ingestion@ai-evaluation-dataset — labeled RAG casesMANDATORY: Pin embed and LLM models; re-embed on embed-model change. Attach and filter metadata for tenancy. Persist indexes outside the request path. Return source nodes for factual answers. After ingestion errors, verify node/doc counts—never assume success. Keys from environment only.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization./act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.Other plugins' skills for the same job