This project is a simple RAG (Retrieval Augmented Generation) chatbot demo built with Node.js and Express. The frontend is styled using Tailwind CSS for a clean and modern look.
The admin interface allows uploading knowledge sources used by the chatbot. You can now upload plain text, CSV, PDF, or JSON documents. Agents can also be renamed from their individual admin pages.
Chat panels render messages using Markdown, allowing rich formatting in both user and bot messages.
Telegram chat history from the bot is saved to chathistory.json and can be viewed in the "Chat History" page.
-
Install dependencies:
npm install
-
Create a
.envfile in the project root (or update the existing one) with the following entries:PAGE_ACCESS_TOKEN=your_facebook_page_access_token VERIFY_TOKEN=your_own_verify_token QDRANT_URL=http://localhost:6333 OPENAI_API_KEY=your_openai_api_key VIBER_AUTH_TOKEN=your_viber_auth_token VIBER_WEBHOOK_URL=https://your-domain.com LOGO_URL=https://ibb.co/HDy3fYZ8
You can copy
.env.exampleas a starting point and fill in your keys. TheOPENAI_API_KEYis required for generating embeddings and chatting with the OpenAI API. TheVIBER_AUTH_TOKENandVIBER_WEBHOOK_URLare used to configure the Viber webhook integration. Telegram bot tokens can be set when creating or editing an agent in the Admin page. -
Start the server:
npm start
The server will run on port defined by the PORT environment variable or 3000 by default.