api-ai-llamaindex
LlamaIndex.TS data framework for RAG, indexing, retrieval, query engines, chat engines, and agentic workflows in TypeScript
npx skills add majiayu000/claude-skill-registry --skill api-ai-llamaindex --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Guides building context-aware LLM applications in TypeScript using LlamaIndex.TS. It instructs configuring LLM and embedding models via a Settings singleton, loading documents with SimpleDirectoryReader, splitting with SentenceSplitter, indexing with VectorStoreIndex.fromDocuments(), and querying with index.asQueryEngine(). For agents, it uses agent() with tool() definitions backed by Zod schemas, and supports chat engines, streaming, and multi-step workflows.
How it works
The skill describes a sequence: configure Settings.llm and Settings.embedModel, load documents via SimpleDirectoryReader, create a VectorStoreIndex from those documents, then obtain a query engine via index.asQueryEngine() to run queries. For agents, define tools with tool(...) using a Zod schema for parameters, then instantiate an agent with agent({ tools: [...] }) and run it. For chat, instantiate a ContextChatEngine from a retriever derived from the index and call .chat(...) for multi-turn conversations. It emphasizes all operations are async (Promises), and Persistence should be handled using storageContextFromDefaults({ persistDir }) when creating or loading the index. It also notes you must install provider packages separately (e.g., @llamaindex/openai).
When to use it
- Building Retrieval-Augmented Generation (RAG) applications with custom documents
- Loading, chunking, and indexing documents for LLM consumption
- Creating query engines or chat engines over indexed data
- Implementing agentic RAG with tool-calling agents that query indexes
- Working with multiple data sources and persisting vector indexes across restarts
What it can touch
- Uses Settings.llm and Settings.embedModel for global config
- Uses SimpleDirectoryReader for document loading
- Uses VectorStoreIndex for indexing and persistence
- Exposes asQueryEngine() for querying and ContextChatEngine for chat
- Supports agent tooling via tool(...) and agent()
- Utilizes storageContextFromDefaults({ persistDir }) for persistence
Caveats
- Requires explicit configuration of the LLM provider packages (e.g., @llamaindex/openai) as they are not included in the base llamaindex package
- All core operations are async and must be awaited
- API keys must be supplied via environment variables rather than hardcoding
- Server-side only; Node.js >= 20 required; not intended for client-side/browser usage
# LlamaIndex.TS Patterns > **Quick Guide:** LlamaIndex.TS is a data framework for building context-aware LLM applications in TypeScript. Use `Settings` singleton to configure LLM and embedding models globally. Load documents with `SimpleDirectoryReader`, chunk with `SentenceSplitter`, index with `VectorStoreIndex.fromDocuments()`, and query with `index.asQueryEngine()`. For agents, use `agent()` from `@llamaindex/workflow` with `tool()` definitions using Zod schemas. All core operations are async -- every function returns a Promise. The `llamaindex` package re-exports most things, but LLM providers require separate packages like `@llamaindex/openai` or `@llamaindex/ollama`. --- <critical_requirements> ## CRITICAL: Before Using This Skill > **All code must follow project conventions in CLAUDE.md** (kebab-case, named exports, import ordering, `import type`, named constants) **(You MUST configure `Settings.llm` and `Settings.embedModel` before any indexing or querying -- the Settings singleton is lazily initialized and defaults to OpenAI, which will fail without an API key)** **(You MUST await all LlamaIndex operations -- `fromDocuments()`, `asQueryEngine()`, `query()`, `chat()`, `loa
- CRITICAL: Before Using This Skill
- Examples Index
- Philosophy
- Core Patterns
- Pattern 1: Settings Configuration
- Pattern 2: Document Loading and Indexing
- Pattern 3: Index Persistence
- Pattern 4: Agents with Tool Definitions
- Pattern 5: Chat Engine
- Pattern 6: Streaming Responses
- Pattern 7: Text Splitting and Node Parsing
- Decision Framework
- Which Index Type to Use
- Query Engine vs Chat Engine vs Agent
What does the api-ai-llamaindex skill do?
LlamaIndex.TS data framework for RAG, indexing, retrieval, query engines, chat engines, and agentic workflows in TypeScript
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill api-ai-llamaindex --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
