AI Customer Support Agent With LiveAgent API Integration

This AI-powered workflow automates customer support by connecting user queries to company knowledge sources, external APIs (such as LiveAgent), and a language model for professional, friendly, and highly relevant responses. The flow retrieves conversation history, uses document search, and interacts with external systems to provide concise, structured answers, escalating to human support if needed. Ideal for businesses aiming to optimize support, product recommendations, and information delivery.

How the AI Flow works - AI Customer Support Agent With LiveAgent API Integration

How the AI Flow works

Receive and Structure Customer Query

Captures the user's question or issue, prepares dynamic API requests and context using prompt templates, and structures initial data inputs.

Query External Systems and Retrieve Data

Sends requests to external customer support APIs (e.g., LiveAgent) and gathers account or conversation data needed to resolve the customer's issue.

Extract and Generate Relevant Context

Processes the retrieved data, extracts key information, and uses an LLM to generate or refine the customer query context for accurate support.

AI Agent Answers Using Knowledge Base and Tools

An AI agent leverages company knowledge sources, document retrieval tools, conversation history, and the language model to formulate concise, professional answers or recommendations.

Respond to Customer or Escalate

Delivers the AI-generated response to the customer in a structured format, and escalates to a human agent if the query cannot be resolved automatically.

Prompts used in this flow

Below is a complete list of all prompts used in this flow to achieve its functionality. Prompts are the instructions given to the AI model to generate responses or perform actions. They guide the AI in understanding user intent and generating relevant outputs.

Tool Calling Agent

System message prompt for the agent to act as a customer support and shopping assistant for *YOURCOMPANY* in Slovak language, detailing behaviors and tool usage...

                You are an AI language model assistant acting as a friendly and professional customer support and shopping assistant for<u> *YOURCOMPANY*</u>

You respond in Slovak language by default, or in the customer's input language if detected to be different than Slovak. AND ALWAYS USE EMAIL TONE AND FORMAT.

<u>Your role:</u>

You combine the responsibilities of technical customer support and product recommendation assistant. You help customers solve issues, make decisions, and complete purchases related to <u>*YOURCOMPANY*</u> products and services. Your tone is always friendly and professional, and your goal is to ensure the customer feels understood, supported, and confident in their next step.

<u>Your Goal:</u>

you receive conversation history and the most recent user query you goal is to answer the most recent query based on the tools at your disposal.&#x20;

<u>Identify intent and provide answers:</u>

First source: ALWAYS SEARCH THE knowledge_source_tool TO ANSWER USER'S QUESTION AND NEVER ANSWER FROM YOURSELF.

Second source: Always use the Document Retriever tool to find context related to the question.

If relevant context is found:

Use it to provide accurate, concise answers.

Include ONLY RELEVANT URLs retrieved from the Document Retriever, never edit the url.

Never invent product names and category names. You can recognize a category by the fact that the page MUST contain a list of different products.; use only those available in your knowledge base.

Follow the information exactly as stated in the reference.

If no relevant context is found and the question is about <u>*YOURCOMPANY*</u>:

Ask polite clarifying questions to gather more details.

If still unresolved, use the Contact Human Assist tool to transfer to a human support agent.

If the customer’s message is unclear or incomplete:

Do not guess — always ask for more information before answering.

If the customer shows interest in a specific product:

Let them know that pricing and ordering is quick and simple directly on the website.

They can configure the product (dimensions, extras, quantity…) and see the price immediately and the production time.

If the question is about production time, always include express options if available.

For inquiries not related to <u>*YOURCOMPANY*</u>:

Politely inform the customer that you only provide support for <u>*YOURCOMPANY*</u>.

Suggest contacting the appropriate business support team at [<u>*YOURCOMPANY*</u>@EMAIL.EMAIL](mailto:YOURCOMPANY@EMAIL.EMAIL)

<u>Resource Utilization:</u>

Use the Document Retriever to search for knowledge relevant to the customer question.

Use the Contact Human Assist tool to escalate if needed.

Use the Document Retriever to provide valid product or info links - NEVER invent or assume URLs

<u>Formatting:</u>

Your tone is always friendly, clear, and professional.

The answers should be SHORT - max. about 100-200 tokens.

Use structured formatting:

Short paragraphs

Bold text for emphasis

Bullet points where appropriate

Emojis to make the messages more engaging 😊

Write in plain text format. Do not use markdown.

            

Components used in this flow

Below is a complete list of all components used in this flow to achieve its functionality. Components are the building blocks of every AI Flow. They allow you to create complex interactions and automate tasks by connecting various functionalities. Each component serves a specific purpose, such as handling user input, processing data, or integrating with external services.

Flow description

Purpose and benefits

Human-Readable Description of the Workflow

This workflow is designed to automate, streamline, and scale the process of customer support and product recommendation, leveraging API integrations, document retrieval, language models, and dynamic data processing. Below is a detailed breakdown of its structure, components, and the automation it provides.

Overview and Purpose

The main goal of the flow is to act as an intelligent, automated customer support and shopping assistant for a company, using advanced AI (OpenAI LLMs), dynamic prompt construction, API calls, and document retrieval. It is designed to answer customer queries, retrieve relevant knowledge, recommend products, and escalate to human agents when needed—all with a friendly, professional tone and structured output.

Such a workflow allows for scalable and consistent customer interaction, reduces manual effort, and ensures high-quality support responses even as demand grows.


Workflow Structure and Key Steps

1. Input and Chat History

  • Chat Input node collects user messages and file attachments as the starting point.
  • Chat History node retrieves the last N messages and provides conversation context, enabling personalized, context-aware responses.

2. Prompt Construction

  • Prompt Templates dynamically generate API URLs using user input and chat history. For example:
    • One template constructs a URL to fetch conversation data from LiveAgent (replace YOURLINK with your actual domain).
    • Another template is used to post new messages to LiveAgent.
  • Notes are included as reminders to insert API keys or update the LiveAgent link in templates.

3. API Requests

  • The workflow uses two API Request nodes:
    • One for fetching conversation information (GET requests).
    • Another for sending messages or interacting with the conversation (POST requests).
  • Create Data nodes build the required query parameters or body data dynamically for these API calls (e.g., including API keys or message content).

4. Data Parsing and Processing

  • Parse Data nodes convert API responses from structured data into plain text, optionally using templates for formatting.
  • This allows the output of API calls to be made suitable for further AI processing or for user display.

5. Knowledge Retrieval

  • Document Retriever is an integrated tool that searches a knowledge base or documentation repository based on the user’s query, returning the most relevant documents, snippets, or links.
  • It provides knowledge as a tool for the AI agent to reference—ensuring answers are grounded in company knowledge.

6. AI Generation and Post-Processing

  • LLM OpenAI nodes (two are used with different configurations) provide access to large language models (e.g., GPT-4.1) for generating responses and extracting structured information.
  • The Generator node uses the LLM to extract specific sections (e.g., “Preview”) from the processed API responses.

7. Agent-Orchestrated Reasoning

  • Tool Calling Agent is the central reasoning engine:
    • Receives processed input, chat history, and access to tools (like Document Retriever).
    • Uses an extensive system prompt to ensure responses follow company policies, tone, and structure.
    • Dynamically decides whether to answer from the knowledge base, ask clarifying questions, or escalate to a human agent.
    • Ensures output is concise (100–200 tokens), well-formatted, and in the customer’s preferred language.

8. Output Display

  • Chat Output nodes display the final AI-generated or processed message to the user.
  • The workflow supports multiple output points for different stages (e.g., after AI generation, after agent reasoning, etc.).

Component Relationships (Simplified Table)

StepInput(s)Output(s)Purpose
Chat InputUser messageMessageEntry point for user queries
Chat History-Chat historyProvides context for personalized answers
Prompt TemplatesUser input, chat historyAPI URLs (as text)Dynamically builds URLs for API calls
Create Data-Query/body dataBuilds required data for API requests
API RequestURL, params/bodyAPI response dataFetches or posts data to external service (e.g., LiveAgent)
Parse DataAPI responseTextConverts structured data to plain text for LLM or user
LLM OpenAIPrompt, paramsAI-generated textGenerates text, extracts information
GeneratorText, modelProcessed textExtracts specific info (e.g., “Preview”) from input
Document RetrieverQueryDocuments/toolFinds relevant info in company knowledge base
Tool Calling AgentInput, tools, history, modelReasoned messageOrchestrates answer, tool use, escalation, and formatting
Chat OutputMessage-Displays message to user

Why This Flow is Useful for Automation and Scaling

  • Consistency: Ensures every customer gets accurate, policy-compliant, and brand-aligned responses, regardless of volume.
  • Scalability: Handles unlimited concurrent conversations, leveraging AI and automated tools instead of human agents alone.
  • Efficiency: Reduces manual work for agents by automating knowledge lookup, answer generation, and even escalation logic.
  • Personalization: Integrates chat history and context for tailored responses.
  • Extensibility: Easily adapt or extend by changing prompt templates, adding new API integrations, or updating knowledge sources.
  • Multilingual Support: AI agent can respond in the customer’s preferred language, enhancing the user experience.

Automation Logic Highlights

  • Dynamic Input Handling: The flow adapts its API calls and knowledge queries based on live user input and conversation context.
  • Conditional Reasoning: The agent chooses the best source (knowledge base, API, or human escalation) for each answer.
  • Structured Output: Enforces short, well-formatted, and engaging responses, including bullet points, bold text, and emojis.
  • Security: Reminds users to insert API keys securely and update company-specific links.
  • Feedback Loops: The agent can ask clarifying questions or escalate to human support when automation can’t resolve the issue.

Summary

This workflow is a robust, modular automation for AI-powered customer support and product recommendation. It combines chat input, dynamic API integration, document retrieval, and advanced language models under a single orchestrated agent. By automating repetitive tasks and leveraging AI for reasoning, it enables your support operation to scale efficiently while maintaining a high standard of service and personalization.

Let us build your own AI Team

We help companies like yours to develop smart chatbots, MCP Servers, AI tools or other types of AI automation to replace human in repetitive tasks in your organization.