Skip to content
Avatar of vercel-labsvercel-labs/ai-sdk-preview-rag

RAG with Vercel AI SDK

A retrieval-augmented generation chatbot built with Next.js, the Vercel AI SDK, Drizzle ORM, and PostgreSQL.

Framework
Use Case
rag-template-og-image

AI SDK RAG Template

A Next.js application, powered by the Vercel AI SDK, that uses retrieval-augmented generation (RAG) to reason and respond with information outside of the model's training data.

Features

Getting Started

To get the project up and running, follow these steps:

  1. Install dependencies:

    npm install
  2. Copy the example environment file:

    cp .env.example .env
  3. Add your OpenAI API key and PostgreSQL connection string to the .env file:

    OPENAI_API_KEY=your_api_key_here
    DATABASE_URL=your_postgres_connection_string_here
  4. Migrate the database schema:

    npm run db:migrate
  5. Start the development server:

    npm run dev

Your project should now be running on http://localhost:3000.

rag-template-og-image
Avatar of vercel-labsvercel-labs/ai-sdk-preview-rag

RAG with Vercel AI SDK

A retrieval-augmented generation chatbot built with Next.js, the Vercel AI SDK, Drizzle ORM, and PostgreSQL.

Framework
Use Case

AI SDK RAG Template

A Next.js application, powered by the Vercel AI SDK, that uses retrieval-augmented generation (RAG) to reason and respond with information outside of the model's training data.

Features

Getting Started

To get the project up and running, follow these steps:

  1. Install dependencies:

    npm install
  2. Copy the example environment file:

    cp .env.example .env
  3. Add your OpenAI API key and PostgreSQL connection string to the .env file:

    OPENAI_API_KEY=your_api_key_here
    DATABASE_URL=your_postgres_connection_string_here
  4. Migrate the database schema:

    npm run db:migrate
  5. Start the development server:

    npm run dev

Your project should now be running on http://localhost:3000.

Unleash New Possibilities

Deploy your app on Vercel and unlock its full potential