# AI Brand Sentinel - Multilingual Support Agent (`trivedikavya/ai-brand-sentinel---multilingual-support-agent`) Actor

An intelligent AI Customer Support Agent that translates feedback from 50+ languages, analyzes sentiment, and auto-drafts replies in the customer's native language. Built for the Lingo x Apify Hackathon.

- **URL**: https://apify.com/trivedikavya/ai-brand-sentinel---multilingual-support-agent.md
- **Developed by:** [kavya trivedi](https://apify.com/trivedikavya) (community)
- **Categories:** AI, Agents, Automation
- **Stats:** 3 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.01 / 1,000 analyzed feedback items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## 🛡️ AI Brand Sentinel (Lingo-Powered)

[![Apify](https://img.shields.io/badge/Built%20on-Apify-orange?style=for-the-badge\&logo=apify)](https://apify.com)
[![Lingo](https://img.shields.io/badge/Powered%20By-Lingo.dev-blue?style=for-the-badge)](https://lingo.dev)
[![Python](https://img.shields.io/badge/Code-Python-yellow?style=for-the-badge\&logo=python)](https://python.org)
[![Monetization](https://img.shields.io/badge/Pricing-Pay%20Per%20Use-green?style=for-the-badge)](https://apify.com/store)

> **The Problem:** 75% of global customers prefer support in their native language, but hiring multilingual staff is expensive.
> **The Solution:** AI Brand Sentinel is your automated **"AI Diplomat."** It reads reviews in 50+ languages, analyzes them in English, and drafts culturally accurate replies in the customer's *native* language.

***

### 🚀 Key Features

#### 1. 🌍 Universal Ingestion

We use **Lingo.dev** to normalize feedback from **50+ languages** (Japanese, Spanish, German, etc.) into standardized English. This allows for consistent analysis regardless of the source language.

#### 2. 🧠 Sentiment Intelligence

The Actor automatically grades every piece of feedback:

- `Positive` 🟢
- `Negative` 🔴
- `Neutral` ⚪

#### 3. 🛡️ The "Lingo Test" (Safety Check)

**New Feature!** To prevent embarrassing mistranslations, the Actor performs a **Round-Trip Verification**:

1. Drafts the reply in the native language (e.g., Spanish).
2. Translates it *back* to English.
3. Compares the meaning. If they don't match, it flags the reply as `⚠️ Needs Review`.

#### 4. 🤝 The "Diplomat" Reply

Instead of replying in English, the AI generates a response in the **customer's native language**.

- *User:* "この製品は素晴らしい" (Japanese)
- *AI Reply:* "ありがとうございます！" (Japanese)

***

### 🛠️ How It Works

1. **Input:** You provide a batch of reviews (Text or CSV).
2. **Normalize:** The Actor identifies the language and translates it to English.
3. **Analyze:** Sentiment is scored (-1.0 to +1.0).
4. **Draft:** A response is generated based on the sentiment.
5. **Verify:** The "Lingo Test" confirms the translation quality.
6. **Output:** A structured JSON/Excel report is generated.

***

### ⚙️ Input Configuration

| Field | Type | Required? | Description |
| :--- | :--- | :--- | :--- |
| `comments` | String (TextArea) | **Yes** | Paste raw feedback here (comma-separated). <br> *Example:* `Good service, Muy mal servicio` |
| `lingoApiKey` | String | **No** | Your API Key from [Lingo.dev](https://lingo.dev). <br> **Leave empty** to use our Premium Managed Key (Pay-Per-Use rates apply). |
| `generateReply` | Boolean | No | If `true`, the AI auto-drafts responses. (Default: `True`) |
| `enableLingoTest` | Boolean | No | If `true`, runs the safety verification check. (Default: `True`) |

***

### 📊 Output Example

The Actor produces a detailed dataset with safety metrics:

```json
{
  "original_feedback": "Este producto es terrible.",
  "detected_language": "es",
  "translated_en": "This product is terrible.",
  "sentiment_label": "Negative",
  "ai_reply_native": "Lo sentimos mucho. Por favor contáctenos.",
  "lingo_test_status": "✅ SAFE",
  "lingo_test_score": 0.98
}
```

### 💡 Use Cases

**Global Support Triage**: Instantly understand tickets from Japan, Brazil, or France without hiring translators.

**Crisis Management**: Detect negative sentiment spikes in real-time across all markets.

**E-Commerce Automation**: Auto-draft "Thank You" notes for positive reviews in the buyer's native language.

### 💰 Pricing & Monetization

We offer a flexible Hybrid Model to suit everyone:

**Free Trial**: If you have your own Lingo.dev API Key, you pay only for Apify compute usage.

**Pay-Per-Use (Premium)**: Don't have a key? No problem. Use our Managed Key for just $0.10 per 1,000 items. We handle the API costs for you.

### ⚠️ Limitations

Sentiment Context: Sarcasm ("Oh great, another delay") can sometimes be misclassified as Positive depending on the translation nuance.

**Text Length**: extremely short comments (e.g., "Ok") may not trigger accurate language detection.

**Rate Limits**: If using your own Free Tier Lingo key, you may hit rate limits on large batches (500+ items).

### 🔮 Future Enhancements (Roadmap)

**Direct Integrations**: Connect directly to Slack, Discord, and Zendesk to pull tickets automatically.

**Custom Tone**: Allow users to select "Formal", "Playful", or "Apologetic" tones for the replies.

**Fine-Tuned Models**: Implement industry-specific sentiment models (e.g., specific to E-commerce vs. SaaS).

### 🧪 Try It Out (Sample Data)

To test the Actor immediately, copy and paste this multilingual text block into the `comments` input field:

> **I absolutely love this product it changed my life, Este servicio es terrible y nunca volveré a comprar aquí, Das ist ganz okay aber die Lieferung war langsam, J'adore la qualité de cet article c'est magnifique, この製品は壊れていました返金してください**

This block contains:

- 🇬🇧 **English:** Positive review
- 🇪🇸 **Spanish:** Negative review
- 🇩🇪 **German:** Neutral review
- 🇫🇷 **French:** Positive review
- 🇯🇵 **Japanese:** Negative review
- 51+ Language's Support

Created for the **Lingo x Apify Hackathon**.

# Actor input Schema

## `comments` (type: `string`):

Paste your customer reviews here. Separate each review with a comma (,).

## `lingoApiKey` (type: `string`):

Your API Key from Lingo.dev (Required for translation).

## `generateReply` (type: `boolean`):

Generate polite responses in the customer's native language.

## Actor input object example

```json
{
  "comments": "I love this product, Este producto es terrible, C'est correct",
  "generateReply": true
}
```

# Actor output Schema

## `dashboard_view` (type: `string`):

Clean table of feedback and replies.

## `full_json` (type: `string`):

Get the exact JSON structure with scores and translations.

## `export_csv` (type: `string`):

Best for spreadsheets.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "comments": "I love this product, Este producto es terrible, C'est correct"
};

// Run the Actor and wait for it to finish
const run = await client.actor("trivedikavya/ai-brand-sentinel---multilingual-support-agent").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "comments": "I love this product, Este producto es terrible, C'est correct" }

# Run the Actor and wait for it to finish
run = client.actor("trivedikavya/ai-brand-sentinel---multilingual-support-agent").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "comments": "I love this product, Este producto es terrible, C'\''est correct"
}' |
apify call trivedikavya/ai-brand-sentinel---multilingual-support-agent --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,trivedikavya/ai-brand-sentinel---multilingual-support-agent"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/WjgHFqPr9ViCC1qtl/builds/iSteN4Y3VaXVDTqav/openapi.json
