LlamaIndexTS
CLAUDE.md3.1k starsChanged 2 years agoMITArchived repositoryView on GitHub
This project uses pnpm as the package manager and Turbo for build orchestration: For individual package development: LlamaIndex.TS is a TypeScript data framework for LLM applications organized as a pnpm monorepo with multiple runtime environment support (Node.js, Deno, Bun, Vercel Edge, Cloudflare Workers). Core Packages: Provider Packages (packages/providers/): Specialized Packages: Runtime Abstraction: Core functionality is runtime-agnostic, with environment-specific implementations in separate entry points (index.ts, index.edge.ts, index.workerd.ts). Provider Pattern: LLMs, embeddings, and vector stores implement common interfaces from @llamaindex/core, allowing easy…
We split this CLAUDE.md into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 61
Data Flow: Document → NodeParser → Embedding → VectorStore → Retriever → QueryEngine → Response
- Very specific: line 67
Query Engines: Document querying with retrieval in core/query-engine/
- Very specific: line 70
Ingestion Pipeline: Document processing workflows in llamaindex/ingestion/
- Distinctive: line 90
All packages use bunchee for building with dual CJS/ESM support
- Very specific: line 92
Always run pnpm build before running tests, as tests depend on build artifacts
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Development Commands
This project uses pnpm as the package manager and Turbo for build orchestration:
pnpm install- Install all dependenciespnpm build- Build all packages using Turbopnpm dev- Start development mode for all packagespnpm test- Run all unit testspnpm e2e- Run end-to-end testspnpm lint- Run ESLint across all packagespnpm type-check- Run TypeScript type checking across workspacepnpm format- Check code formatting with Prettierpnpm format:write- Auto-fix formatting issuespnpm circular-check- Check for circular dependencies using madge
For individual package development:
turbo run build --filter="@llamaindex/core"- Build specific packageturbo run test --filter="@llamaindex/core"- Test specific package- Navigate to specific package directory and run
pnpm testfor focused testing pnpm clean- Remove all build artifacts and node_modules across workspace
Architecture Overview
LlamaIndex.TS is a TypeScript data framework for LLM applications organized as a pnpm monorepo with multiple runtime environment support (Node.js, Deno, Bun, Vercel Edge, Cloudflare Workers).
Package Structure
Core Packages:
packages/core/- Abstract base classes and interfaces for all runtime environmentspackages/llamaindex/- Main package that aggregates core functionalitypackages/env/- Environment-specific compatibility layers for different JS runtimes
Provider Packages (packages/providers/):
- LLM providers:
openai/,anthropic/,ollama/,google/,groq/, etc. - Vector stores:
storage/pinecone/,storage/chroma/,storage/qdrant/, etc. - Embeddings: Various embedding providers integrated within LLM packages
- Readers:
assemblyai/,discord/,notion/for data ingestion
Specialized Packages:
packages/cloud/- LlamaCloud integration for managed servicespackages/tools/- Function calling tools and utilitiespackages/workflow/- Agent workflow orchestrationpackages/readers/- File format readers (PDF, DOCX, etc.)
Key Architectural Patterns
Runtime Abstraction: Core functionality is runtime-agnostic, with environment-specific implementations in separate entry points (index.ts, index.edge.ts, index.workerd.ts).
Provider Pattern: LLMs, embeddings, and vector stores implement common interfaces from @llamaindex/core, allowing easy swapping between providers.
Modular Design: Each provider is a separate package to minimize bundle size - users install only what they need.
Data Flow: Document → NodeParser → Embedding → VectorStore → Retriever → QueryEngine → Response
Core Components
- Agents and Workflows: Abstractions for building agentic workflows and agents in
packages/workflow - Chat Engines: Conversational interfaces in
core/chat-engine/ - Query Engines: Document querying with retrieval in
core/query-engine/ - Indices: VectorStoreIndex, SummaryIndex, KeywordTable in
llamaindex/indices/ - Node Parsers: Text splitting and chunking in
core/node-parser/ - Ingestion Pipeline: Document processing workflows in
llamaindex/ingestion/ - Storage: Chat stores, document stores, index stores, and KV stores in
core/storage/
Deprecated Components
- Agents: ReAct and function calling agents in
core/agent/andllamaindex/agent/
Testing Structure
- Unit tests in each package's
tests/directory - E2E tests in
e2e/directory with runtime-specific examples - Tests depend on build artifacts, so always run
pnpm buildbefore testing
Multi-Runtime Support
The codebase supports multiple JavaScript runtimes through conditional exports and separate entry points. When making changes, consider compatibility across Node.js, Deno, Bun, and edge runtimes.
Development Notes
- The project uses Husky for git hooks with lint-staged for pre-commit formatting and linting
- All packages use bunchee for building with dual CJS/ESM support
- Core package exports are organized as sub-modules (e.g.,
@llamaindex/core/llms,@llamaindex/core/embeddings) - Always run
pnpm buildbefore running tests, as tests depend on build artifacts
In this repository3 other files it gives its agents.
- docs/CLAUDE.mdCLAUDE.md
- e2e/CLAUDE.mdCLAUDE.md
- examples/CLAUDE.mdCLAUDE.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

