Ai chat bubble: how to create a free custom AI assistant
Deploy easily you custom AI assistant following this Github repository: AI Chat Bubble.
This AI assistant crawls a specific website, processes its content, and answers questions based on it. Let's break down the core concepts behind this repository.
1. Extracting Website Content
The first step is to gather the text content from a website. To achieve this, the repository uses Scrapy, a Python framework designed for web scraping. Scrapy is used to create a “spider”: a program that visits a given URL, extracts the text content from that website, and breaks it down into smaller chunks.
The crawling process in the repository is set up with a depth of 3. The spider collects information from the main page and also follows links from the main page. It gathers additional content up to three levels deep. This depth ensures that the assistant can understand a wide range of content related to the website.
2. Loading Data into a Vector Database
Once the website content is extracted, it is embedded using a hugging face embedding model called BAAI/bge-small-en-v1.5. Then the embeddings vectors are then stored in the Qdrant database, making it easier for the AI to retrieve relevant information when asked a question.
3. Asking Questions
After the content is stored and indexed, the AI assistant is ready to answer questions. This functionality is built around an API endpoint that allows users to submit questions. When a user asks a question, the system queries the vector database for the most relevant content. It then processes this content and generates an answer based on the data stored in the database.
Now you understand the code behind AI Chat Bubble. Follow the quickstart to launch your own assistant !