We launched Convex Components to make adding features to your app easier! 🎉

Learn more
Back to Templates

AI Chat using OpenAI's Assistants API

Built with

npm create convex -- -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
Template hero image
Get your app up and running in minutes
Get started
Convex logo
A Trusted Solution
  • SOC 2 Type 1 Compliant
  • HIPAA Compliant
  • GDPR Verified
©2024 Convex, Inc.