Customer Support
Customer support is one of the biggest use cases in AI right now. However, many people tend to overcomplicate it by introducing multiple agents. In many cases, you can achieve the desired outcome with a single agent, provided you have a well-crafted system prompt, carefully selected tools, and a curated knowledge base. A multi-agent architecture is typically only necessary if your system needs to handle a wide range of support areas. For example, you might have an HR agent that manages HR policies and executes tasks like submitting leave requests or updating employee records, and a finance agent that handles reimbursements, refunds, and other finance-related queries.
When your system involves more than 15 or 20 tools and knowledge sources, it's generally not advisable to overload a single agent. Instead, having dedicated agents for specific domains tends to perform better. Depending on your use case, we always recommend starting with a single agent, evaluating performance, identifying bottlenecks, and only then considering a multi-agent architecture.
Anthropic provides a good guide on this - https://docs.anthropic.com/en/docs/about-claude/use-case-guides/customer-support-chat
Single Agent

For a single-agent, prompting is the most crucial part. Every model behaves differently. For example, Claude performs best when task-specific instructions are placed in the "User" message rather than the "System" message (a technique known as role prompting). It's often a process of trial and error to determine what works best. Nevertheless, good prompts consist of the following fundamentals:
Step 1: Role
First step is to assign a role and personality to the agent. For example:
Step 2: Guidelines
How you want the agent to respond to a user query, a set of steps or guidelines to follow.
If the agent is unable to call specific tools in response to certain user queries, you can include additional instructions here. For example: “Use the quoting tool to generate a personalized quote.”
Step 3: Business Context
Provide general information of the company. For example:
Step 4: Provide Examples
It’s also very important to teach the agent how to respond to user queries by providing examples, a technique known as few-shot prompting.
Step 5: Guardrails and Notes
Lastly, to prevent the agent from going off track, it’s recommended to outline clear Do’s and Don’ts for how the agent should interact with the customer.
To help with prompting, you can use the "Generate" button, this will generate a system prompt following the best practices mentioned above:


Step 6: Tools and Knowledge naming and description
Most prebuilt tools come with clear names and descriptions, so users typically don’t need to modify them. However, for custom tools and knowledge bases, providing a clear and descriptive name is essential to ensure the LLM knows when and how to use the appropriate tool. Refer to best practices for defining functions. You can also use the "Generate" button to help with knowledge description:

Multi Agents
For a multi-agent architecture, we will create a system that automatically triages customer inquiries and routes them to specialized agents based on the nature of the query.
While this setup is intended to showcase the architecture's capabilities, it's worth noting that the example we’ll explore could realistically be handled by a single agent.
Overview
Start Node: Collects customer inquiry through a structured form
Condition Agent: Analyzes the inquiry and determines the appropriate routing
HR Agent: Handles human resources related queries with access to HR knowledge base
Event Manager: Manages event-related requests with API integration capabilities
General Agent: Handles general inquiries and provides broad assistance

Step 1: Create the Start Node

Begin by adding a Start node to your canvas
Configure the Start node with Form Input to collect customer inquiries
Set up the form with the following configuration:
Input Type: Form Input
Form Title: "Inquiry"
Form Description: "Customer Inquiry"
Form Input Types: Configure two string inputs:
Subject: Variable name
subjectBody: Variable name
body

Step 2: Add the Condition Agent (Detect User Intention)

Connect a Condition Agent node to the Start node
Set up the system instructions to act as a customer support agent. You can also refer to the prompt used in Single Agent. Here's a simple example:
Configure the Input to analyze the form subject:
{{ $form.subject }}Set up Scenarios for routing:
Scenario 0: "Query is related to HR"
Scenario 1: "Query is related to events"
Scenario 2: "Query is general query"

Step 3: Create the HR Agent

Add an Agent node and connect it to Condition 0 output
Set up the system message for HR specialization:
Configure Knowledge Sources (RAG):
Add Document Store: "Human Resources Law"
Description: "This information is useful when determining the legal framework and implementation requirements for human resources management under the 2016 HR law and its 2020 implementing regulation."
Return Source Documents: Enabled

Step 4: Create the Event Manager

Add another Agent node and connect it to Condition 1 output
Set up the system message:
Configure Tools:
Add OpenAPI Toolkit with event management API configuration. Refer to OpenAPI Toolkit for more details.

The Event Manager has access to a complete event management API that can:
List all events
Create new events
Retrieve event details by ID
Update event information
Delete events
Refer to Event Management Server for the example code.
Step 5: Create the General Agent

Add a third Agent node and connect it to Condition 2 output. This will act as a fallback route that can answer any non-related query. Can also be replaced by Direct Reply node if you would like to just return a default response.
Configuration:
No additional tools required for general inquiries
No knowledge sources needed
Testing the Flow
Test HR Queries: Submit inquiries about company policies, benefits, or HR procedures
Test Event Queries: Try creating, updating, or querying about company events
Test General Queries: Ask general questions to see how the system routes to the general agent
Observe Routing: Notice how the condition agent seamlessly routes queries without exposing the transfer process

Complete Flow Structure
Last updated