Skip to content

Commit b6a4eb5

Browse files
authored
Merge pull request #3102 from dineshr1493/cms/dineshr1493/hpe-dev-portal/blog/part-6-agentic-ai-teams-in-router-mode-multilingual-routing-with-agno
Create Blog “part-6-agentic-ai-teams-in-router-mode-multilingual-routing-with-agno”
2 parents 765d57d + 012d06b commit b6a4eb5

File tree

3 files changed

+203
-0
lines changed

3 files changed

+203
-0
lines changed
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
---
2+
title: "Part 6: Agentic AI teams in Router Mode: Multilingual routing with AGNO"
3+
date: 2025-07-21T10:04:38.579Z
4+
author: Dinesh R Singh
5+
authorimage: /img/dinesh-192-192.jpg
6+
disable: false
7+
tags:
8+
- "Language Agents "
9+
- MultiLingual Application
10+
- Multilingual
11+
- Multi Language Agents
12+
---
13+
<style>
14+
li {
15+
font-size: 27px;
16+
line-height: 33px;
17+
max-width: none;
18+
}
19+
</style>
20+
21+
One of the most powerful capabilities in Agentic AI is orchestrating multiple agents to work together—each with its own specialization. In this segment, we explore the **Router Mode** pattern, a configuration where a central team detects **context** (like language or domain) and routes queries to the right agent accordingly.
22+
23+
> **What exactly is "context"?**\
24+
> In Agentic AI, *context* refers to the key details in a user's input that help the system understand how to respond appropriately. Think of it like clues that tell the AI what kind of help is needed. For example, if a user submits a query in Hindi, the language itself becomes part of the context. Similarly, if the query mentions "insurance claims" or "server configuration," that reveals the domain or topic the user is focused on.
25+
>
26+
> **Simple Analogy:**\
27+
> Imagine walking into a large helpdesk at an international airport. You speak to a receptionist and ask for assistance. Based on your language, destination, or issue (lost luggage vs. visa questions), they direct you to the right expert—someone who speaks your language or understands your problem. That receptionist is acting like the router agent. They’re not solving the issue themselves but are smart enough to know *who* should help you based on *context*. That’s exactly what the Router Mode does in Agentic AI.
28+
29+
This method is especially effective in scenarios requiring multilingual or domain-specific support. Using the **AGNO framework**, we’ll see how to construct a language-routing team that handles diverse user inputs with precision and fallback logic—making it especially friendly for no-code or low-code setups.
30+
31+
[Inspired by my Medium post.](https://dineshr1493.medium.com/all-you-need-to-know-about-the-evolution-of-generative-ai-to-agentic-ai-part-6-agentic-ai-a-39714050857b)
32+
33+
## Router Mode: What it is?
34+
35+
In Router Mode, rather than executing tasks itself, the team acts like a switchboard, rather than executing tasks itself. Its core responsibility is to:
36+
37+
* Analyze user input
38+
* Detect the appropriate context (e.g., language)
39+
* Route the request to a specialized agent
40+
* Handle unsupported inputs gracefully
41+
42+
<center><img src="/img/screenshot-2025-07-21-at-3.38.34 pm.png" width="600" height="550" alt="Route Mode" title="Route Mode"></center>
43+
44+
### Use case: Multilingual chat support
45+
46+
Imagine a chatbot that receives queries in different languages. Router Mode enables:
47+
48+
* Language detection
49+
* Delegation to language-specific agents (e.g., Japanese, French, German)
50+
* Fallback messages for unsupported languages
51+
52+
### Implementation: AGNO framework setup
53+
54+
We’ll define a set of language-specific agents and create a routing team that delegates accordingly.
55+
56+
#### Step 1: Define language agents
57+
58+
```python
59+
from agno.agent import Agent
60+
from agno.models.anthropic import Claude
61+
from agno.models.deepseek import DeepSeek
62+
from agno.models.mistral.mistral import MistralChat
63+
from agno.models.openai import OpenAIChat
64+
65+
english_agent = Agent(
66+
name="English Agent",
67+
role="You can only answer in English",
68+
model=OpenAIChat(id="gpt-4.5-preview"),
69+
instructions=["You must only respond in English"],
70+
)
71+
72+
japanese_agent = Agent(
73+
name="Japanese Agent",
74+
role="You can only answer in Japanese",
75+
model=DeepSeek(id="deepseek-chat"),
76+
instructions=["You must only respond in Japanese"],
77+
)
78+
79+
chinese_agent = Agent(
80+
name="Chinese Agent",
81+
role="You can only answer in Chinese",
82+
model=DeepSeek(id="deepseek-chat"),
83+
instructions=["You must only respond in Chinese"],
84+
)
85+
86+
spanish_agent = Agent(
87+
name="Spanish Agent",
88+
role="You can only answer in Spanish",
89+
model=OpenAIChat(id="gpt-4.5-preview"),
90+
instructions=["You must only respond in Spanish"],
91+
)
92+
93+
french_agent = Agent(
94+
name="French Agent",
95+
role="You can only answer in French",
96+
model=MistralChat(id="mistral-large-latest"),
97+
instructions=["You must only respond in French"],
98+
)
99+
100+
german_agent = Agent(
101+
name="German Agent",
102+
role="You can only answer in German",
103+
model=Claude("claude-3-5-sonnet-20241022"),
104+
instructions=["You must only respond in German"],
105+
)
106+
107+
108+
109+
```
110+
111+
### Step 2: Create the Router team
112+
113+
```python
114+
from agno.team.team import Team
115+
116+
multi_language_team = Team(
117+
name="Multi Language Team",
118+
mode="route",
119+
model=OpenAIChat("gpt-4.5-preview"),
120+
members=[
121+
english_agent,
122+
spanish_agent,
123+
japanese_agent,
124+
french_agent,
125+
german_agent,
126+
chinese_agent,
127+
],
128+
show_tool_calls=True,
129+
markdown=True,
130+
show_members_responses=True,
131+
instructions=[
132+
"You are a language router that directs questions to the appropriate language agent.",
133+
"If the user asks in a language whose agent is not a team member, respond in English with:",
134+
"'I can only answer in the following languages: English, Spanish, Japanese, French and German. Please ask your question in one of these languages.'",
135+
"Always check the language of the user's input before routing to an agent.",
136+
"For unsupported languages like Italian, respond in English with the above message.",
137+
]
138+
)
139+
```
140+
141+
### Step 3: Run multilingual examples
142+
143+
```python
144+
multi_language_team.print_response("How are you?", stream=True) # English
145+
multi_language_team.print_response("你好吗?", stream=True) # Chinese
146+
multi_language_team.print_response("お元気ですか?", stream=True) # Japanese
147+
multi_language_team.print_response("Comment allez-vous?", stream=True) # French
148+
```
149+
150+
### Output:
151+
152+
```python
153+
[English Agent]: I'm doing great! How can I help you today?
154+
[Chinese Agent]: 我很好,谢谢你的关心。你呢?
155+
[Japanese Agent]: 元気です。あなたはお元気ですか?
156+
[French Agent]: Je vais bien, merci. Et vous ?
157+
```
158+
159+
<center><img src="/img/screenshot-2025-07-21-at-3.38.47 pm.png" width="600" height="550" alt="Agent Mode Parameters" title="Agent Mode Parameters"></center>
160+
161+
## Key parameters explained
162+
163+
<table border="1" cellpadding="8" cellspacing="0" style="border-collapse: collapse; width: 100%;">
164+
<thead style="background-color:#f2f2f2">
165+
<tr>
166+
<th>Parameter</th>
167+
<th>Description</th>
168+
</tr>
169+
</thead>
170+
<tbody>
171+
<tr>
172+
<td><code>mode="route"</code></td>
173+
<td>Instructs the team to act as a switchboard, not an executor</td>
174+
</tr>
175+
<tr>
176+
<td><code>show_members_responses=True</code></td>
177+
<td>Displays individual agent replies for traceability</td>
178+
</tr>
179+
<tr>
180+
<td><code>instructions\\\[]</code></td>
181+
<td>Core router logic: detect language, enforce exclusivity, manage fallbacks</td>
182+
</tr>
183+
<tr>
184+
<td><code>model=OpenAIChat(...)</code></td>
185+
<td>Backbone LLM used by the router team for input analysis</td>
186+
</tr>
187+
</tbody>
188+
</table>
189+
190+
## Why Router Mode works
191+
192+
* Context-awareness: Inputs are analyzed for language, not just keywords
193+
* Agent exclusivity: Each agent strictly operates in its assigned language
194+
* Fallback resilience: Unsupported queries are met with a clear, unified message
195+
* Modularity: Each language agent is replaceable or extendable
196+
197+
## Conclusion
198+
199+
Router Mode in Agentic AI introduces scalable intelligence by structuring agents like a multilingual team. Rather than overwhelming a single agent, you delegate responsibility across specialists and keep interactions clean, accurate, and context-driven.
200+
201+
With the AGNO framework, creating such intelligent, language-aware teams becomes seamless — and your agents become not just reactive, but well-organized and self-aware of their boundaries.
202+
203+
A structured team, strict instructions, and intelligent routing — that’s the future of responsive AI.
236 KB
Loading
396 KB
Loading

0 commit comments

Comments
 (0)