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 rag2. Install Dependencies
bash
npm install3. 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_key4. Set Up Convex
Run the Convex setup command. This will prompt you to log in and create a project:
bash
npx convex devFollow the prompts to:
- Log in to your Convex account
- Create a new project or link to an existing one
- The command will start the Convex development server
Development
You'll need two terminals running:
Terminal 1 — Convex Backend:
bash
npx convex devTerminal 2 — Vite Frontend:
bash
npm run devThe 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
