[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AY8F3D9SA117N2VNPNTPZE":3,"skill-same:01M7AY8F3D9SA117N2VNPNTPZE":58},{"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":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7AY8F3D9SA117N2VNPNTPZE","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.","SiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot","SiddhamShah972","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F98964854?v=4","01M7AWVFA8QBCFE7PRDT5XBB2E","Siddham Shah","01M7AWVFB82AN6H6BNQSWEF402",0,"MIT","https:\u002F\u002Fgithub.com\u002FSiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fllamaindex\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\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\"\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- **45,100+ GitHub stars**\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\n### Basic agent\n\n```python\nfrom llama_index.core.agent import FunctionAgent\nfrom llama_index.llms.openai import OpenAI\n\n# Define tools\ndef multiply(a: int, b: int) -> int:\n    \"\"\"Multiply two numbers.\"\"\"\n    return a * b\n\ndef add(a: int, b: int) -> int:\n    \"\"\"Add two numbers.\"\"\"\n    return a + b\n\n# Create agent\nllm = OpenAI(model=\"gpt-4o\")\nagent = FunctionAgent.from_tools(\n    tools=[multiply, add],\n    llm=llm,\n    verbose=True\n)\n\n# Use agent\nresponse = agent.chat(\"What is 25 * 17 + 142?\")\nprint(response)\n```\n\n### RAG agent (document search + tools)\n\n```python\nfrom llama_index.core.tools import QueryEngineTool\n\n# Create index as before\nindex = VectorStoreIndex.from_documents(documents)\n\n# Wrap query engine as tool\nquery_tool = QueryEngineTool.from_defaults(\n    query_engine=index.as_query_engine(),\n    name=\"python_docs\",\n    description=\"Useful for answering questions about Python programming\"\n)\n\n# Agent with document search + calculator\nagent = FunctionAgent.from_tools(\n    tools=[query_tool, multiply, add],\n    llm=llm\n)\n\n# Agent decides when to search docs vs calculate\nresponse = agent.chat(\"According to the docs, what is Python used for?\")\n```\n\n## Advanced RAG patterns\n\n### Chat engine (conversational)\n\n```python\nfrom llama_index.core.chat_engine import CondensePlusContextChatEngine\n\n# Chat with memory\nchat_engine = index.as_chat_engine(\n    chat_mode=\"condense_plus_context\",  # Or \"context\", \"react\"\n    verbose=True\n)\n\n# Multi-turn conversation\nresponse1 = chat_engine.chat(\"What is Python?\")\nresponse2 = chat_engine.chat(\"Can you give examples?\")  # Remembers context\nresponse3 = chat_engine.chat(\"What about web frameworks?\")\n```\n\n### Metadata filtering\n\n```python\nfrom llama_index.core.vector_stores import MetadataFilters, ExactMatchFilter\n\n# Filter by metadata\nfilters = MetadataFilters(\n    filters=[\n        ExactMatchFilter(key=\"category\", value=\"tutorial\"),\n        ExactMatchFilter(key=\"difficulty\", value=\"beginner\")\n    ]\n)\n\nretriever = index.as_retriever(\n    similarity_top_k=3,\n    filters=filters\n)\n\nquery_engine = index.as_query_engine(filters=filters)\n```\n\n### Structured output\n\n```python\nfrom pydantic import BaseModel\nfrom llama_index.core.output_parsers import PydanticOutputParser\n\nclass Summary(BaseModel):\n    title: str\n    main_points: list[str]\n    conclusion: str\n\n# Get structured response\noutput_parser = PydanticOutputParser(output_cls=Summary)\nquery_engine = index.as_query_engine(output_parser=output_parser)\n\nresponse = query_engine.query(\"Summarize the document\")\nsummary = response  # Pydantic model\nprint(summary.title, summary.main_points)\n```\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\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- **45,100+ GitHub stars**\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\n### Basic agent\n\n```python\nfrom llama_index.core.agent import FunctionAgent\nfrom llama_index.llms.openai import OpenAI\n\n# Define tools\ndef multiply(a: int, b: int) -> int:\n    \"\"\"Multiply two numbers.\"\"\"\n    return a * b\n\ndef add(a: int, b: int) -> int:\n    \"\"\"Add two numbers.\"\"\"\n    return a + b\n\n# Create agent\nllm = OpenAI(model=\"gpt-4o\")\nagent = FunctionAgent.from_tools(\n    tools=[multiply, add],\n    llm=llm,\n    verbose=True\n)\n\n# Use agent\nresponse = agent.chat(\"What is 25 * 17 + 142?\")\nprint(response)\n```\n\n### RAG agent (document search + tools)\n\n```python\nfrom llama_index.core.tools import QueryEngineTool\n\n# Create index as before\nindex = VectorStoreIndex.from_documents(documents)\n\n# Wrap query engine as tool\nquery_tool = QueryEngineTool.from_defaults(\n    query_engine=index.as_query_engine(),\n    name=\"python_docs\",\n    description=\"Useful for answering questions about Python programming\"\n)\n\n# Agent with document search + calculator\nagent = FunctionAgent.from_tools(\n    tools=[query_tool, multiply, add],\n    llm=llm\n)\n\n# Agent decides when to search docs vs calculate\nresponse = agent.chat(\"According to the docs, what is Python used for?\")\n```\n\n## Advanced RAG patterns\n\n### Chat engine (conversational)\n\n```python\nfrom llama_index.core.chat_engine import CondensePlusContextChatEngine\n\n# Chat with memory\nchat_engine = index.as_chat_engine(\n    chat_mode=\"condense_plus_context\",  # Or \"context\", \"react\"\n    verbose=True\n)\n\n# Multi-turn conversation\nresponse1 = chat_engine.chat(\"What is Python?\")\nresponse2 = chat_engine.chat(\"Can you give examples?\")  # Remembers context\nresponse3 = chat_engine.chat(\"What about web frameworks?\")\n```\n\n### Metadata filtering\n\n```python\nfrom llama_index.core.vector_stores import MetadataFilters, ExactMatchFilter\n\n# Filter by metadata\nfilters = MetadataFilters(\n    filters=[\n        ExactMatchFilter(key=\"category\", value=\"tutorial\"),\n        ExactMatchFilter(key=\"difficulty\", value=\"beginner\")\n    ]\n)\n\nretriever = index.as_retriever(\n    similarity_top_k=3,\n    filters=filters\n)\n\nquery_engine = index.as_query_engine(filters=filters)\n```\n\n### Structured output\n\n```python\nfrom pydantic import BaseModel\nfrom llama_index.core.output_parsers import PydanticOutputParser\n\nclass Summary(BaseModel):\n    title: str\n    main_points: list[str]\n    conclusion: str\n\n# Get structured response\noutput_parser = PydanticOutputParser(output_cls=Summary)\nquery_engine = index.as_query_engine(output_parser=output_parser)\n\nresponse = query_engine.query(\"Summarize the document\")\nsummary = response  # Pydantic model\nprint(summary.title, summary.main_points)\n```\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\n",{"license":15,"description":7},"main","35cc2c5cb1f57477268c9f68a3a64363e68de836","agent\u002Fskills\u002Fllamaindex","https:\u002F\u002Fgithub.com\u002FSiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot","https:\u002F\u002Fgithub.com\u002FSiddhamShah972","2026-08-20 23:29:35",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add SiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot --skill llamaindex",{"tool":36,"command":37},"bunx","bunx skills add SiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot --skill llamaindex",{"tool":39,"command":40},"pnpm","pnpm dlx skills add SiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot --skill llamaindex","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fllamaindex\u002FSKILL.md",true,[44,50,54],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"references\u002Fagents.md","REFERENCE","参考文档",1958,"https:\u002F\u002Fgithub.com\u002FSiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fllamaindex\u002Freferences\u002Fagents.md",{"path":51,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":52,"sourceHtmlUrl":53},"references\u002Fdata_connectors.md",2307,"https:\u002F\u002Fgithub.com\u002FSiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fllamaindex\u002Freferences\u002Fdata_connectors.md",{"path":55,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fquery_engines.md",9905,"https:\u002F\u002Fgithub.com\u002FSiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fllamaindex\u002Freferences\u002Fquery_engines.md",[59,67,74,81,90,98],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":63,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7AZQ1V61JHXWJ370V37AC6D","workorai","WorkorAI talent marketplace skill: candidate job search and employer hiring with white-box match explanations via the WorkorAI MCP server (https:\u002F\u002Fworkorai.com\u002Fmcp). Use when the user asks to find a job, apply to jobs, respond to employer invitations, or when an employer wants to post jobs, search and evaluate candidates, invite them, and review applicants.","https:\u002F\u002Fgithub.com\u002FSiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fworkorai\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fworkorai\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7AZP93C6FJ9EXT7QXFQ8HA6","whisper","OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.","https:\u002F\u002Fgithub.com\u002FSiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fwhisper\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7AZP4RVG6DEBAS7TPJTRP55","weights-and-biases","Track ML experiments with automatic logging, visualize training in real-time, optimize hyperparameters with sweeps, and manage model registry with W&B - collaborative MLOps platform","https:\u002F\u002Fgithub.com\u002FSiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fweights-and-biases\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":85,"licenseFileUrl":86,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7AZNYG21QDFHN1CSGRJ9XJM","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FSiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":85,"licenseFileUrl":94,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M7AZNCEWCKPENGX0ZT274M4Q","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002FSiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fweb-artifacts-builder\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},"01M7AZMQVK156KR60STTBGQGAK","vitest","Set up Vitest testing in any project — detects type (Cloudflare Workers, React, Node, library), generates vitest.config.ts, test setup, utilities, and a sample test. Covers mocking patterns, coverage config, workspace setup, Jest migration. Use whenever the user mentions adding tests, setting up Vitest, configuring tests, migrating from Jest, fixing testing infrastructure, or asks 'how do I test this'.","https:\u002F\u002Fgithub.com\u002FSiddhamShah972\u002FAgentic-Forecasting-Insight-Copilot\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fvitest\u002FSKILL.md",[],[]]