
Llamaindex
Spin up LlamaIndex FunctionAgent workflows that combine tools, RAG query engines, and multi-document knowledge bases in Python.
Install
npx skills add https://github.com/orchestra-research/ai-research-skills --skill llamaindexWhat is this skill?
- Basic FunctionAgent with OpenAI LLM and Python tool functions
- RAG agent pattern: VectorStoreIndex + QueryEngineTool alongside calculators
- Multi-document agent routing across named knowledge bases (e.g. python_docs vs numpy_docs)
- Verbose agent chat loop for debugging tool selection
- Composable query engines as first-class agent tools
Adoption & trust: 1 installs on skills.sh; 9.4k GitHub stars; 2/3 security scanners passed (skills.sh audits).
Recommended Skills
Microsoft Foundrymicrosoft/azure-skills
Azure Aimicrosoft/azure-skills
Azure Hosted Copilot Sdkmicrosoft/azure-skills
Lark Eventlarksuite/cli
Running Claude Code Via Litellm Copilotxixu-me/skills
Setup Matt Pocock Skillsmattpocock/skills
Journey fit
Common Questions / FAQ
Is Llamaindex safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Llamaindex
# LlamaIndex Agents Guide Building agents with tools and RAG capabilities. ## Basic agent ```python from llama_index.core.agent import FunctionAgent from llama_index.llms.openai import OpenAI def multiply(a: int, b: int) -> int: """Multiply two numbers.""" return a * b llm = OpenAI(model="gpt-4o") agent = FunctionAgent.from_tools( tools=[multiply], llm=llm, verbose=True ) response = agent.chat("What is 25 * 17?") ``` ## RAG agent ```python from llama_index.core.tools import QueryEngineTool # Create query engine as tool index = VectorStoreIndex.from_documents(documents) query_tool = QueryEngineTool.from_defaults( query_engine=index.as_query_engine(), name="python_docs", description="Useful for Python programming questions" ) # Agent with RAG + calculator agent = FunctionAgent.from_tools( tools=[query_tool, multiply], llm=llm ) response = agent.chat("According to the docs, what is Python?") ``` ## Multi-document agent ```python # Multiple knowledge bases python_tool = QueryEngineTool.from_defaults( query_engine=python_index.as_query_engine(), name="python_docs", description="Python programming documentation" ) numpy_tool = QueryEngineTool.from_defaults( query_engine=numpy_index.as_query_engine(), name="numpy_docs", description="NumPy array documentation" ) agent = FunctionAgent.from_tools( tools=[python_tool, numpy_tool], llm=llm ) # Agent chooses correct knowledge base response = agent.chat("How do I create numpy arrays?") ``` ## Best practices 1. **Clear tool descriptions** - Agent needs to know when to use each tool 2. **Limit tools to 5-10** - Too many confuses agent 3. **Use verbose mode during dev** - See agent reasoning 4. **Combine RAG + calculation** - Powerful combination 5. **Test tool combinations** - Ensure they work together ## Resources - **Agents Docs**: https://developers.llamaindex.ai/python/framework/modules/agents/ # LlamaIndex Data Connectors Guide 300+ data connectors via LlamaHub. ## Built-in loaders ### SimpleDirectoryReader ```python from llama_index.core import SimpleDirectoryReader # Load all files documents = SimpleDirectoryReader("./data").load_data() # Filter by extension documents = SimpleDirectoryReader( "./data", required_exts=[".pdf", ".docx", ".txt"] ).load_data() # Recursive documents = SimpleDirectoryReader("./data", recursive=True).load_data() ``` ### Web pages ```python from llama_index.readers.web import SimpleWebPageReader, BeautifulSoupWebReader # Simple loader reader = SimpleWebPageReader() documents = reader.load_data(["https://example.com"]) # Advanced (BeautifulSoup) reader = BeautifulSoupWebReader() documents = reader.load_data(urls=[ "https://docs.python.org", "https://numpy.org" ]) ``` ### PDF ```python from llama_index.readers.file import PDFReader reader = PDFReader() documents = reader.load_data("paper.pdf") ``` ### GitHub ```python from llama_index.readers.github import GithubRepositoryReader reader = GithubRepositoryReader( owner="facebook", repo="react", filter_file_extensions=[".js", ".jsx"], verbose=True ) documents = reader.load_data(branch="main") ``` ## LlamaHub connectors Visit https://llamahub.ai for 300+ connectors: - Notion, Google Docs, Confluence - Slack, Discord, Twitter - PostgreSQL, MongoDB, MySQL - S3, GCS, Azure Blob - Stripe, Shopify, Salesforce ### Install from LlamaHub ```bash pip install llama-index-readers-notion ``` ```python from llama_index.readers.notion import NotionPageReader reader = NotionPageReader(integration_token="your-token") documents = reader.load_data(page_ids=["page-id"]) ``` ## Custom loader ```python from llama_index.core.readers.base import BaseReader from llama_index.core import Document class CustomReader(BaseReader): def load_data(self, file_path: str): # Your custom loading logic with open(file_path) as f: text = f.read() return [Document(t