How to build an AI that can answer questions about your website.
This tutorial walks through a simple example of crawling a website (in this example, the Rubyroidlabs website), turning the crawled pages into embeddings using the Embeddings API, and then creating a basic search functionality that allows a user to ask questions about the embedded information. This is intended to be a starting point for more sophisticated applications that make use of custom knowledge bases.
Inspired from this blog post: https://medium.com/@rubyroidlabs/how-to-build-an-ai-chatbot-with-ruby-on-rails-and-chatgpt-9a48f292c37c
-
- Initialize Ruby on Rails project with PostgreSQL
- Setup PGVector
- Setup OpenAI
- Build a simple chat with Hotwired
-
- Chat API
- Deal-breaker
-
- Data Chunks
- Vector
- How to find the most relevant chunks