> ## Documentation Index
> Fetch the complete documentation index at: https://sitespeak.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# How to add a ChatGPT AI support agent to Replit

> How to add your custom ChatGPT trained AI support agent to your Replit website or app.

You want to embed your custom trained AI support agent in your **Replit** website page or app. Here's how to add an AI support agent to Replit with SiteSpeakAI.

**Replit** is a cloud-based development platform and AI-powered app builder that lets you write code, collaborate in real time, and build fully functional software straight from your web browser.
The **Replit Agent** is an AI tool that lets you build complete websites, apps, and tools just by describing what you want in plain English.

**Website URL**: [Replit](https://replit.com)

## Add your AI support agent to your **Replit** website or app

<Note>
  **Replit** can also be installed as a desktop app. For this tutorial we will be using the web based setup.
</Note>

### In SiteSpeakAI

Select your chatbot from the dropdown menu at the top, click on the **Install Agent** section in the sidebar, then click on the **Copy Code** button to copy your code snippet.

<img src="https://mintcdn.com/espressodev/uRHTfU4evieXXVDw/images/installing-your-chatbot/copy-code.png?fit=max&auto=format&n=uRHTfU4evieXXVDw&q=85&s=b2614ba1d9a160d4d501b1d1bca094a2" alt="Copy code snippet" width="3436" height="1916" data-path="images/installing-your-chatbot/copy-code.png" />

### In Replit

1. Log into your **Replit** account, select **Projects** on the left sidebar and click on the Project you want to add your AI Support agent to
   <img src="https://mintcdn.com/espressodev/ty4KQpOmjRG2vwqq/images/installing-your-chatbot/Replit/1-Replit-Dashboard-Projects.png?fit=max&auto=format&n=ty4KQpOmjRG2vwqq&q=85&s=1a61a113ebd34b89f9ca2c2bdb4016fb" alt="1-Replit-Dashboard-Projects" width="1280" height="732" data-path="images/installing-your-chatbot/Replit/1-Replit-Dashboard-Projects.png" />

We are going to use a prompt to instruct the **Replit Agent** to insert the snippet for us.

The prompt consists of an instruction, e.g. “Please add the following JS snippet to my project code:” followed by the snippet code as copied at the beginning of this tutorial.

<Note>
  Note that the /####################################.js part of the JS file URL will be replaced by your specific js script filename (36 characters including the 4 dashes).

  **Tip**: Create the complete prompt in a text editor and then paste this into the Replit Agent **Message Agent...** box.
</Note>

```
Please add the following JS snippet to my project code:

<!-- SiteSpeakAI - Add ChatGPT to your website -->
	<script type="text/javascript">(function()	{d=document;s=d.createElement("script");
	s.src="https://sitespeak.ai/chatbots/########-####-####-####-############.js";
	s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script>
<!-- / SiteSpeakAI -->

```

2. Insert this prompt into the Replit Agent **Message Agent...** box and click on the **Send** button
   <img src="https://mintcdn.com/espressodev/ty4KQpOmjRG2vwqq/images/installing-your-chatbot/Replit/2-Replit-Insert-AI-prompt.png?fit=max&auto=format&n=ty4KQpOmjRG2vwqq&q=85&s=9f39df38d5383141c9af9c96077c42a2" alt="2-Replit-Insert-AI-prompt" width="1420" height="806" data-path="images/installing-your-chatbot/Replit/2-Replit-Insert-AI-prompt.png" />

3. The **Replit Agent** will start adding the code to your website, it takes a while so please be patient. When done it will display a message indicating that the snippet was added and also display the AI support agent button on the Preview page. Click on **Publish** (or **Republish**) to publish your changes to your live website or app
   <img src="https://mintcdn.com/espressodev/ty4KQpOmjRG2vwqq/images/installing-your-chatbot/Replit/3-Replit-AI-action-done.png?fit=max&auto=format&n=ty4KQpOmjRG2vwqq&q=85&s=4ca42e130d623b2a6ab0dde19e179c4a" alt="3-Replit-AI-action-done" width="1418" height="806" data-path="images/installing-your-chatbot/Replit/3-Replit-AI-action-done.png" />

4. Your AI support agent button will now be displayed on your **Replit** website page or app
   <img src="https://mintcdn.com/espressodev/ty4KQpOmjRG2vwqq/images/installing-your-chatbot/Replit/4-Replit-Agent-button.png?fit=max&auto=format&n=ty4KQpOmjRG2vwqq&q=85&s=a1b531e9f152a858489e14b9fb0d2003" alt="4-Replit-Agent-button" width="1418" height="802" data-path="images/installing-your-chatbot/Replit/4-Replit-Agent-button.png" />

5. If you click on the button it will display the AI support agent dialogue
   <img src="https://mintcdn.com/espressodev/ty4KQpOmjRG2vwqq/images/installing-your-chatbot/Replit/5-Replit-Agent-dialogue.png?fit=max&auto=format&n=ty4KQpOmjRG2vwqq&q=85&s=85c6947811e70b1aadd0146357494f0d" alt="5-Replit-Agent-dialogue" width="1419" height="804" data-path="images/installing-your-chatbot/Replit/5-Replit-Agent-dialogue.png" />

Your AI support agent has now been added to your **Replit** website or app and your visitors/customers can start interacting with it!

***

<Card title="Ready to automate your customer service with AI?" icon="bot" href="https://sitespeak.ai/register?utm_source=docs&utm_medium=cta&utm_campaign=primary-cta" arrow="true" cta="Create Your AI Agent">
  Join over 1000+ businesses, websites and startups automating their customer service and other tasks with a custom trained AI agent.
</Card>
