Frontend 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.
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
Response types
The default response types are defined in the User Prompt.
Agent Configuration
When you enable the Frontend Agent from the template, you can adjust its configuration as required.
ID
If you use the Frontend Agent on the Emporix Commerce Frontend, note that it expects an agent with the ID defined as frontendAgent. When enabling the Frontend Agent from the AI Agent Library, make sure to specify its ID as the frontendAgent.
If you want to create an agent with a different identifier, you have to adapt the id in the following path of the Emporix Commerce Frontend project:

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.
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:
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.
If you add RAG AI Tool with a product entity to the Frontend Agent, it is recommended to disable get-products tool that stems from Frontend MCP Server.
The get-products tool fetches the products that match the keyword based on the contains method, while the RAG tools enable semantic search that ensures better interpretation of the context, user's intent and relationship between the words.
Last updated
Was this helpful?

