sparklesFrontend Agent

The Frontend Agent is a predefined agent you can attach to your commerce frontend to assist your customers.

The Frontend Agent template is available in the AI Agents Library. You can connect it to your commerce frontend to help your customers get what they need quickly and effortlessly.

Purpose

Improve the customer experience with the Frontend Agent that is capable of assisting the customers throughout their whole journey. Frontend Agent understands natural language queries and requests so the customers can easily communicate with the agent and get instant guidance and support with their tasks. Whether it be checking the order history, returning the purchased products, searching for relevant products in your store using just descriptions of requirements, adding items to cart and doing checkout, or assisting with a reported complaint, the Frontend AI Agent tackles the requests efficiently and securely fetching the specific customer's contextual data.

Key benefits

The Frontend Agent comes with built-in capabilities that contribute to better customer satisfaction.

Feature
Description

Customer-contextual data access

As the Frontend Agent is triggered by the customer directly, it safely receives the customer token which passes the contextual data, so that the Agent's answers are more accurate and relevant. The Agent knows the customer and is able to provide the right support.

RAG tools attached

The Frontend Agent can use the RAG AI Tools, whether Emporix or custom ones, to make the searching experience smoother. Attaching RAG AI tools provides the capability to add embeddings to the products search index so that the Agent is able to decipher what a customer is looking for by simple descriptions in natural language. You can decide which product properties you'd like to set embeddings for.

Additional customer support

The Frontend Agent stands at your store's door able to provide quick guidance to the customers, showing them around and helping to find the right information. The Agent answers customer questions about products, orders, quotes, and returns. It can perform storefront actions on behalf of the customer or guide customers through structured flows such as checkout and quote handling.

Structured responses

The Agent returns structured, UI-ready responses following a strict JSON schema. This allows you to display the responses on your storefront in the style/format you want with ease.

How it works

When granted the customer scope, it operates entirely within an authenticated customer context. The agent handles the following functionalities:

  • Product discovery and selection

  • Cart management

  • Checkout

  • Orders

  • Quotes

  • Returns

  • Account and address management

All actions are performed using live data from the connected MCP tools through the Frontend MCP Server and are strictly limited to the customer’s scope.

The agent's responses are well-grounded and reliable as the Agent follows the rules to never fabricate data, never assume defaults, and never operate outside the customer context.

Trigger

The Agent is triggered by an API call made by the customer query on a storefront. The customer scope is passed in the request, allowing the Agent to understand the specific customer's context.

Returned data

The Agent returns structured JSON responses, which can be directly consumed by a storefront or any other customer-facing application to render user-friendly UI components.

Default Agent responses

All responses must follow the base structure:

Common types definition

chevron-rightPrice Objecthashtag
chevron-rightAddress Objecthashtag
chevron-rightItem Object - used for cart items, order items, and quote itemshashtag

Response types

The default response types are defined in the User Prompt.

chevron-rightCart Summaryhashtag
chevron-rightOrder Summaryhashtag
chevron-rightOrder Listhashtag
chevron-rightProduct Listhashtag
chevron-rightProduct Selectionhashtag
chevron-rightAddress Listhashtag
chevron-rightAccount Detailshashtag
chevron-rightReturn Listhashtag
chevron-rightReturn Detailshashtag
chevron-rightQuote Detailshashtag
chevron-rightText Responsehashtag
chevron-rightHTML Response - used for rich HTML-formatted content when plain text is insufficienthashtag
chevron-rightTable - used for tabular data representation (orders, products, quotes, etc.)hashtag
chevron-rightError Responsehashtag

Agent Configuration

When you enable the Frontend Agent from the template, you can adjust its configuration as required.

circle-exclamation

Scopes

The Frontend Agent is designed to operate on behalf of the customer on the commerce frontend. It uses the Frontend MCP server and therefore it requires the Customer scope. This means the agent is explicitly programmed to work only in a customer context. Any invocation outside of this scope is not supported and is going to fail.

circle-info

If you want to make the agent generally available on your frontend to allow it to provide semantic product search functionality for the anonymous customers without logging in, you can grant the Anonymous scope to the agent. Then, the agent is NOT able to provide any customer-related information or perform any action on behalf of a customer, as it doesn't have access to contextual information or relevant tools.

User Prompt

The User Prompt defines the basic Emporix concepts for the agent so that it understands the context better. It also specifies the format of responses for the agent to follow.

If needed, adjust the prompt to your specific usage requirements. You can customize all response types and data structures but also extend the agent's existing responses. For example, if additional fields are required, add them to the prompt accordingly and the agent includes them in its output.

The default prompt for the Frontend Agent looks as follows:

chevron-rightUser prompthashtag

MCP Servers

The Frontend Agent uses the tools that originate from the Emporix Frontend MCP Server that is by default attached to the agent. See the Frontend MCP Tools. The tools allow the agent to get relevant information and perform an action on behalf of a customer.

The Frontend Agent uses the Frontend MCP Server in the background. The MCP provides the tools required to get instant information or perform an action on behalf of a customer on entities such as customer, address, product, order, return, cart, quote, and checkout. The Frontend MCP Server is required for smooth operation of the Frontend Agent.

If needed, add more Emporix or custom MCP tools.

AI Tools

If you want the agent to provide product recommendations and allow semantic search, attach the RAG AI Tools to the agent. RAG tools are responsible for indexing products with RAG embeddings that are based on the selected properties. The RAG Tools are not attached by default as you need to add these tools in the AI Tools view first and configure, based on your products specifics, which product properties are to be indexed to improve products searchability. You have a choice to use the Emporix RAG tool or your custom one.

circle-exclamation
circle-info

All Agents operations are tracked in the AI Logs view. You can check the details of the requests, jobs, and sessions for monitoring and evaluation purposes. For more information, see the AI Logs.

Last updated

Was this helpful?