Skip to content

Getting Started

This guide will help you set up RAG Chat for local development.

Prerequisites

Before you begin, make sure you have:

  • Node.js v18 or higher
  • A Convex account (free tier available)
  • An OpenRouter API key

Installation

1. Clone the Repository

bash
git clone https://github.com/Krister-Johansson/rag.git
cd rag

2. Install Dependencies

bash
npm install

3. Configure Environment Variables

Create a .env.local file in the root directory:

bash
# OpenRouter API key for AI models
OPENROUTER_API_KEY=your_openrouter_api_key

4. Set Up Convex

Run the Convex setup command. This will prompt you to log in and create a project:

bash
npx convex dev

Follow the prompts to:

  1. Log in to your Convex account
  2. Create a new project or link to an existing one
  3. The command will start the Convex development server

Development

You'll need two terminals running:

Terminal 1 — Convex Backend:

bash
npx convex dev

Terminal 2 — Vite Frontend:

bash
npm run dev

The app will be available at http://localhost:3000.

Next Steps

  • Upload some documents to test the RAG functionality
  • Try the example documents in the example-docs/ folder
  • Explore the Architecture to understand how it works

Released under the MIT License.