[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6QF25ASMQ8H8PZN5ZA1Y2ZB":3,"skill-same:01M6QF25ASMQ8H8PZN5ZA1Y2ZB":105},{"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":28,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":60,"commitSha":61,"skillDirectory":62,"forksCount":14,"repositoryHtmlUrl":63,"repositoryHomepageUrl":64,"ownerHtmlUrl":65,"ownerBlogUrl":66,"ownerDescription":67,"updatedAt":68,"install":69,"resources":82},"01M6QF25ASMQ8H8PZN5ZA1Y2ZB","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.","Tashima-Tarsh\u002FDisha6.6","Tashima-Tarsh","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F269906498?v=4","01M6PBH98X03XERH0HFT4PFB1P","NITISH KUMAR","01M6PBH9DA0M6KM3Z12P848F0K",0,"MIT","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-llamaindex\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"LlamaIndex","LLM Applications","for","q&a","Private Data","Data Framework","Knowledge Retrieval","Query Engines","Vector Indices","Document Ingestion","connectors","chatbots","indexing","document","use","knowledge","applications","multimodal","vector","rag","2026-11-10 10:12:30",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":54,"description":7},{"tags":55,"version":56,"category":57,"maintainer":58,"dependencies":59},"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","0da4485785ee599388900be50db1635489d53056",".agents\u002Fskills\u002Fkal-llamaindex","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6","https:\u002F\u002Fdisha6.6.thenitishkr.in\u002F","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh","www.thenitishkr","thenitishkr | AI • Cyber-security • Research\r\n","2026-11-08 03:33:25",{"source":8,"skillName":5,"commands":70,"prompt":80,"zipAvailable":81},[71,74,77],{"tool":72,"command":73},"npx","npx skills add Tashima-Tarsh\u002FDisha6.6 --skill llamaindex",{"tool":75,"command":76},"bunx","bunx skills add Tashima-Tarsh\u002FDisha6.6 --skill llamaindex",{"tool":78,"command":79},"pnpm","pnpm dlx skills add Tashima-Tarsh\u002FDisha6.6 --skill llamaindex","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-llamaindex\u002FSKILL.md",true,[83,89,93,97,101],{"path":84,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fadvanced-rag-patterns.md","REFERENCE","参考文档",1444,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-llamaindex\u002Freferences\u002Fadvanced-rag-patterns.md",{"path":90,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fagents-with-tools.md",1190,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-llamaindex\u002Freferences\u002Fagents-with-tools.md",{"path":94,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Fagents.md",1958,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-llamaindex\u002Freferences\u002Fagents.md",{"path":98,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":99,"sourceHtmlUrl":100},"references\u002Fdata_connectors.md",2307,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-llamaindex\u002Freferences\u002Fdata_connectors.md",{"path":102,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":103,"sourceHtmlUrl":104},"references\u002Fquery_engines.md",9905,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-llamaindex\u002Freferences\u002Fquery_engines.md",[106,135,159,186,211,235],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":115,"publishedAt":49},"01M6QRD07D4TGNDK6VJ4EHF8BV","youtube-full","Use when the user needs YouTube transcripts, video search, channel browsing, playlist extraction, or content monitoring. Trigger phrases: 'get the transcript for', 'search YouTube for', 'what are the latest videos on', 'list this playlist', 'monitor this channel', or any request involving a YouTube URL, video ID, or @handle. Do NOT use for downloading video or audio files, YouTube engagement data (likes, comments), or private\u002Fage-restricted videos.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fyoutube-full\u002FSKILL.md",[112],{"categoryNo":113,"categoryName":114,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000016","图像与多媒体",[116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,31,132,133,134],"youtube full","youtube","full","transcript","search","monitoring","data","Video","Audio","list","files","do","get","age","trigger","URL","browsing","request","youtube transcripts",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":49},"01M6QRCJ3112VYPA97YG7KGMC2","x-twitter-growth","X\u002FTwitter growth engine for building audience, crafting viral content, and analyzing engagement. Use when the user wants to grow on X\u002FTwitter, write tweets or threads, analyze their X profile, research competitors on X, plan a posting strategy, or optimize engagement. Complements social-content (generic multi-platform) with X-specific depth: algorithm mechanics, thread engineering, reply strategy, profile optimization, and competitive intelligence via web search.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fx-twitter-growth\u002FSKILL.md",[],[142,143,144,145,120,146,147,148,149,150,151,152,153,154,43,155,156,157,158,31],"twitter","x twitter growth","growth","research","content","engineering","plan","web search","competitors","analyze","engine","write","strategy","platform","grow","posting","competitive",{"skillNo":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":168,"publishedAt":49},"01M6QRBN3EHQNJY42RERP7A149","write-a-skill","Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, build, or author a new skill.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrite-a-skill\u002FSKILL.md",[165],{"categoryNo":166,"categoryName":167,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[169,153,170,171,172,173,174,175,43,176,177,60,178,179,180,181,182,183,184,185],"write a skill","github","create","https","productivity","matt pocock","direct","example","build","new skill","structure","new agent","resources","with","tree","progressive disclosure","author",{"skillNo":187,"name":188,"nameZh":6,"description":189,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":190,"categories":191,"keywords":192,"publishedAt":49},"01M6QRB6G8P33PNGAF9Y69EJ9T","wrap-up","Close out a launched Claude Managed Agent — recap every primitive the founder now owns, regenerate the single-file overview page, and suggest the next 1-2 upgrades. Use when the user says \"wrap up\", \"close this out\", \"what do I own now\", \"give me the summary\", \"recap the agent\", or when the orchestrator routes phase=wrap-up. primitives_inventory.py tables everything owned (agent, environment, session, memory, outcome, deployment); overview_page.py regenerates a self-contained .\u002Fmy-agent\u002Fagent-overview.html; upgrade_suggester.py ranks the next moves from recorded deferrals plus standing hardening steps. Companion to run-without-you; the last stop before phase=done.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrap-up\u002FSKILL.md",[],[193,194,195,196,197,198,199,200,201,43,202,127,203,204,205,206,207,208,209,210],"wrap up","up","wrap","gemini","deployment","run","file","hardening","closeout","stop","upgrade","founder","close","companion","you","tables","directions","phase",{"skillNo":212,"name":213,"nameZh":6,"description":214,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":215,"categories":216,"keywords":218,"publishedAt":49},"01M6QRA5AYC1RBFZ39GTWGS3N8","workflow-builder","Design and write deterministic multi-agent workflow scripts (.js files in .claude\u002Fworkflows\u002F) for Claude Code's Workflow tool. Use when a user wants to build, create, author, scaffold, or run a custom Claude Code workflow, orchestrate sub-agents (fan-out, pipeline, loop, judge-panel), or automate a repeatable multi-step task across fresh-context agents.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fworkflow-builder\u002FSKILL.md",[217],{"categoryNo":166,"categoryName":167,"taxonomyType":21,"taxonomyTypeDesc":22},[219,220,221,222,223,171,198,224,225,226,227,228,153,229,126,230,231,232,233,234],"workflow","workflow builder","builder","design","workflows","code","orchestrate","pipeline","loop","multi-agent","context","across","fresh","scripts","judge","claude code workflow",{"skillNo":236,"name":237,"nameZh":6,"description":238,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":239,"categories":240,"keywords":241,"publishedAt":49},"01M6QR7QMCZESKQA0ERW1E657M","weekly-review","Use when someone wants to run a weekly review, close open loops, audit stalled projects and commitments, get their system back to trusted, restart a lapsed review habit, or says \"\u002Fcs:weekly-review\". Walks David Allen's three-phase loop — GET CLEAR, GET CURRENT, GET CREATIVE — with deterministic scripts that inventory open loops, gate the checklist with named gaps, and score commitment health 0-100.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fweekly-review\u002FSKILL.md",[],[242,243,244,245,246,247,248,249,250,227,251,252,253,254,255,256,128,257,258,210],"review","weekly review","weekly","deterministic scripts","reflect","feeds","inventory","open","team","projects","project-management","scanner","conversation","back","project","sprint","cadence"]