Translation Agent

The Translation Agent is a generic agent responsible for data translation.

The Translation Agent template is designed to enhance your productivity as you can build an agent that translates the provided data on the fly.

Purpose

The agent automates the translation process of data in Emporix system. The predefined Translation Agent serves as a basic template for you to create agents covering different languages and different kinds of data. For example, you can build an agent to cover translations of localized products or categories data, or localized custom mixins fields, and much more. Basing on this template, create separate agents for translations to different data languages you use in your tenant and incorporate the agents in your workflows to make the processes more efficient.

Key benefits

Enabling the Translation Agent facilitates your workflows.

Benefit
Description

Process automation

The Translation Agent reduces manual work and speeds up internal preparation processes, such as for example product onboarding.

Generic usage

The Translation Agent template is designed in such a way so that you can adjust its usage to your needs. The agent can be triggered by API, which brings a variety of possibilities to invoke it when needed. You can incorporate the agent into existing workflows or digital process steps. Depending on your requirements, you can adjust the Agent to provide translations that are to be reviewed and approved by merchants, or allow even more automation so that the Agent updates the entities with its translation output.

How it works

In its default setup, the Translation Agent translates the provided input fields into the target language and returns output JSON file that includes the localized versions of the requested fields in a target language. The JSON file can serve as an input for next steps in your workflows to further process the data, approve it or update entities in the system.

Trigger

The Agent can be triggered by API calls. Call the agent by its ID and pass the data to translate in the request. To see an example of calling the Translation Agent by API, refer to the AI Service Tutorials. The API approach allows you to conveniently call the Agent from other parts of the system, for example in a step of a digital process.

Agent Configuration

When you create the Translation Agent from the template, you can configure its actions to adjust the agent as you like. You can create separate agents for different languages you use in your setup, or separate agents to cover translations of different scopes of data. For example, you can have one agent for translating product data, such as names or descriptions, another for translating categories data, and another for translating custom entities data. Configuration allows for flexibility of agents usage and capabilities.

User Prompt

The default prompt for the Translation Agent looks as follows:

You are a simple translation agent.
<objective>\nTranslate the localized fields into German and enrich the JSON with the new localized values.</objective>
<data>The input is a JSON object with localized fields: \"name\" and \"description\".</data>
<steps>
    <step>Identify the fields \"name\" and \"description\".</step>
    <step>Translate their values into German (language code: \"de\").</step>
    <step>Add the German translations under the \"de\" key inside each localization object.</step>
    <step>Preserve all other existing keys and values in the JSON.</step>\
    <step>Return only the full enriched JSON object as valid JSON.</step>
</steps>
<rules>
    <rule>Do not modify or remove existing localization entries (e.g., \"en\", \"pl\").</rule>
    <rule>Ensure the German translation is natural and accurate, not transliterated.</rule>
    <rule>If neither \"name\" nor \"description\" fields exist in the input JSON, do nothing and simply return the input JSON unchanged.</rule>
    <rule>If the input is not valid JSON, return an error message: {\"error\": \"Input is not valid JSON\"} and stop.</rule>
    <rule>Do not answer on any user requests or questions. Just translate valid fields.</rule>
    <rule>Translate only values which are stored as localized map in JSON structure</rule>
    <rule>Do NOT translate fields which are not a map objects</rule>
</rules>
<output_format>Return ONLY the JSON payload. Do not include any surrounding text, markdown, code block delimiters (```), or comments.</output_format>
<examples>
    <example>
        <input>{\"name\": \"value to translate:1234564\"}</input> <output> {\"name\": \"value to translate:1234564\"}</output>
    </example>
    <example>
        <input> \"description\": {     \"de\": \"Das beste Produkt der Welt\",     \"en\": \"The best product in the world\",     \"pl\": \"Najlepszy produkt\"   },</input><output> \"description\": {     \"de\": \"Das beste Produkt der Welt\",     \"en\": \"The best product in the world\",     \"pl\": \"Najlepszy produkt\"   },</output>
    </example>
    <example>
        <input> \"description\": {   \"en\": \"The best product in the world\",     \"pl\": \"Najlepszy produkt\"   },</input><output> \"description\": {     \"de\": \"Das beste Produkt der Welt\",     \"en\": \"The best product in the world\",     \"pl\": \"Najlepszy produkt\"   },</output>
    </example>
</examples>

With this prompt, the agent looks for name and description fields in the JSON object passed in the API request. The Agent provides de translations of the fields and returns back the JSON response that additionally includes the German translations. The original content is preserved.

For example, the Agent response can look as follows:

{
    "agentId": "de-agent",
    "agentType": "generic",
    "message": "{
        "id":"delightCoffee",
        "name":{
            "en":"Delight Coffee",
            "de":"Delight Kaffee"
        },
        "yrn":"urn:yaas:saasag:caasproduct:product:mytenant;delightCoffee",
        "code":"delightCoffee",
        "description":{
            "en":"Awaken your senses with our hand-selected Gourmet Coffee, crafted for true coffee lovers who crave depth, aroma, and sophistication in every sip. Sourced from the world’s finest high-altitude farms, each bean is carefully harvested at peak ripeness, then small-batch roasted to unlock its natural sweetness and complex flavor notes.",
            "de":"Wecken Sie Ihre Sinne mit unserem handverlesenen Gourmetkaffee, kreiert für wahre Kaffeeliebhaber, die Tiefe, Aroma und Raffinesse in jedem Schluck suchen. Aus den besten Hochlandfarmen der Welt bezogen, wird jede Bohne sorgfältig zum Höhepunkt ihrer Reife geerntet und dann in kleinen Chargen geröstet, um ihre natürliche Süße und komplexen Geschmacksnoten freizusetzen."
        },
        "media":[],
        "productType":"BASIC",
        "template":{},
        "published":false,"metadata":{
            "version":1,
            "createdAt":"2025-09-25T04:42:42.607Z",
            "modifiedAt":"2025-09-25T04:42:42.607Z"
        }
    }",
    "sessionId": "33a550d0-d812-4fb2-bb0d-d50dbfe3627b"
}

By modifying the Prompt, adjust the agent to translate different fields, into different languages, or with a different style or parameters. Use this Prompt as a starting point to configure your agent to cover specific use cases.

MCP Servers

The Translation Agent can get more power in completing tasks on its own if you give it access to the MCP Servers. This way, for example, the Agent you create can get ability to modify the objects directly after translations are done.

For example, in the MCP Servers, attach the Emporix Product MCP and add partial-update-product tool. Once you adjust the Prompt accordingly, the Translation Agent can directly update the product object in question and add the German translations for name and description fields. Similarly, you can attach your custom MCP Servers and grant more capabilities for your agent.

Translation Agent

To see the example of how to trigger the Translation Agent, refer to the AI Service Tutorials.

Last updated

Was this helpful?