Skip to main content

Table of Contents

Pega Customer Service Chat engine architecture


Only available versions of this content are shown in the dropdown

Pega Customer Service Chat engine architecture supports synchronous communication between customers and customer service representatives(CSRs), withstanding multiple concurrent users and messages. You can further scale this architecture as the number of users increases.

The following figure shows a layered chat engine architecture and explains how the data flows between a customer and a CSR through multiple layers and components:

Chat engine architecture layers and components
Chat engine architecture that explains the data flow between a customer and a

The chat engine architecture primarily consists of the following parts:

Chat client
A JavaScript-based chat application that runs in the browser of end-user desktop computers and mobile devices.
Chat server engine
A multitenant server that is a combination of multiple servers responsible for handling the entire message communication between a customer and a CSR.

The chat server has the following components:

  • WebSocket Server
  • Extensible Messaging and Presence Protocol (XMPP) Server
  • Web Server(Express)
  • Object Interface

Layered architecture

The chat engine uses the layered architecture that contains the following layers:

Chat engine architecture layers

Layer Description
Presentation layer This layer handles the incoming data to the server from the CSR and the outgoing data from the server to the customer and in the opposite direction. The presentation layer for the CSR is the Interaction Portal, and the presentation layer for the customer is a web chatbot on the website.
Business layer

This layer handles all the business logic that takes place in the chat server. The layer is responsible for maintaining all the complex communications of WebSocket and XMPP, processing the chat events, and sending that information to the presentation layer.

Data layer

This layer handles the data storage in the database. Apart from containing the object-relational database, this layer also includes the cache that stores a subset of data.

Communication process

When a customer initiates a chat, the chat message goes to the WebSocket client from where the message passes over a TCP connection to the WebSocket server. The WebSocket server redirects the message to the chat event handlers that are responsible for processing all chat events. The chat event handlers broadcast the request through sockets to the XMPP server. The Custom to XMPP file in the XMPP server converts the message to a stanza and sends the converted text to the CSR.

When the CSR responds, the XMPP server receives a ping (response) in the form of a stanza. The XMPP to Custom file converts the stanza into a message and then broadcasts the message to the WebSocket from where the message reaches the WebSocket server. Finally, the WebSocket server sends this message over the socket connection to the WebSocket client that resides in the customer's browser.

Suggest Edit
Did you find this content helpful?

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us