← Use cases

Persona B — AI Agent Platform

Scenario

You ship a ChatGPT plugin / Claude tool / Mistral function that helps users find cross-border products. The agent receives natural-language queries in any language, must route to the correct commerce inventory, must not hallucinate categories.

What mogan-i18n replaces

Working code (function calling)

{
  "type": "function",
  "function": {
    "name": "resolve_commerce_intent",
    "description": "Map user query to canonical commerce category slug",
    "parameters": {
      "type": "object",
      "properties": {
        "user_query": { "type": "string" },
        "user_locale": { "type": "string", "enum": ["us","de","fr","jp","kr","tw","cn","br","es","it"] }
      },
      "required": ["user_query","user_locale"]
    }
  }
}

Then implement resolve_commerce_intent by calling /v1/lookup. Agent gets back a canonical slug + confidence — passes to downstream inventory tool deterministically.

Why AI agents specifically benefit

Full source: /use-cases.md §Persona B (verbatim from spec, lines 104-208)