A fully customizable AI chatbot built with modern web technologies. This project is designed to let you tailor every aspect of your chatbot, from its appearance and messaging to the underlying AI integrations. With support for advanced technologies such as Next.js, Tailwind CSS, RAG (Retrieval-Augmented Generation), Pinecone, and multiple AI APIs (OpenAI, Fireworks AI, Anthropic AI), this solution makes deploying your own conversational AI a breeze.
Are you ready to build your own AI chatbot in minutes? Let's get started! 🚀
For quickstart, you can ignore the detailed instructions and jump straight to the Getting Started, Deployment Instructions, Pinecone & RAG Setup, and Customization sections.
This project is a Customizable AI Chatbot that allows you to easily modify and deploy a conversational AI assistant. It is designed to answer a wide range of questions—including those about its creator, Son (David) Nguyen, as well as general inquiries—by integrating multiple AI APIs. The chatbot leverages RAG (Retrieval-Augmented Generation) to provide more accurate responses by managing document vectors with Pinecone.
The solution is built on Next.js for a robust React-based frontend, styled with Tailwind CSS for responsive design, and enriched with animations from Framer Motion. It integrates powerful AI engines such as OpenAI, Fireworks AI, and Anthropic AI to handle diverse conversational tasks.
Demo Chatbot: https://customizable-ai-chatbot.vercel.app 🌐.
Note: The demo might not work when I've run out of OpenAI credits. If you notice that, please kindly notify me via email or GitHub issues and I'll try to fix it as soon as possible. Thank you for your understanding! 🙏
The chatbot interface is designed to be modern and user-friendly, with a clean layout and smooth animations. Users can interact with the chatbot by typing messages and receiving responses in real time. The chatbot's identity and appearance can be fully customized to match your preferences.
A very high-level overview of the architecture is shown below:
Feel free to use this customizable AI chatbot for your own projects. Some use cases include personal assistants, FAQ bots, research assistants, and more. The possibilities are endless! 🚀
This project leverages an array of cutting-edge technologies:
Each of these technologies is represented with a shield icon at the top of this README for quick visual reference.
Fork the Repository:
Click the Fork button in the top-right corner of the GitHub page to create your own copy of this repository.
Clone Your Fork:
Open your terminal and run: (Replace your-username
with your GitHub username)
git clone https://github.com/hoangsonww/Customizable-AI-Chatbot.git
cd Customizable-AI-Chatbot
IMPORTANT: Before starting the project, you need to set up accounts with the following services to obtain API keys. This is crucial for the chatbot to function correctly:
Create a .env
file in the root directory of your project and add the following keys:
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
FIREWORKS_API_KEY=your_fireworks_api_key
PINECONE_API_KEY=your_pinecone_api_key
Replace the placeholder values with your actual API keys. Refer to the .env.template
file for more information.
Install Dependencies:
Ensure you have Node.js installed. Then, install the project dependencies by running:
npm install
or, if you prefer Yarn:
yarn install
Run the Development Server:
Start the local development server with:
npm run dev
Your application will be available at http://localhost:3000.
Note: Before running the project, ensure that you have set up the environment variables correctly in the
.env
file. The application will not work without these keys.
Create a Vercel Account:
Visit Vercel and sign up for an account if you haven't already.
Connect Your Git Repository:
Configure Environment Variables:
In your Vercel project settings, add the same environment variables from your .env
file:
OPENAI_API_KEY
ANTHROPIC_API_KEY
FIREWORKS_API_KEY
PINECONE_API_KEY
Deploy the Project:
Click Deploy. Vercel will build and deploy your project automatically. Your chatbot will then be live on a Vercel-provided URL.
Pinecone Account & Index:
RAG Setup:
my-ai
by default, but you can change it to whatever you prefer. Just make sure to change it in configurations/pinecone.ts
as well.Document Preparation:
Note: Be sure that your Pinecone index and RAG project are correctly set up and linked to your chatbot. This will ensure that the chatbot can provide accurate and context-aware responses.
This project is highly customizable. Below are the main configuration files that you can modify:
File: configuration/ui.ts
Customize the chatbot's UI text and settings:
import { AI_NAME, OWNER_NAME } from "@/configuration/identity";
export const CHAT_HEADER: string = `[CHAT HEADER]`;
export const MESSAGE_PLACEHOLDER: string = `[MESSAGE PLACEHOLDER]`;
export const FOOTER_MESSAGE: string = `[FOOTER MESSAGE]`;
export const CLEAR_BUTTON_TEXT: string = `[CLEAR BUTTON TEXT]`;
export const PAGE_TITLE: string = `[PAGE TITLE]`;
export const PAGE_DESCRIPTION: string = `Chat with ${AI_NAME}, ${OWNER_NAME}'s AI assistant.`;
export const EMPTY_CITATION_MESSAGE: string = "Unspecified source";
Adjust the placeholder text as needed to match your desired user interface.
File: configuration/identity.ts
Set up the chatbot’s identity and the owner's details:
export const OWNER_NAME: string = `Son (David) Nguyen`;
export const OWNER_DESCRIPTION: string = `A results-driven software engineer with expertise in data analytics, full-stack development, and technical consulting.`;
export const AI_NAME: string = `Lumina`;
export const AI_TONE: string = `Friendly and Professional`;
export const AI_ROLE: string = `AI Personal Assistant for Son (David) Nguyen`;
Modify these values if you wish to change the chatbot’s persona or its association.
For advanced customization of the chatbot’s behavior and system instructions, please review and modify the intention.ts
file. This file contains core instructions that define the chatbot’s responses and operational logic. Adjust the system prompt and behavior settings to better align with your desired use case.
File: .env
Ensure that your .env
file in the root directory contains the following keys:
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
FIREWORKS_API_KEY=your_fireworks_api_key
PINECONE_API_KEY=your_pinecone_api_key
Replace each placeholder with the respective API key provided by the service.
This is optional, but you can customize the chatbot's avatar by replacing the image file in the public
directory. The default avatar is located at public/ai-logo.png
. You can replace it with your own image file, ensuring that the new file has the same name and format.
Additionally, you can customize the web app's favicon by replacing the file at app/favicon.ico
. This will change the icon that appears in the browser tab when users visit your chatbot.
Note: The recommended image size for the avatar is 512x512 pixels, and the recommended size for the favicon is 32x32 pixels. An image with a transparent background is preferred for both.
That's it! You have now successfully customized your AI chatbot to match your preferences. Feel free to explore additional customization options as needed.
Once deployed, your AI chatbot will be available for interaction. Users can engage with the bot through the chat interface, and any updates made to the configuration files will reflect on the next deployment or rebuild. The chatbot is designed to handle questions related to its creator, Son (David) Nguyen, as well as general inquiries about various topics.
Key interactions include:
ui.ts
, identity.ts
, and intention.ts
.Alternatively, you can deploy your AI locally for testing and development purposes. The chatbot will be accessible at http://localhost:3000 once the development server is running.
The instructions for running the development server are detailed in the Local Development Setup section above.
This AI chatbot can be used for a variety of purposes, including:
And many more! The chatbot is highly adaptable and can be tailored to suit a wide range of use cases.
Contributions to enhance this project are welcome. To contribute:
If you have any questions or feedback, feel free to reach out to me at:
Additionally, this chatbot was inspired by Dr. Ringel's work and chatbot at UNC-Chapel Hill. You can find more about his work at Dr. Ringel's Website.
This project is licensed under the MIT License. Please review the license file for more details.
NOTE: This project is for educational purposes only. It is not intended for commercial use or distribution. Additionally, you must keep the footer credit intact to respect the original creator's work.
By using or contributing to this project, you agree to abide by the terms of the license.
For more information on the technologies and APIs used in this project, check out the following resources:
Happy coding! 🚀 Thank you for using and contributing to this project.