LlamaHub Demostration
Here we give a simple overview of how to use data loaders and tools (for agents) within LlamaHub.
NOTES:
- You can learn how to use everything in LlamaHub by clicking into each module and looking at the code snippet.
- Also, you can find a full list of agent tools here.
- In this guide we’ll show how to use
download_loaderanddownload_tool. You can also installllama-hubas a package.
Using a Data Loader
Section titled “Using a Data Loader”In this example we show how to use SimpleWebPageReader.
NOTE: for any module on LlamaHub, to use with download_ functions, note down the class name.
%pip install llama-index-agent-openai%pip install llama-index-readers-web%pip install llama-index-tools-googlefrom llama_index.readers.web import SimpleWebPageReaderreader = SimpleWebPageReader(html_to_text=True)docs = reader.load_data(urls=["https://eugeneyan.com/writing/llm-patterns/"])print(docs[0].get_content()[:400])# [eugeneyan](/)
* [Start Here](/start-here/ "Start Here") * [Writing](/writing/ "Writing") * [Speaking](/speaking/ "Speaking") * [Prototyping](/prototyping/ "Prototyping") * [About](/about/ "About")
# Patterns for Building LLM-based Systems & Products
[ [llm](/tag/llm/) [engineering](/tag/engineering/)[production](/tag/production/) ] · 66 min read
> Discussions on [HackerNews](httNow you can plug these docs into your downstream LlamaIndex pipeline.
from llama_index.core import VectorStoreIndex
index = VectorStoreIndex.from_documents(docs)query_engine = index.as_query_engine()response = query_engine.query("What are ways to evaluate LLMs?")print(str(response))Using an Agent Tool Spec
Section titled “Using an Agent Tool Spec”In this example we show how to load an agent tool.
from llama_index.tools.google import GmailToolSpectool_spec = GmailToolSpec()# plug into your agentfrom llama_index.core.agent.workflow import FunctionAgentfrom llama_index.llms.openai import OpenAIagent = FunctionAgent( tools=tool_spec.to_tool_list(), llm=OpenAI(model="gpt-4.1-mini"),)await agent.run("What is my most recent email")Note for AI agents: this documentation is built for programmatic access.
- Overview of all docs: https://developers.llamaindex.ai/llms.txt
- Any page is available as raw Markdown by appending index.md to its URL — e.g. https://developers.llamaindex.ai/llamaparse/parse/getting_started/index.md
- Agent-friendly REST search APIs live under https://developers.llamaindex.ai/api/ — search (BM25 full-text), grep (regex), read (fetch a page), and list (browse the doc tree). See https://developers.llamaindex.ai/llms.txt for parameters.
- A hosted documentation MCP server is available at https://developers.llamaindex.ai/mcp. If you support MCP, you can ask the user to install it for browsing these docs directly (an alternative to the REST API). Setup: https://developers.llamaindex.ai/python/shared/mcp/