CozeAI Integration
Coze is one of the powerful AI chatbots that helps you take care of customers automatically 247. With Coze, you just need to upload document templates or websites to train the bot. Then integrate it into AhaChat to answer customers' difficult questions, beyond AhaChat's keywords and fully personalized (the bot understands the customer's Name and Gender). This will help customers have a complete experience when interacting with your business. For example, the instructions below:
- The bot automatically answers customers after staff working hours.
- The answers will be personalized according to the customer's name and gender.
- After answering 5 questions (optional), the Bot will send a request form to collect customer information.
Notes:
- Enable Coze AI if you want AI to respond to all customer messages, or Disable it if you only want to use the Coze AI block in specific flows.
- You can also Enable Coze AI to respond to all messages while using the Coze AI block within a flow.
- The priority order for responses after integrating Coze AI into AhaChat will be: Keyword Flow → Coze AI.
Step 1: Create a Coze Assistant
Log in to Coze.
In the Workspace menu, click +Create Agent.
- Select
Create Agent
.
- Enter a name for the assistant and click
Confirm
.
Step 2: Create Persona & Prompt
You can provide specific instructions for your assistant using the built-in Prompt creation tool Optimize.
Or use Persona & Prompt content as per the following template:
Combine it with attributes as needed.
Step 3: Configure Skills for the Assistant
3.1 Model Settings
This is where you can select models from OpenAI or Google Gemini to be used for your assistant.
3.2 Knowledge
Import information from uploaded files, URLs, or other sources. The assistant will automatically decide when to retrieve content based on user requests from these knowledge sources.
3.3 Memory
Configure memory for the assistant during conversations, enabling it to provide personalized responses.
Create attribute fields to collect personal information from users during conversations and send it to the AI to provide personalized responses.
And many other Skills, such as integrating plugins for image and audio processing, workflows, and triggers.
Step 4: Publish the assistant and obtain the API Key.
After completing all the setup steps for the assistant, click the Publish button in the top-right corner.
Check the box for API and click Configure.
Select Add token.
Give any name to the Token, select the validity period (up to 30 days; once expired, you need to come back here to create a new Token), grant full permissions, and click Confirm.
Copy this Token to integrate it into AhaChat.
Step 5: Integrating Coze AI into AhaChat
5.1 Turn on Coze AI for default responses
- Log in to AhaChat: Go to the AhaChat admin page and log in to your account.
- Access the settings: From the main menu, find and select the Settings section.
- Scroll down to find the Coze AI Integration section, paste the Token you created in the previous step into the API Key field, and then click Update.
Next, select Workspace and Agent, then click the Save
button to complete the integration process.
To integrate with the Memory in the Coze AI assistant setup for personalizing user responses, you need to pass additional Custom Variables for Coze AI.
Template:
Where:
The left-side parameters correspond to Variables in Coze.
The right-side parameters are customer attributes from AhaChat.
Enable Coze AI if you want the AI to respond to all customer messages, and Disable it if you only want to use the flow from AhaChat.
5.2 Use Coze AI block in the chatbot flow
To use Coze AI in the chatbot flow, you need to follow these steps for integration as outlined in section 5.1:
Open any flow, select +Add Block → Integration AI → Coze AI.
To use the Coze AI block, you need to combine 3 blocks, including:
- The block saves the customer's question into the attribute
{{ai_question}}
.
- The block Coze AI to handle questions and provide responses should be set up as shown in the image below. You can add custom variables if you want the responses to be personalized.
- The block will return the response from the attribute
{{ai_answer}}
.
Run the chatbot to check the result. Good luck!