ai-sdk-preview-rag  by vercel-labs

Next.js RAG template using the Vercel AI SDK

created 1 year ago
305 stars

Top 88.8% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This project provides a Next.js template for Retrieval-Augmented Generation (RAG) using the Vercel AI SDK. It's designed for developers looking to build AI applications that can access and utilize external knowledge bases, enabling more informed and context-aware responses.

How It Works

The template leverages the AI SDK's streamText function for information retrieval via tool calls and real-time response streaming to the frontend using the useChat hook. It integrates DrizzleORM with PostgreSQL for vector embedding storage, allowing efficient management of external data. The UI is animated using Framer Motion for a dynamic user experience.

Quick Start & Requirements

  • Install dependencies: npm install
  • Prerequisites: OpenAI API key, PostgreSQL connection string.
  • Setup: Copy .env.example to .env, add API key and database URL, run npm run db:migrate, then npm run dev.
  • Project runs on http://localhost:3000.

Highlighted Details

  • Real-time streaming of model responses.
  • Vector embedding storage with DrizzleORM and PostgreSQL.
  • Information retrieval and addition via tool calls.
  • Animated UI with Framer Motion.

Maintenance & Community

This is a Vercel Labs project, indicating potential backing and development from Vercel. Further community or maintenance details are not provided in the README.

Licensing & Compatibility

The license is not specified in the provided README. Compatibility for commercial use or closed-source linking is not detailed.

Limitations & Caveats

The project is presented as a preview template, suggesting potential for breaking changes or incomplete features. Specific limitations regarding supported LLMs, vector databases, or deployment targets are not detailed.

Health Check
Last commit

7 months ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
45 stars in the last 90 days

Explore Similar Projects

Starred by Jared Palmer Jared Palmer(Ex-VP of AI at Vercel; Founder of Turborepo; Author of Formik, TSDX).

chatgpt-pgvector by gannonh

0%
938
Domain-specific chat completions app
created 2 years ago
updated 2 years ago
Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems) and Elie Bursztein Elie Bursztein(Cybersecurity Lead at Google DeepMind).

LightRAG by HKUDS

1.0%
19k
RAG framework for fast, simple retrieval-augmented generation
created 10 months ago
updated 23 hours ago
Feedback? Help us improve.