Skip to main content

Objective

A Chatbot provides a conversational AI solution for handling customer inquiries through natural language interactions. This document demonstrates how to build an intelligent support system using orq.ai, enabling automated responses to common questions while maintaining the ability to escalate complex issues to human agents.

Use Case

Customer Support Chatbot is ideal for applications that need:
  • Automated Customer Service: Handle common inquiries about orders, products, policies, and troubleshooting.
  • 24/7 Availability: Provide instant responses to customers outside business hours.
  • Conversation Memory: Maintain context throughout multi-turn conversations for a better user experience.
  • Escalation Handling: Intelligent routing to human agents when automated responses are insufficient.
  • Multi-Channel Support: Deploy across web chat, mobile apps, or messaging platforms.

Prerequisite

Before configuring a Chatbot, ensure you have:

Configuring a Deployment

To create a Prompt for your chatbot, head to the AI Studio:
  • Choose a Project and Folder and select the button.
  • Choose Deployment.
  • Enter name myChatbot.
  • Choose a primary Model.
Then configure your prompt messages. Click Add Message and select System role:
Deployment editor for myChatbot with a system prompt defining a TechShop customer support assistant with responsibilities and company information.

Configure your system message to define the chatbot's personality and capabilities.

Open the Test tab to test responses for your chatbot. Deployment editor showing the myChatbot system prompt alongside a live chat preview with a user asking about Friday hours.
Learn more about the possibilities of Prompts in Orq.ai, see Creating a Prompt.
When ready with your Deployment choose Deploy, learn more about Deployment Versioning.

Integrating with the SDK

Choose your preferred programming language and install the corresponding SDK:
Get your integration ready by initializing the SDK as follows:
To create a conversational Chatbot that maintains context, implement conversation memory:
Here is what the output looks like:

Viewing Logs

Going back to the Deployment page, you can view the calls made through your chatbot application. You can view details for a single log by clicking on a log line. This opens a panel containing all the details for the log, including context, requests, and parameters sent to your Deployment. Logs table showing five gpt-3.5-turbo requests with 200 status, latency between 1.4s and 2.6s, and cost around 0.0001-0.0002 each. Monitor your chatbot’s performance by tracking:
  • Response times and success rates
  • Common customer questions and patterns
  • Escalation frequency to human agents
  • User satisfaction and conversation completion rates
To learn more about logs see Logs.