Hello,
I am working on building a multilingual agent that could include 10 or more language options. My agent is very gen ai heavy and uses an English-only advanced website indexed datastore as its backend. I have been building out translation functionality within the prompt itself leveraging Gemini. Within my 'en' agent everything is working as expected, I can communicate with it in almost any language. The problems arise when I actually switch the version of my agent to a different default language, 'es' for example. What I am experiencing is that the datastore is now being hit in Spanish and my rule for translating the $rewritten-query to English before querying the datastore is ignored.
I am looking for any thoughts on workarounds. Switching to a webhook based architecture would be an option but increases the complexity and overhead of the solution. Another option could be to actually translate the datastore itself and use multiple flows based on the language to hit the correct DS. Problem here is that there would be 100,000+ webpages in my datastore constantly changing.
The ideal solution here would be to figure out how to have control over the $rewritten-query prior to hitting the datastore.
Hi @j_witty,
Welcome to Google Cloud Community!
Making sure the $rewritten-query is properly translated into English before querying the datastore is a bit challenging. Here are some potential approaches and considerations to address this:
1. Pre-query Translation Control
2. Language Detection and Query Translation Based on Rules
3. Embedding a Translation Layer
4. Multi-Language Datastore Strategy
5. Webhook-Based Query Control
The ideal solution will depend on your scalability requirements, how often the datastore is updated, and the level of complexity you're prepared to handle. You may also find this documentation helpful; it offers insights on building multilingual agents, handling language-specific data, and using AI-generated content for different languages.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |