
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.
streamText functionuseChat hookTo get the project up and running, follow these steps:
Install dependencies:
npm installCopy the example environment file:
cp .env.example .envAdd your Vercel AI Gateway API key and PostgreSQL connection string to the .env file:
AI_GATEWAY_API_KEY=your_api_key_hereDATABASE_URL=your_postgres_connection_string_hereMigrate the database schema:
npm run db:migrateStart the development server:
npm run devYour project should now be running on http://localhost:3000.