RealtimeKeep your app up to date
AuthenticationOver 80+ OAuth integrations
Convex Components
ComponentsIndependent, modular, TypeScript building blocks for your backend.
Open sourceSelf host and develop locally
AI CodingGenerate high quality Convex code with AI
Compare
Convex vs. Firebase
Convex vs. Supabase
Convex vs. SQL
DocumentationGet started with your favorite frameworks
SearchSearch across Docs, Stack, and Discord
TemplatesUse a recipe to get started quickly
Convex for StartupsStart and scale your company with Convex
Convex ChampionsAmbassadors that support our thriving community
Convex CommunityShare ideas and ask for help in our community Discord
Stack
Stack

Stack is the Convex developer portal and blog, sharing bright ideas and techniques for building with Convex.

Explore Stack
BlogDocsPricing
GitHub
Log inStart building
Back to Templates

AI Chat using OpenAI's Assistants API

GitHub logoView RepoView Live

Built with

OpenAI iconOpenAITailwind iconTailwind

Tags

AIStarter
npm create convex@latest -- -t get-convex/convex-ai-chat-openai

AI chat with context retrieval using OpenAI Assistants API.

This app demonstrates how you can add a chat bot to an existing website, powered by Convex and OpenAI's Assistants API.

This is part of a series on implementing RAG multiple ways. Read the full article here, the LangChain version here, or learn how to build a custom implementation with Convex Vector Search here. See other articles on AI here.

Overview:

  • The chat is trigged by a button in App.tsx
  • The chat frontend is all in src/aiChat
  • An example of web scraping is in convex/ingest
  • The assistant initialization and uploading of data is in convex/init.ts
  • The public endpoints for the backend are in convex/messages.ts
  • The answering logic is in convex/serve.ts
AI Chat using OpenAI's Assistants API hero image
Get your app up and running in minutes
Start building
Convex logo
ProductSyncRealtimeAuthOpen sourceAI codingChefFAQPricing
DevelopersDocsBlogComponentsTemplatesStartupsChampionsChangelogPodcastLLMs.txt
CompanyAbout usBrandInvestorsBecome a partnerJobsNewsEventsTerms of servicePrivacy policySecurity
SocialTwitterDiscordYouTubeLumaBlueskyGitHub
A Trusted Solution
  • SOC 2 Type II Compliant
  • HIPAA Compliant
  • GDPR Verified
©2025 Convex, Inc.