Prerequisites

Before starting, ensure you have the following tools and accounts ready.

Required Software

Node.js 18+

ChatRAG requires Node.js version 18 or higher. Download from nodejs.org

# Check your Node.js version
node --version

# Should output v18.0.0 or higher

npm (comes with Node.js)

npm is the package manager for Node.js and is installed automatically with Node.js.

# Verify npm installation
npm --version

Git

Required for cloning the repository. Download from git-scm.com

# Verify git installation
git --version

Required API Keys

You'll need to sign up for the following services and obtain API keys:

1. Supabase (Free tier available)

Open-source Firebase alternative with PostgreSQL and vector database capabilities.

  • Sign up at supabase.com
  • Create a new project
  • Note down: Project URL, Anon Key, and Service Role Key

2. OpenAI API (Required for embeddings)

Required for document embeddings and AI models.

  • Sign up at platform.openai.com
  • Generate an API key from the API section
  • Add billing information (pay-as-you-go)

3. OpenRouter API (Recommended)

Access 100+ AI models from multiple providers through a unified API.

  • Sign up at openrouter.ai
  • Generate an API key from your dashboard
  • Competitive pricing with various model options

4. LlamaCloud API (Required for document processing)

Required for PDF/DOCX processing and RAG functionality.

Minimum Requirements Summary

To run ChatRAG locally, you need:

  • NEXT_PUBLIC_SUPABASE_URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY
  • SUPABASE_SERVICE_ROLE_KEY (server-only secret)
  • OPENAI_API_KEY (required for embeddings)
  • OPENROUTER_API_KEY or direct OpenAI models
  • NEXT_PUBLIC_LLAMA_CLOUD_API_KEY