Skip to main content
Find answers to common questions about LlamaIndex.TS.

General Questions

LlamaIndex.TS is a TypeScript/JavaScript data framework for building LLM applications. It helps you:
  • Load and process data from various sources
  • Create vector embeddings and indices
  • Build RAG (Retrieval Augmented Generation) applications
  • Integrate with multiple LLM providers
  • Create chat engines and query engines
  • Build agentic workflows
It’s the TypeScript port of LlamaIndex Python, designed to work across multiple JavaScript runtimes including Node.js, Deno, Bun, and edge environments.
Both frameworks share the same core concepts but have some differences:Similarities:
  • Same core abstractions (indices, query engines, chat engines)
  • Similar API design and patterns
  • Support for the same LLM providers
  • RAG and agent capabilities
Differences:
  • Language: TypeScript vs Python
  • Package structure: Modular npm packages vs Python namespace packages
  • Runtime support: Multi-runtime JS vs Python only
  • Feature parity: Python has more features currently
See the Migration from Python guide for detailed comparisons.
No! LlamaIndex.TS is a standalone TypeScript/JavaScript library. While the concepts are similar to the Python version, you don’t need any Python knowledge to use it.If you’re coming from Python, check out the Migration from Python guide.
LlamaIndex.TS supports multiple JavaScript runtimes:Fully Supported:
  • Node.js >= 18.0.0 ✅
  • Deno ✅
  • Bun ✅
  • Nitro ✅
Supported with Limitations:
  • Vercel Edge Runtime ✅ (limited file system access)
  • Cloudflare Workers ✅ (limited file system access)
Not Supported:
  • Browser ❌ (due to lack of AsyncLocalStorage-like APIs)
The framework uses conditional exports to provide runtime-specific entry points.
Browser support is currently limited due to the lack of support for AsyncLocalStorage-like APIs in browsers. However, work is ongoing to improve browser compatibility.For now, we recommend using LlamaIndex.TS on the server-side (Node.js, edge runtimes) and calling it from your browser via API routes.

Installation & Setup

Install the core package:
You’ll also need provider packages:
See the Getting Started guide for details.
Only if you want to use OpenAI models. LlamaIndex.TS supports many LLM providers:
  • OpenAI (GPT-4, GPT-3.5)
  • Anthropic (Claude)
  • Google (Gemini)
  • Ollama (Local models)
  • Groq, Mistral, Together AI, and more
You can also use local models with Ollama:
Required:
  • Node.js >= 18.0.0 (or another supported runtime)
  • npm, pnpm, or yarn
Recommended:
  • TypeScript for type safety
  • An LLM provider API key (OpenAI, Anthropic, etc.) or local Ollama setup
Yes! LlamaIndex.TS works with all modern JavaScript frameworks:
  • Next.js (App Router and Pages Router)
  • Remix
  • SvelteKit
  • Nuxt
  • Astro
  • Express
  • And more!
For Next.js, use the withLlamaIndex helper:

Usage Questions

LlamaIndex.TS provides several ways to load data:1. SimpleDirectoryReader (for files):
2. Specialized readers:
3. Manual document creation:
Create an index and query it:
Use a chat engine:
Chat engines maintain conversation history automatically.
Configure Settings.llm:
Install the vector store provider and use it:
Supported vector stores:
  • Pinecone, Qdrant, Chroma, Weaviate
  • MongoDB, PostgreSQL (pgvector)
  • Supabase, Milvus, Astra
  • And more!
Set stream: true in your query:

Troubleshooting

This usually happens due to:
  1. Missing installation:
  1. TypeScript configuration:
  1. Build issues:
See the Troubleshooting guide for more.
Solutions:
  1. Add retry logic:
  1. Use a smaller model:
  1. Process in batches:
Options:
  1. Use batch embedding:
  1. Use a faster model:
  1. Cache embeddings in a vector store.
Enable debug mode:
This shows detailed logs about:
  • API calls
  • Document processing
  • Embedding generation
  • Query execution

Advanced Topics

Yes! Extend the base BaseEmbedding class:
Use the @llamaindex/workflow package:
Yes! Define tools and use them with agents:
Strategies:
  1. Chunk documents:
  1. Process in batches:
  1. Increase Node.js memory:

Cost & Performance

LlamaIndex.TS itself is free and open-source. Costs come from:LLM API calls:
  • OpenAI: ~$0.03 per 1K tokens (GPT-4)
  • Anthropic: ~$0.015 per 1K tokens (Claude)
  • Or use free local models with Ollama
Embedding API calls:
  • OpenAI: ~$0.0001 per 1K tokens
Vector database:
  • Varies by provider (some have free tiers)
Cost optimization tips:
  • Use smaller models (gpt-3.5-turbo vs gpt-4)
  • Reduce chunk size
  • Cache embeddings
  • Use local models
Yes! Use Ollama for completely free, local inference:

Contributing & Community

We welcome contributions! You can:
  • Fix bugs or add features
  • Improve documentation
  • Add examples
  • Help others in Discord
  • Report issues
See the Contributing Guide for details.
Community support:See the Community page for more.

Still Have Questions?

Discord

Join our Discord community

GitHub Discussions

Ask on GitHub Discussions

Documentation

Browse the full documentation

Examples

Check out code examples