llamaindex

llamaindex is a skill for Claude Code, Codex from znlgis/opengis-skills. It costs 107 tokens per session (5,233 once invoked), scanned A, original, MIT.

A Python framework for connecting large language models to private documents. It loads and splits files, builds searchable indexes, and provides question-answering, chat, routing, and tool-using agent workflows.

In plain words
What is it for?
Use it to load PDFs, Markdown, Word files, or web pages; split them into sections; store searchable vectors; and build document question-answering, chat, or agent applications.
Why use it?
It removes much of the custom work needed to turn documents into useful search and chat features. Retrieval-augmented generation (RAG) means finding relevant document sections before asking the model to answer.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to load PDFs, Markdown, Word files, or web pages; split them into sections; store searchable vectors; and build document question-answering, chat, or agent applications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/znlgis/opengis-skills/llamaindex
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add znlgis/opengis-skills --skill llamaindex
Clone the repo
git clone --depth 1 https://github.com/znlgis/opengis-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for llamaindex

README.md
[![agentmods](https://agentmods.dev/badge/skills/znlgis/opengis-skills/llamaindex/github.svg)](https://agentmods.dev/skills/znlgis/opengis-skills/llamaindex)
Your own site
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/llamaindex"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/llamaindex/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for llamaindex

Your own site · 80×15
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/llamaindex"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/llamaindex.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,233 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00107 $0.05233
Opus 5.5 $0.00043 $0.02093
Sonnet 5.5 $0.00021 $0.01047
Haiku 4.5 $0.00011 $0.00523

Measured today against content hash 1f393e07a936, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

llamaindex scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

resp = requests.get(
ai/llamaindex/SKILL.md · 451 lines

How it starts

The opening of the file, as written. The whole thing — 451 lines — stays where its author put it; the contents beside it link to each section on GitHub.

项目地址: https://github.com/run-llama/llama_index

官方文档: https://docs.llamaindex.ai/(2026 年起 301 重定向至 https://developers.llamaindex.ai/python/framework/)

许可证: MIT 最新版本: llama-index 0.14.25、llama-index-core 0.14.25(PyPI,2026-10;GitHub 最新 Release 标签为 v0.14.25,包按组件独立发版)

概述

LlamaIndex 是连接大语言模型与私有数据的 Python 框架,核心流程是把文档切分为节点(Node)、建立索引并对外暴露查询与对话接口。

  • 数据加载:SimpleDirectoryReader 等 Reader 把 PDF / Markdown / Word / 网页等解析为 Document
  • 切分:SentenceSplitter、TokenTextSplitter 等 Node Parser 把 Document 切成带元数据的 Node
  • 索引:VectorStoreIndex 建立向量索引,另有 SummaryIndex、KeywordTableIndex 等
  • 存储:StorageContext 统一挂载向量库、文档库、索引库,可持久化到磁盘或外部数据库
  • 检索与合成:Retriever 召回节点,Response Synthesizer 按响应模式(response_mode)合成答案
  • 上层接口:Query Engine(单轮)、Chat Engine(多轮)、Router(多路选择)、Workflows(事件驱动)、Agent(工具调用)

包拆分(2026-10,pip install llama-index 元包仅拉取以下四项):

包 内容 当前版本
llama-index 元包:core + OpenAI LLM/嵌入集成 + nltk 0.14.25
llama-index-core 索引、检索、Workflows、Agent 等核心 0.14.25
llama-index-llms-openai OpenAI / Azure LLM 集成 0.7.x
llama-index-embeddings-openai OpenAI 嵌入集成 0.6.x

其余向量库、嵌入、LLM 集成均为独立包,按需安装。


环境准备

安装

# 元包:含 core 与 OpenAI 集成,开箱即用(要求 Python >= 3.10)
pip install llama-index

pip install llama-index-core

# 常用集成(按需)
pip install llama-index-embeddings-huggingface      # 本地嵌入模型
pip install llama-index-llms-ollama                 # 本地 LLM
pip install llama-index-vector-stores-chroma        # Chroma
pip install llama-index-vector-stores-postgres      # PostgreSQL / pgvector
pip install llama-index-vector-stores-qdrant        # Qdrant

API Key 配置

export OPENAI_API_KEY="sk-..."        # Linux / macOS
set OPENAI_API_KEY=sk-...             # Windows cmd

在代码中加载 .env(需 pip install python-dotenv):

from dotenv import load_dotenv

load_dotenv()

验证安装

python -c "import llama_index.core; print(llama_index.core.__version__)"

Read the full file on GitHub · 451 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 451 lines · 107 tokens per session scan A 1f393e07a936

Subscribe to this mod's changes

llamaindex is a skill published in the GitHub repository znlgis/opengis-skills (64 stars, last pushed yesterday), licensed MIT. It adds 107 tokens to every session and 5,233 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-16.