Skip to main content
Thank you for your interest in contributing to LlamaIndex.TS! We welcome contributions from everyone, whether you’re fixing a bug, adding a feature, or improving documentation.

Getting Started

Prerequisites

Before you begin, make sure you have:
  • Node.js LTS (Long-term Support) installed
  • pnpm package manager
  • Git for version control
  • Basic understanding of TypeScript and Node.js
Check your versions:

Install pnpm

If you don’t have pnpm installed:

Fork and Clone

  1. Fork the repository on GitHub
  2. Clone your fork:
  1. Add upstream remote:

Project Structure

LlamaIndex.TS uses a pnpm monorepo structure:

Key Directories

  • packages/llamaindex: The main package that aggregates core functionality
  • packages/core: Abstract base classes and interfaces for runtime-agnostic code
  • packages/env: Runtime compatibility layers for different JS environments
  • packages/providers/*: Separate packages for LLMs, embeddings, vector stores, etc.

Development Setup

1. Install Dependencies

2. Build Packages

This builds all packages using Turbo for efficient parallel builds.

3. Start Development Mode

This runs all packages in watch mode, automatically rebuilding on changes. To watch specific packages:

Making Changes

1. Create a Branch

2. Make Your Changes

Edit the relevant files in the appropriate package. Quick testing: Create a test script to verify your changes:
Run it with:

3. Add Tests

All new features and bug fixes should include tests. Unit tests are located in each package’s tests/ folder:
Run tests:
Run tests for a specific package:

4. Run Linting

Auto-fix issues:

5. Type Check

Adding a New Package

When to Create a New Package

  • Adding a new LLM provider (e.g., @llamaindex/mistral)
  • Adding a new vector store (e.g., @llamaindex/storage/milvus)
  • Adding a new reader or tool

Steps

  1. Create the package in packages/providers/:
  1. Use existing package.json as a template:
  1. Reference in root tsconfig.json:
  1. Add to examples if applicable:

Submitting a Pull Request

Before Submitting

  1. All tests pass:
  1. Create a changeset for version bumping:
You’ll be prompted to:
  • Select which packages changed
  • Choose bump type (major, minor, patch)
  • Write a description of the changes

Submit Your PR

  1. Push your branch:
  1. Open a Pull Request on GitHub with:
    • Clear title describing the change
    • Description of what changed and why
    • Reference any related issues
    • Screenshots/examples if applicable
  2. Address review feedback:
    • Make requested changes
    • Push additional commits
    • Re-request review when ready

PR Checklist

  • Tests added/updated and passing
  • Documentation updated (if needed)
  • Examples added/updated (for new features)
  • Changeset created
  • Code follows existing style
  • No breaking changes (or clearly documented)

Documentation

If your changes affect user-facing APIs:
  1. Update the docs in apps/next/ folder
  2. Add examples in the examples/ folder
  3. Update README if adding a new package

Code Style

Formatting

We use Prettier for formatting. It runs automatically on commit via Husky. Manual formatting:

Linting

We use ESLint. Configuration is in eslint.config.js.

TypeScript

  • Use strict mode
  • Prefer interfaces over types for public APIs
  • Add JSDoc comments for public APIs
  • Use async/await instead of promises
Example:

Testing

Unit Tests

Use Vitest for unit tests:

E2E Tests

End-to-end tests are in the e2e/ folder and test runtime compatibility:

Running Tests

Common Tasks

Check for Circular Dependencies

Clean Build Artifacts

Update Dependencies

Release Process (Maintainers)

We use Changesets for versioning and releases:
  1. PRs are merged with changesets
  2. Release PR is auto-generated
  3. Merging release PR publishes to npm
Manual release (maintainers only):

Getting Help

If you need help contributing:

Code of Conduct

Please be respectful and inclusive. We’re building a welcoming community for everyone.

Thank You!

Your contributions make LlamaIndex.TS better for everyone. We appreciate your time and effort!

Community

Join our community to connect with other contributors