> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/run-llama/LlamaIndexTS/llms.txt
> Use this file to discover all available pages before exploring further.

# Examples Overview

> Explore practical examples to get started with LlamaIndex.TS

Learn by example! This section provides complete, working examples demonstrating key LlamaIndex.TS capabilities.

## Available Examples

<CardGroup cols={2}>
  <Card title="Basic RAG" icon="database" href="/examples/rag-basic">
    Build a simple RAG application with vector indexing and querying
  </Card>

  <Card title="Basic Agent" icon="robot" href="/examples/agent-basic">
    Create an AI agent with tool calling capabilities
  </Card>

  <Card title="Workflow Basics" icon="diagram-project" href="/examples/workflow-basic">
    Build event-driven workflows with state management
  </Card>

  <Card title="Multimodal" icon="images" href="/examples/multimodal">
    Work with images, text, and vision models
  </Card>

  <Card title="Next.js Integration" icon="react" href="/examples/nextjs-integration">
    Integrate LlamaIndex.TS with Next.js applications
  </Card>
</CardGroup>

## Quick Start

All examples can be run directly with `tsx`:

```bash theme={null}
# Set your API key
export OPENAI_API_KEY="sk-..."

# Run any example
npx tsx example.ts
```

## Example Categories

### RAG (Retrieval-Augmented Generation)

Learn how to build applications that combine document retrieval with LLM generation:

* Vector indexing and embeddings
* Query engines and chat engines
* Document processing and chunking
* Metadata extraction and filtering

### Agents

Build intelligent agents that can use tools and reason about tasks:

* Tool calling and function execution
* Multi-agent coordination
* Memory management
* Provider-specific implementations

### Workflows

Create event-driven workflows for complex multi-step processes:

* State management
* Event handling
* Iterative refinement
* Custom workflow patterns

### Multimodal

Work with multiple data modalities:

* Image analysis and understanding
* Vision-language models
* Multimodal RAG
* CLIP embeddings

### Framework Integrations

Integrate with popular frameworks:

* Next.js (Node.js and Edge Runtime)
* Server actions and API routes
* Cloudflare Workers
* Vite and other bundlers

## GitHub Repository

Find all examples in the GitHub repository:

<Card title="LlamaIndex.TS Examples" icon="github" href="https://github.com/run-llama/LlamaIndexTS/tree/main/packages/llamaindex/examples">
  Browse the complete collection of examples on GitHub
</Card>

## Additional Resources

* **[Workflows Repository](https://github.com/run-llama/workflows-ts)** - Advanced workflow examples
* **[Community Examples](https://github.com/run-llama/LlamaIndexTS/tree/main/e2e/examples)** - Real-world integration examples
* **[Documentation](/quickstart)** - Comprehensive guides and API reference

## Environment Setup

Most examples require API keys for LLM providers:

```bash theme={null}
# OpenAI
export OPENAI_API_KEY="sk-..."

# Anthropic
export ANTHROPIC_API_KEY="sk-ant-..."

# Other providers as needed
export GROQ_API_KEY="..."
export MISTRAL_API_KEY="..."
```

## Running Examples

Examples are organized by category in the repository:

```bash theme={null}
# Clone the repository
git clone https://github.com/run-llama/LlamaIndexTS.git
cd LlamaIndexTS/packages/llamaindex/examples

# Run an example
npx tsx rag/starter.ts
npx tsx agents/agent/single-agent.ts
npx tsx multimodal/chat.ts
```

<Note>
  All examples use TypeScript and can be executed directly with `tsx` without compilation.
</Note>
