[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74YY3HG96K0VP9NGC8GQKB8":3,"skill-same:01M74YY3HG96K0VP9NGC8GQKB8":76},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":37,"ownerDescription":38,"updatedAt":39,"install":40,"resources":53},"01M74YY3HG96K0VP9NGC8GQKB8","llamaindex",null,"Data framework for building LLM applications with RAG. Specializes in document ingestion (300+ connectors), indexing, and querying. Features vector indices, query engines, agents, and multi-modal support. Use for document Q&A, chatbots, knowledge retrieval, or building RAG pipelines. Best for data-centric LLM applications.","KalarisLabs\u002Fresearch-agent-skills","KalarisLabs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F300878568?v=4","01M74Y7MT23GXXC56VM6TVSXZY","Kalarislabs","01M74Y7MTQM9REXZX4SNXWX95C",132,"MIT","https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fllamaindex\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: llamaindex\ndescription: Data framework for building LLM applications with RAG. Specializes in document ingestion (300+ connectors), indexing, and querying. Features vector indices, query engines, agents, and multi-modal support. Use for document Q&A, chatbots, knowledge retrieval, or building RAG pipelines. Best for data-centric LLM applications.\nlicense: MIT\nmetadata:\n  version: 1.0.0\n  category: llm-applications\n  maintainer: Kalaris Labs\n  tags: Agents, LlamaIndex, RAG, Document Ingestion, Vector Indices, Query Engines, Knowledge Retrieval, Data Framework, Multimodal, Private Data, Connectors\n  dependencies: llama-index, openai, anthropic\n---\n\n# LlamaIndex - Data Framework for LLM Applications\n\nThe leading framework for connecting LLMs with your data.\n\n## When to use LlamaIndex\n\n**Use LlamaIndex when:**\n- Building RAG (retrieval-augmented generation) applications\n- Need document question-answering over private data\n- Ingesting data from multiple sources (300+ connectors)\n- Creating knowledge bases for LLMs\n- Building chatbots with enterprise data\n- Need structured data extraction from documents\n\n**Metrics**:\n- **23,000+ repositories** use LlamaIndex\n- **300+ data connectors** (LlamaHub)\n- **1,715+ contributors**\n- **v0.14.7** (stable)\n\n**Use alternatives instead**:\n- **LangChain**: More general-purpose, better for agents\n- **Haystack**: Production search pipelines\n- **txtai**: Lightweight semantic search\n- **Chroma**: Just need vector storage\n\n## Quick start\n\n### Installation\n\n```bash\n# Starter package (recommended)\npip install llama-index\n\n# Or minimal core + specific integrations\npip install llama-index-core\npip install llama-index-llms-openai\npip install llama-index-embeddings-openai\n```\n\n### 5-line RAG example\n\n```python\nfrom llama_index.core import VectorStoreIndex, SimpleDirectoryReader\n\n# Load documents\ndocuments = SimpleDirectoryReader(\"data\").load_data()\n\n# Create index\nindex = VectorStoreIndex.from_documents(documents)\n\n# Query\nquery_engine = index.as_query_engine()\nresponse = query_engine.query(\"What did the author do growing up?\")\nprint(response)\n```\n\n## Core concepts\n\n### 1. Data connectors - Load documents\n\n```python\nfrom llama_index.core import SimpleDirectoryReader, Document\nfrom llama_index.readers.web import SimpleWebPageReader\nfrom llama_index.readers.github import GithubRepositoryReader\n\n# Directory of files\ndocuments = SimpleDirectoryReader(\".\u002Fdata\").load_data()\n\n# Web pages\nreader = SimpleWebPageReader()\ndocuments = reader.load_data([\"https:\u002F\u002Fexample.com\"])\n\n# GitHub repository\nreader = GithubRepositoryReader(owner=\"user\", repo=\"repo\")\ndocuments = reader.load_data(branch=\"main\")\n\n# Manual document creation\ndoc = Document(\n    text=\"This is the document content\",\n    metadata={\"source\": \"manual\", \"date\": \"2025-01-01\"}\n)\n```\n\n### 2. Indices - Structure data\n\n```python\nfrom llama_index.core import VectorStoreIndex, ListIndex, TreeIndex\n\n# Vector index (most common - semantic search)\nvector_index = VectorStoreIndex.from_documents(documents)\n\n# List index (sequential scan)\nlist_index = ListIndex.from_documents(documents)\n\n# Tree index (hierarchical summary)\ntree_index = TreeIndex.from_documents(documents)\n\n# Save index\nindex.storage_context.persist(persist_dir=\".\u002Fstorage\")\n\n# Load index\nfrom llama_index.core import load_index_from_storage, StorageContext\nstorage_context = StorageContext.from_defaults(persist_dir=\".\u002Fstorage\")\nindex = load_index_from_storage(storage_context)\n```\n\n### 3. Query engines - Ask questions\n\n```python\n# Basic query\nquery_engine = index.as_query_engine()\nresponse = query_engine.query(\"What is the main topic?\")\nprint(response)\n\n# Streaming response\nquery_engine = index.as_query_engine(streaming=True)\nresponse = query_engine.query(\"Explain quantum computing\")\nfor text in response.response_gen:\n    print(text, end=\"\", flush=True)\n\n# Custom configuration\nquery_engine = index.as_query_engine(\n    similarity_top_k=3,          # Return top 3 chunks\n    response_mode=\"compact\",     # Or \"tree_summarize\", \"simple_summarize\"\n    verbose=True\n)\n```\n\n### 4. Retrievers - Find relevant chunks\n\n```python\n# Vector retriever\nretriever = index.as_retriever(similarity_top_k=5)\nnodes = retriever.retrieve(\"machine learning\")\n\n# With filtering\nretriever = index.as_retriever(\n    similarity_top_k=3,\n    filters={\"metadata.category\": \"tutorial\"}\n)\n\n# Custom retriever\nfrom llama_index.core.retrievers import BaseRetriever\n\nclass CustomRetriever(BaseRetriever):\n    def _retrieve(self, query_bundle):\n        # Your custom retrieval logic\n        return nodes\n```\n\n## Agents with tools\n\nDetails, code examples and parameter tables: [references\u002Fagents-with-tools.md](references\u002Fagents-with-tools.md). Read it when this step applies.\n\n## Advanced RAG patterns\n\nDetails, code examples and parameter tables: [references\u002Fadvanced-rag-patterns.md](references\u002Fadvanced-rag-patterns.md). Read it when this step applies.\n\n## Data ingestion patterns\n\n### Multiple file types\n\n```python\n# Load all supported formats\ndocuments = SimpleDirectoryReader(\n    \".\u002Fdata\",\n    recursive=True,\n    required_exts=[\".pdf\", \".docx\", \".txt\", \".md\"]\n).load_data()\n```\n\n### Web scraping\n\n```python\nfrom llama_index.readers.web import BeautifulSoupWebReader\n\nreader = BeautifulSoupWebReader()\ndocuments = reader.load_data(urls=[\n    \"https:\u002F\u002Fdocs.python.org\u002F3\u002Ftutorial\u002F\",\n    \"https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002F\"\n])\n```\n\n### Database\n\n```python\nfrom llama_index.readers.database import DatabaseReader\n\nreader = DatabaseReader(\n    sql_database_uri=\"postgresql:\u002F\u002Fuser:pass@localhost\u002Fdb\"\n)\ndocuments = reader.load_data(query=\"SELECT * FROM articles\")\n```\n\n### API endpoints\n\n```python\nfrom llama_index.readers.json import JSONReader\n\nreader = JSONReader()\ndocuments = reader.load_data(\"https:\u002F\u002Fapi.example.com\u002Fdata.json\")\n```\n\n## Vector store integrations\n\n### Chroma (local)\n\n```python\nfrom llama_index.vector_stores.chroma import ChromaVectorStore\nimport chromadb\n\n# Initialize Chroma\ndb = chromadb.PersistentClient(path=\".\u002Fchroma_db\")\ncollection = db.get_or_create_collection(\"my_collection\")\n\n# Create vector store\nvector_store = ChromaVectorStore(chroma_collection=collection)\n\n# Use in index\nfrom llama_index.core import StorageContext\nstorage_context = StorageContext.from_defaults(vector_store=vector_store)\nindex = VectorStoreIndex.from_documents(documents, storage_context=storage_context)\n```\n\n### Pinecone (cloud)\n\n```python\nfrom llama_index.vector_stores.pinecone import PineconeVectorStore\nimport pinecone\n\n# Initialize Pinecone\npinecone.init(api_key=\"your-key\", environment=\"us-west1-gcp\")\npinecone_index = pinecone.Index(\"my-index\")\n\n# Create vector store\nvector_store = PineconeVectorStore(pinecone_index=pinecone_index)\nstorage_context = StorageContext.from_defaults(vector_store=vector_store)\n\nindex = VectorStoreIndex.from_documents(documents, storage_context=storage_context)\n```\n\n### FAISS (fast)\n\n```python\nfrom llama_index.vector_stores.faiss import FaissVectorStore\nimport faiss\n\n# Create FAISS index\nd = 1536  # Dimension of embeddings\nfaiss_index = faiss.IndexFlatL2(d)\n\nvector_store = FaissVectorStore(faiss_index=faiss_index)\nstorage_context = StorageContext.from_defaults(vector_store=vector_store)\n\nindex = VectorStoreIndex.from_documents(documents, storage_context=storage_context)\n```\n\n## Customization\n\n### Custom LLM\n\n```python\nfrom llama_index.llms.anthropic import Anthropic\nfrom llama_index.core import Settings\n\n# Set global LLM\nSettings.llm = Anthropic(model=\"claude-sonnet-4-5-20250929\")\n\n# Now all queries use Anthropic\nquery_engine = index.as_query_engine()\n```\n\n### Custom embeddings\n\n```python\nfrom llama_index.embeddings.huggingface import HuggingFaceEmbedding\n\n# Use HuggingFace embeddings\nSettings.embed_model = HuggingFaceEmbedding(\n    model_name=\"sentence-transformers\u002Fall-mpnet-base-v2\"\n)\n\nindex = VectorStoreIndex.from_documents(documents)\n```\n\n### Custom prompt templates\n\n```python\nfrom llama_index.core import PromptTemplate\n\nqa_prompt = PromptTemplate(\n    \"Context: {context_str}\\n\"\n    \"Question: {query_str}\\n\"\n    \"Answer the question based only on the context. \"\n    \"If the answer is not in the context, say 'I don't know'.\\n\"\n    \"Answer: \"\n)\n\nquery_engine = index.as_query_engine(text_qa_template=qa_prompt)\n```\n\n## Multi-modal RAG\n\n### Image + text\n\n```python\nfrom llama_index.core import SimpleDirectoryReader\nfrom llama_index.multi_modal_llms.openai import OpenAIMultiModal\n\n# Load images and documents\ndocuments = SimpleDirectoryReader(\n    \".\u002Fdata\",\n    required_exts=[\".jpg\", \".png\", \".pdf\"]\n).load_data()\n\n# Multi-modal index\nindex = VectorStoreIndex.from_documents(documents)\n\n# Query with multi-modal LLM\nmulti_modal_llm = OpenAIMultiModal(model=\"gpt-4o\")\nquery_engine = index.as_query_engine(llm=multi_modal_llm)\n\nresponse = query_engine.query(\"What is in the diagram on page 3?\")\n```\n\n## Evaluation\n\n### Response quality\n\n```python\nfrom llama_index.core.evaluation import RelevancyEvaluator, FaithfulnessEvaluator\n\n# Evaluate relevance\nrelevancy = RelevancyEvaluator()\nresult = relevancy.evaluate_response(\n    query=\"What is Python?\",\n    response=response\n)\nprint(f\"Relevancy: {result.passing}\")\n\n# Evaluate faithfulness (no hallucination)\nfaithfulness = FaithfulnessEvaluator()\nresult = faithfulness.evaluate_response(\n    query=\"What is Python?\",\n    response=response\n)\nprint(f\"Faithfulness: {result.passing}\")\n```\n\n## Best practices\n\n1. **Use vector indices for most cases** - Best performance\n2. **Save indices to disk** - Avoid re-indexing\n3. **Chunk documents properly** - 512-1024 tokens optimal\n4. **Add metadata** - Enables filtering and tracking\n5. **Use streaming** - Better UX for long responses\n6. **Enable verbose during dev** - See retrieval process\n7. **Evaluate responses** - Check relevance and faithfulness\n8. **Use chat engine for conversations** - Built-in memory\n9. **Persist storage** - Don't lose your index\n10. **Monitor costs** - Track embedding and LLM usage\n\n## Common patterns\n\n### Document Q&A system\n\n```python\n# Complete RAG pipeline\ndocuments = SimpleDirectoryReader(\"docs\").load_data()\nindex = VectorStoreIndex.from_documents(documents)\nindex.storage_context.persist(persist_dir=\".\u002Fstorage\")\n\n# Query\nquery_engine = index.as_query_engine(\n    similarity_top_k=3,\n    response_mode=\"compact\",\n    verbose=True\n)\nresponse = query_engine.query(\"What is the main topic?\")\nprint(response)\nprint(f\"Sources: {[node.metadata['file_name'] for node in response.source_nodes]}\")\n```\n\n### Chatbot with memory\n\n```python\n# Conversational interface\nchat_engine = index.as_chat_engine(\n    chat_mode=\"condense_plus_context\",\n    verbose=True\n)\n\n# Multi-turn chat\nwhile True:\n    user_input = input(\"You: \")\n    if user_input.lower() == \"quit\":\n        break\n    response = chat_engine.chat(user_input)\n    print(f\"Bot: {response}\")\n```\n\n## Performance benchmarks\n\n| Operation | Latency | Notes |\n|-----------|---------|-------|\n| Index 100 docs | ~10-30s | One-time, can persist |\n| Query (vector) | ~0.5-2s | Retrieval + LLM |\n| Streaming query | ~0.5s first token | Better UX |\n| Agent with tools | ~3-8s | Multiple tool calls |\n\n## LlamaIndex vs LangChain\n\n| Feature | LlamaIndex | LangChain |\n|---------|------------|-----------|\n| **Best for** | RAG, document Q&A | Agents, general LLM apps |\n| **Data connectors** | 300+ (LlamaHub) | 100+ |\n| **RAG focus** | Core feature | One of many |\n| **Learning curve** | Easier for RAG | Steeper |\n| **Customization** | High | Very high |\n| **Documentation** | Excellent | Good |\n\n**Use LlamaIndex when:**\n- Your primary use case is RAG\n- Need many data connectors\n- Want simpler API for document Q&A\n- Building knowledge retrieval system\n\n**Use LangChain when:**\n- Building complex agents\n- Need more general-purpose tools\n- Want more flexibility\n- Complex multi-step workflows\n\n## References\n\n- **[Query Engines Guide](references\u002Fquery_engines.md)** - Query modes, customization, streaming\n- **[Agents Guide](references\u002Fagents.md)** - Tool creation, RAG agents, multi-step reasoning\n- **[Data Connectors Guide](references\u002Fdata_connectors.md)** - 300+ connectors, custom loaders\n\n## Resources\n\n- **GitHub**: https:\u002F\u002Fgithub.com\u002Frun-llama\u002Fllama_index ⭐ 45,100+\n- **Docs**: https:\u002F\u002Fdevelopers.llamaindex.ai\u002Fpython\u002Fframework\u002F\n- **LlamaHub**: https:\u002F\u002Fllamahub.ai (data connectors)\n- **LlamaCloud**: https:\u002F\u002Fcloud.llamaindex.ai (enterprise)\n- **Discord**: https:\u002F\u002Fdiscord.gg\u002FdGcwcsnxhU\n- **Version**: 0.14.7+\n- **License**: MIT\n\n## Agent operating procedure\n\n1. **Check the environment.** Confirm the framework version, model provider, API keys and rate limits.\n2. **Pin down the inputs.** Confirm formats, identifiers and parameters from the data or the user. Ask rather than guess any value that changes the result.\n3. **Run a small version first.** Test a single call or chain with a known input and inspect raw outputs.\n4. **Execute the full task** using the instructions and references above.\n5. **Validate the result.** Evaluate on a small labeled set; check structured outputs against their schema; log prompts and responses.\n6. **Report.** State what was run (versions, commands, parameters), what was checked, and what is still uncertain.\n\n| If this happens | Do this |\n|---|---|\n| Outputs do not match the expected schema | Add validation and retries, tighten the schema, or simplify the prompt. |\n| A function, flag or endpoint in these instructions is missing in the installed version | Check the installed version's own documentation (`help()`, `--help`, official docs), adapt, and tell the user. Never invent an API. |\n| A required input, identifier or parameter is ambiguous | Ask the user, or state the assumption explicitly before running. |\n\n**Integrity rules**\n\n- Never fabricate results, parameters, identifiers, citations or statistics. If something cannot be run or verified, say so plainly.\n- Never send private or sensitive data to external APIs without the user's consent.\n- Treat version-specific details here as possibly outdated: confirm them against the official documentation for the installed version.\n- Ask before actions that cost money, consume shared GPUs or cloud quota, touch personal or patient data, or cannot be undone.\n\n## Related skills\n\n- `langchain`: Framework for building LLM-powered applications with agents, chains, and RAG.\n- `chroma`: Open-source embedding database for AI applications.\n- `langsmith-observability`: LLM observability platform for tracing, evaluation, and monitoring.\n","# LlamaIndex - Data Framework for LLM Applications\n\nThe leading framework for connecting LLMs with your data.\n\n## When to use LlamaIndex\n\n**Use LlamaIndex when:**\n- Building RAG (retrieval-augmented generation) applications\n- Need document question-answering over private data\n- Ingesting data from multiple sources (300+ connectors)\n- Creating knowledge bases for LLMs\n- Building chatbots with enterprise data\n- Need structured data extraction from documents\n\n**Metrics**:\n- **23,000+ repositories** use LlamaIndex\n- **300+ data connectors** (LlamaHub)\n- **1,715+ contributors**\n- **v0.14.7** (stable)\n\n**Use alternatives instead**:\n- **LangChain**: More general-purpose, better for agents\n- **Haystack**: Production search pipelines\n- **txtai**: Lightweight semantic search\n- **Chroma**: Just need vector storage\n\n## Quick start\n\n### Installation\n\n```bash\n# Starter package (recommended)\npip install llama-index\n\n# Or minimal core + specific integrations\npip install llama-index-core\npip install llama-index-llms-openai\npip install llama-index-embeddings-openai\n```\n\n### 5-line RAG example\n\n```python\nfrom llama_index.core import VectorStoreIndex, SimpleDirectoryReader\n\n# Load documents\ndocuments = SimpleDirectoryReader(\"data\").load_data()\n\n# Create index\nindex = VectorStoreIndex.from_documents(documents)\n\n# Query\nquery_engine = index.as_query_engine()\nresponse = query_engine.query(\"What did the author do growing up?\")\nprint(response)\n```\n\n## Core concepts\n\n### 1. Data connectors - Load documents\n\n```python\nfrom llama_index.core import SimpleDirectoryReader, Document\nfrom llama_index.readers.web import SimpleWebPageReader\nfrom llama_index.readers.github import GithubRepositoryReader\n\n# Directory of files\ndocuments = SimpleDirectoryReader(\".\u002Fdata\").load_data()\n\n# Web pages\nreader = SimpleWebPageReader()\ndocuments = reader.load_data([\"https:\u002F\u002Fexample.com\"])\n\n# GitHub repository\nreader = GithubRepositoryReader(owner=\"user\", repo=\"repo\")\ndocuments = reader.load_data(branch=\"main\")\n\n# Manual document creation\ndoc = Document(\n    text=\"This is the document content\",\n    metadata={\"source\": \"manual\", \"date\": \"2025-01-01\"}\n)\n```\n\n### 2. Indices - Structure data\n\n```python\nfrom llama_index.core import VectorStoreIndex, ListIndex, TreeIndex\n\n# Vector index (most common - semantic search)\nvector_index = VectorStoreIndex.from_documents(documents)\n\n# List index (sequential scan)\nlist_index = ListIndex.from_documents(documents)\n\n# Tree index (hierarchical summary)\ntree_index = TreeIndex.from_documents(documents)\n\n# Save index\nindex.storage_context.persist(persist_dir=\".\u002Fstorage\")\n\n# Load index\nfrom llama_index.core import load_index_from_storage, StorageContext\nstorage_context = StorageContext.from_defaults(persist_dir=\".\u002Fstorage\")\nindex = load_index_from_storage(storage_context)\n```\n\n### 3. Query engines - Ask questions\n\n```python\n# Basic query\nquery_engine = index.as_query_engine()\nresponse = query_engine.query(\"What is the main topic?\")\nprint(response)\n\n# Streaming response\nquery_engine = index.as_query_engine(streaming=True)\nresponse = query_engine.query(\"Explain quantum computing\")\nfor text in response.response_gen:\n    print(text, end=\"\", flush=True)\n\n# Custom configuration\nquery_engine = index.as_query_engine(\n    similarity_top_k=3,          # Return top 3 chunks\n    response_mode=\"compact\",     # Or \"tree_summarize\", \"simple_summarize\"\n    verbose=True\n)\n```\n\n### 4. Retrievers - Find relevant chunks\n\n```python\n# Vector retriever\nretriever = index.as_retriever(similarity_top_k=5)\nnodes = retriever.retrieve(\"machine learning\")\n\n# With filtering\nretriever = index.as_retriever(\n    similarity_top_k=3,\n    filters={\"metadata.category\": \"tutorial\"}\n)\n\n# Custom retriever\nfrom llama_index.core.retrievers import BaseRetriever\n\nclass CustomRetriever(BaseRetriever):\n    def _retrieve(self, query_bundle):\n        # Your custom retrieval logic\n        return nodes\n```\n\n## Agents with tools\n\nDetails, code examples and parameter tables: [references\u002Fagents-with-tools.md](references\u002Fagents-with-tools.md). Read it when this step applies.\n\n## Advanced RAG patterns\n\nDetails, code examples and parameter tables: [references\u002Fadvanced-rag-patterns.md](references\u002Fadvanced-rag-patterns.md). Read it when this step applies.\n\n## Data ingestion patterns\n\n### Multiple file types\n\n```python\n# Load all supported formats\ndocuments = SimpleDirectoryReader(\n    \".\u002Fdata\",\n    recursive=True,\n    required_exts=[\".pdf\", \".docx\", \".txt\", \".md\"]\n).load_data()\n```\n\n### Web scraping\n\n```python\nfrom llama_index.readers.web import BeautifulSoupWebReader\n\nreader = BeautifulSoupWebReader()\ndocuments = reader.load_data(urls=[\n    \"https:\u002F\u002Fdocs.python.org\u002F3\u002Ftutorial\u002F\",\n    \"https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002F\"\n])\n```\n\n### Database\n\n```python\nfrom llama_index.readers.database import DatabaseReader\n\nreader = DatabaseReader(\n    sql_database_uri=\"postgresql:\u002F\u002Fuser:pass@localhost\u002Fdb\"\n)\ndocuments = reader.load_data(query=\"SELECT * FROM articles\")\n```\n\n### API endpoints\n\n```python\nfrom llama_index.readers.json import JSONReader\n\nreader = JSONReader()\ndocuments = reader.load_data(\"https:\u002F\u002Fapi.example.com\u002Fdata.json\")\n```\n\n## Vector store integrations\n\n### Chroma (local)\n\n```python\nfrom llama_index.vector_stores.chroma import ChromaVectorStore\nimport chromadb\n\n# Initialize Chroma\ndb = chromadb.PersistentClient(path=\".\u002Fchroma_db\")\ncollection = db.get_or_create_collection(\"my_collection\")\n\n# Create vector store\nvector_store = ChromaVectorStore(chroma_collection=collection)\n\n# Use in index\nfrom llama_index.core import StorageContext\nstorage_context = StorageContext.from_defaults(vector_store=vector_store)\nindex = VectorStoreIndex.from_documents(documents, storage_context=storage_context)\n```\n\n### Pinecone (cloud)\n\n```python\nfrom llama_index.vector_stores.pinecone import PineconeVectorStore\nimport pinecone\n\n# Initialize Pinecone\npinecone.init(api_key=\"your-key\", environment=\"us-west1-gcp\")\npinecone_index = pinecone.Index(\"my-index\")\n\n# Create vector store\nvector_store = PineconeVectorStore(pinecone_index=pinecone_index)\nstorage_context = StorageContext.from_defaults(vector_store=vector_store)\n\nindex = VectorStoreIndex.from_documents(documents, storage_context=storage_context)\n```\n\n### FAISS (fast)\n\n```python\nfrom llama_index.vector_stores.faiss import FaissVectorStore\nimport faiss\n\n# Create FAISS index\nd = 1536  # Dimension of embeddings\nfaiss_index = faiss.IndexFlatL2(d)\n\nvector_store = FaissVectorStore(faiss_index=faiss_index)\nstorage_context = StorageContext.from_defaults(vector_store=vector_store)\n\nindex = VectorStoreIndex.from_documents(documents, storage_context=storage_context)\n```\n\n## Customization\n\n### Custom LLM\n\n```python\nfrom llama_index.llms.anthropic import Anthropic\nfrom llama_index.core import Settings\n\n# Set global LLM\nSettings.llm = Anthropic(model=\"claude-sonnet-4-5-20250929\")\n\n# Now all queries use Anthropic\nquery_engine = index.as_query_engine()\n```\n\n### Custom embeddings\n\n```python\nfrom llama_index.embeddings.huggingface import HuggingFaceEmbedding\n\n# Use HuggingFace embeddings\nSettings.embed_model = HuggingFaceEmbedding(\n    model_name=\"sentence-transformers\u002Fall-mpnet-base-v2\"\n)\n\nindex = VectorStoreIndex.from_documents(documents)\n```\n\n### Custom prompt templates\n\n```python\nfrom llama_index.core import PromptTemplate\n\nqa_prompt = PromptTemplate(\n    \"Context: {context_str}\\n\"\n    \"Question: {query_str}\\n\"\n    \"Answer the question based only on the context. \"\n    \"If the answer is not in the context, say 'I don't know'.\\n\"\n    \"Answer: \"\n)\n\nquery_engine = index.as_query_engine(text_qa_template=qa_prompt)\n```\n\n## Multi-modal RAG\n\n### Image + text\n\n```python\nfrom llama_index.core import SimpleDirectoryReader\nfrom llama_index.multi_modal_llms.openai import OpenAIMultiModal\n\n# Load images and documents\ndocuments = SimpleDirectoryReader(\n    \".\u002Fdata\",\n    required_exts=[\".jpg\", \".png\", \".pdf\"]\n).load_data()\n\n# Multi-modal index\nindex = VectorStoreIndex.from_documents(documents)\n\n# Query with multi-modal LLM\nmulti_modal_llm = OpenAIMultiModal(model=\"gpt-4o\")\nquery_engine = index.as_query_engine(llm=multi_modal_llm)\n\nresponse = query_engine.query(\"What is in the diagram on page 3?\")\n```\n\n## Evaluation\n\n### Response quality\n\n```python\nfrom llama_index.core.evaluation import RelevancyEvaluator, FaithfulnessEvaluator\n\n# Evaluate relevance\nrelevancy = RelevancyEvaluator()\nresult = relevancy.evaluate_response(\n    query=\"What is Python?\",\n    response=response\n)\nprint(f\"Relevancy: {result.passing}\")\n\n# Evaluate faithfulness (no hallucination)\nfaithfulness = FaithfulnessEvaluator()\nresult = faithfulness.evaluate_response(\n    query=\"What is Python?\",\n    response=response\n)\nprint(f\"Faithfulness: {result.passing}\")\n```\n\n## Best practices\n\n1. **Use vector indices for most cases** - Best performance\n2. **Save indices to disk** - Avoid re-indexing\n3. **Chunk documents properly** - 512-1024 tokens optimal\n4. **Add metadata** - Enables filtering and tracking\n5. **Use streaming** - Better UX for long responses\n6. **Enable verbose during dev** - See retrieval process\n7. **Evaluate responses** - Check relevance and faithfulness\n8. **Use chat engine for conversations** - Built-in memory\n9. **Persist storage** - Don't lose your index\n10. **Monitor costs** - Track embedding and LLM usage\n\n## Common patterns\n\n### Document Q&A system\n\n```python\n# Complete RAG pipeline\ndocuments = SimpleDirectoryReader(\"docs\").load_data()\nindex = VectorStoreIndex.from_documents(documents)\nindex.storage_context.persist(persist_dir=\".\u002Fstorage\")\n\n# Query\nquery_engine = index.as_query_engine(\n    similarity_top_k=3,\n    response_mode=\"compact\",\n    verbose=True\n)\nresponse = query_engine.query(\"What is the main topic?\")\nprint(response)\nprint(f\"Sources: {[node.metadata['file_name'] for node in response.source_nodes]}\")\n```\n\n### Chatbot with memory\n\n```python\n# Conversational interface\nchat_engine = index.as_chat_engine(\n    chat_mode=\"condense_plus_context\",\n    verbose=True\n)\n\n# Multi-turn chat\nwhile True:\n    user_input = input(\"You: \")\n    if user_input.lower() == \"quit\":\n        break\n    response = chat_engine.chat(user_input)\n    print(f\"Bot: {response}\")\n```\n\n## Performance benchmarks\n\n| Operation | Latency | Notes |\n|-----------|---------|-------|\n| Index 100 docs | ~10-30s | One-time, can persist |\n| Query (vector) | ~0.5-2s | Retrieval + LLM |\n| Streaming query | ~0.5s first token | Better UX |\n| Agent with tools | ~3-8s | Multiple tool calls |\n\n## LlamaIndex vs LangChain\n\n| Feature | LlamaIndex | LangChain |\n|---------|------------|-----------|\n| **Best for** | RAG, document Q&A | Agents, general LLM apps |\n| **Data connectors** | 300+ (LlamaHub) | 100+ |\n| **RAG focus** | Core feature | One of many |\n| **Learning curve** | Easier for RAG | Steeper |\n| **Customization** | High | Very high |\n| **Documentation** | Excellent | Good |\n\n**Use LlamaIndex when:**\n- Your primary use case is RAG\n- Need many data connectors\n- Want simpler API for document Q&A\n- Building knowledge retrieval system\n\n**Use LangChain when:**\n- Building complex agents\n- Need more general-purpose tools\n- Want more flexibility\n- Complex multi-step workflows\n\n## References\n\n- **[Query Engines Guide](references\u002Fquery_engines.md)** - Query modes, customization, streaming\n- **[Agents Guide](references\u002Fagents.md)** - Tool creation, RAG agents, multi-step reasoning\n- **[Data Connectors Guide](references\u002Fdata_connectors.md)** - 300+ connectors, custom loaders\n\n## Resources\n\n- **GitHub**: https:\u002F\u002Fgithub.com\u002Frun-llama\u002Fllama_index ⭐ 45,100+\n- **Docs**: https:\u002F\u002Fdevelopers.llamaindex.ai\u002Fpython\u002Fframework\u002F\n- **LlamaHub**: https:\u002F\u002Fllamahub.ai (data connectors)\n- **LlamaCloud**: https:\u002F\u002Fcloud.llamaindex.ai (enterprise)\n- **Discord**: https:\u002F\u002Fdiscord.gg\u002FdGcwcsnxhU\n- **Version**: 0.14.7+\n- **License**: MIT\n\n## Agent operating procedure\n\n1. **Check the environment.** Confirm the framework version, model provider, API keys and rate limits.\n2. **Pin down the inputs.** Confirm formats, identifiers and parameters from the data or the user. Ask rather than guess any value that changes the result.\n3. **Run a small version first.** Test a single call or chain with a known input and inspect raw outputs.\n4. **Execute the full task** using the instructions and references above.\n5. **Validate the result.** Evaluate on a small labeled set; check structured outputs against their schema; log prompts and responses.\n6. **Report.** State what was run (versions, commands, parameters), what was checked, and what is still uncertain.\n\n| If this happens | Do this |\n|---|---|\n| Outputs do not match the expected schema | Add validation and retries, tighten the schema, or simplify the prompt. |\n| A function, flag or endpoint in these instructions is missing in the installed version | Check the installed version's own documentation (`help()`, `--help`, official docs), adapt, and tell the user. Never invent an API. |\n| A required input, identifier or parameter is ambiguous | Ask the user, or state the assumption explicitly before running. |\n\n**Integrity rules**\n\n- Never fabricate results, parameters, identifiers, citations or statistics. If something cannot be run or verified, say so plainly.\n- Never send private or sensitive data to external APIs without the user's consent.\n- Treat version-specific details here as possibly outdated: confirm them against the official documentation for the installed version.\n- Ask before actions that cost money, consume shared GPUs or cloud quota, touch personal or patient data, or cannot be undone.\n\n## Related skills\n\n- `langchain`: Framework for building LLM-powered applications with agents, chains, and RAG.\n- `chroma`: Open-source embedding database for AI applications.\n- `langsmith-observability`: LLM observability platform for tracing, evaluation, and monitoring.\n",{"name":5,"license":15,"metadata":24,"description":7},{"tags":25,"version":26,"category":27,"maintainer":28,"dependencies":29},"Agents, LlamaIndex, RAG, Document Ingestion, Vector Indices, Query Engines, Knowledge Retrieval, Data Framework, Multimodal, Private Data, Connectors","1.0.0","llm-applications","Kalaris Labs","llama-index, openai, anthropic","main","29fe36d26127205057d5e0ed8425f6b0e9a8c13a","skills\u002Fllamaindex",16,"https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills","https:\u002F\u002Fdocs.kalarislabs.com\u002Fresearch-agent-skills","https:\u002F\u002Fgithub.com\u002FKalarisLabs","kalarislabs.com","Applied AI lab building the infrastructure for the agentic era","2026-11-14 17:49:08",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add KalarisLabs\u002Fresearch-agent-skills --skill llamaindex",{"tool":46,"command":47},"bunx","bunx skills add KalarisLabs\u002Fresearch-agent-skills --skill llamaindex",{"tool":49,"command":50},"pnpm","pnpm dlx skills add KalarisLabs\u002Fresearch-agent-skills --skill llamaindex","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fllamaindex\u002FSKILL.md",true,[54,60,64,68,72],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fadvanced-rag-patterns.md","REFERENCE","参考文档",1444,"https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fllamaindex\u002Freferences\u002Fadvanced-rag-patterns.md",{"path":61,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fagents-with-tools.md",1190,"https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fllamaindex\u002Freferences\u002Fagents-with-tools.md",{"path":65,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Fagents.md",1958,"https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fllamaindex\u002Freferences\u002Fagents.md",{"path":69,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fdata_connectors.md",2307,"https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fllamaindex\u002Freferences\u002Fdata_connectors.md",{"path":73,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fquery_engines.md",9905,"https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fllamaindex\u002Freferences\u002Fquery_engines.md",[77,84,91,98,105,112],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M74Z8MGT305R11SNY5G28QH5","plos","Prepare manuscripts for PLOS journals (PLOS ONE, PLOS Biology, PLOS Computational Biology, PLOS Genetics, PLOS Medicine, PLOS Pathogens, PLOS Neglected Tropical Diseases, PLOS Global Public Health and others), covering structure, abstract and author summary, Vancouver-style references, the mandatory data availability policy, ethics and financial disclosure statements, figure requirements (PACE), the PLOS LaTeX template, reporting guidelines and PLOS ONE's publication criteria. Use when targeting any PLOS journal or checking compliance with PLOS policies.","https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fplos\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M74Z8CCN9APXYHNQ95V1EBGT","pkpd-modeling","Pharmacokinetic and pharmacodynamic modelling and simulation - non-compartmental analysis, compartmental and population PK, PK\u002FPD and exposure-response, TMDD, PBPK orientation, bioequivalence, allometric scaling and first-in-human dose, drug interaction prediction, and Bayesian therapeutic drug monitoring. Use when analysing concentration-time data, deriving exposure metrics, fitting PK or PD models, or evaluating dosing regimens. Triggers include \"pharmacokinetics\", \"pharmacodynamics\", \"PK\u002FPD\", \"NCA\", \"non-compartmental\", \"AUC\", \"Cmax\", \"lambda z\", \"half-life\", \"clearance\", \"volume of distribution\", \"compartmental model\", \"population PK\", \"popPK\", \"NONMEM\", \"nlmixr2\", \"Pharmpy\", \"Monolix\", \"exposure-response\", \"Emax\", \"EC50\", \"indirect response\", \"effect compartment\", \"TMDD\", \"PBPK\", \"bioequivalence\", \"RSABE\", \"ABEL\", \"allometric scaling\", \"first-in-human\", \"MABEL\", \"drug-drug interaction\", \"DDI\", \"ICH M12\", \"concentration-QTc\", \"therapeutic drug monitoring\", \"MIPD\", and \"dosing regimen\".","https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpkpd-modeling\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M74Z86YHJJ1FM3X87BHN76KZ","pinecone","Guides use of Pinecone, a managed serverless vector database, through its Python client and the LangChain and LlamaIndex integrations. Covers creating indexes, upserting and querying vectors, metadata filtering, namespaces, hybrid dense and sparse search, index management, and deleting vectors. Use when building a production RAG system on a hosted vector store, adding semantic search or recommendations without running infrastructure, isolating per-user or per-tenant data with namespaces, combining dense and sparse vectors in one query, or filtering results by metadata. Do not use for self-hosted or local stores (Chroma, Weaviate) or offline similarity search (FAISS).","https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpinecone\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M74Z80T6E89SAJ8MYDD0767Q","pi-agent","Build with and use Pi, the minimal terminal coding harness. Use for installing Pi, configuring providers\u002Fmodels\u002Fsettings\u002Fenvironment variables, creating Pi skills\u002Fextensions\u002Fpackages\u002Fthemes\u002Fprompt templates, embedding Pi through the SDK, integrating over RPC or JSON event streams, parsing sessions, running local models through the llama.cpp router, developing custom Pi providers and TUI components, or using ecosystem packages such as pi-subagents (delegation\u002Forchestration), pi-mcp-adapter (MCP servers), pi-interview (interactive forms), and pi-web-access (web search, fetching, video understanding).","https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpi-agent\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":19},"01M74Z7WF1Y8Q3VFAQPPPRAFMV","phoenix-observability","Open-source AI observability platform for LLM tracing, evaluation, and monitoring. Use when debugging LLM applications with detailed traces, running evaluations on datasets, or monitoring production AI systems with real-time insights.","https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fphoenix-observability\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":19},"01M74Z7HNEH1A2AVYR3G1X2QV6","peft-fine-tuning","Fine-tunes LLMs with Hugging Face PEFT, using LoRA, QLoRA, IA3, AdaLoRA, prefix tuning, and prompt tuning so that under 1% of parameters are trained. Covers rank, alpha, and target module selection, loading and merging adapters, multi-adapter serving, and integration with TRL SFTTrainer, Axolotl, and vLLM. Use when fine-tuning 7B-70B models on limited GPU memory, when running QLoRA on a single 24GB GPU, when choosing LoRA rank and alpha, when merging or swapping adapters on one base model, or when debugging CUDA OOM or an adapter that does not apply. Not for full fine-tuning of small models under 1B parameters or cases needing all weights updated.","https:\u002F\u002Fgithub.com\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpeft-fine-tuning\u002FSKILL.md",[],[]]