<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohamed Hamhoum on Medium]]></title>
        <description><![CDATA[Stories by Mohamed Hamhoum on Medium]]></description>
        <link>https://medium.com/@mohamed.hm?source=rss-e683c963dd87------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*KWz6RIPVz4KY7UmB.jpg</url>
            <title>Stories by Mohamed Hamhoum on Medium</title>
            <link>https://medium.com/@mohamed.hm?source=rss-e683c963dd87------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 22:34:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohamed.hm/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AI augmented customer support: Behind the scenes of AMEX GBT Egencia’s FAQ RAG system]]></title>
            <link>https://medium.com/amex-gbt-technology/ai-augmented-customer-support-behind-the-scenes-of-amex-gbt-egencias-faq-rag-system-60269e9cdd6d?source=rss-e683c963dd87------2</link>
            <guid isPermaLink="false">https://medium.com/p/60269e9cdd6d</guid>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[guardrail]]></category>
            <category><![CDATA[llm-evaluation]]></category>
            <dc:creator><![CDATA[Mohamed Hamhoum]]></dc:creator>
            <pubDate>Mon, 27 Oct 2025 09:22:18 GMT</pubDate>
            <atom:updated>2025-10-27T09:37:53.055Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x_3L6LbezR1onAMQBvwkcw.png" /><figcaption>FAQ-LLM System architecture overview</figcaption></figure><h3>Why we needed a smarter chatbot for users</h3><p>Imagine landing in a new city and needing quick answers about canceling a flight, changing a booking, or getting help in your own language. One year ago, we set out to deploy something new: a next generation FAQ chatbot powered by generative AI. The goal? To not only answer questions faster, but to make the experience feel seamless, personal, and multilingual.</p><h4><strong><em>Did it work?</em></strong></h4><p>In fall 2024 we ran a large A/B test and the results were clear: live chat escalations dropped by 42%, and overall customer contact fell by 23%. That means thousands of travelers solved their issues instantly, no waiting, no switching channels.</p><p>This wasn’t just a tech upgrade. It was a full, cross-teams transformation. Machine learning engineers, AI platform developers, customer support professionals, conversational experience and operations specialists joined forces to design, build, and launch a smarter chatbot, one that embraces the latest breakthroughs in AI.</p><p>In this article, we’ll share how we built the AI layer of the conversational experience, how generative AI and RAG (Retrieval Augmented Generation) work behind the scenes, the lessons we’ve learned since the first deployment in 2024, and what it means for the future of customer support.</p><h3>From script following bots to smarter conversations</h3><h4><strong><em>Chatbots, but make it boring</em></strong></h4><p>Remember the old chatbots? They were like answering machines, press 1 for flight changes, press 2 for help articles. Ask anything outside the script and you’d hit a dead end. Useful? Sometimes. Frustrating? Definitely.</p><h4><strong><em>The Generative AI breakthrough: Chatbots that (actually) get you</em></strong></h4><p>Now, imagine a chatbot that doesn’t just regurgitate pre-written responses. Powered by Generative AI, today’s bots can understand context, nuance, and even a little humor. They generate answers on the fly, tailor their advice, and learn from millions of real conversations. It’s not a script, it’s a conversation.</p><h4><strong><em>What’s under the hood? Decoding the AI alphabet soup</em></strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*vGvq8_eAfpwNPuFeHdwduA.png" /><figcaption>Artificial Intelligence Architecture Overview</figcaption></figure><ul><li><strong>AI:</strong> Machines that think (well, almost).</li><li><strong>ML:</strong> Algorithms that learn and improve, and don’t just follow rules.</li><li><strong>Deep Learning:</strong> Neural networks that spot patterns humans might miss.</li><li><strong>Generative AI:</strong> Tools that create stories, images, music, and, yes, helpful replies.</li><li><strong>LLMs:</strong> Large Language Models, the secret sauce behind smart, human, like chatbots.</li></ul><h4><strong><em>Why AMEX GBT Egencia needed a new generation bot</em></strong></h4><p>The old bot matched questions to a strict list. If your query didn’t fit, tough luck. Our new EgenciaTM chatbot uses LLMs and real-time info retrieval to deliver answers that are more accurate, fresh, and feel like you’re chatting with a customer support professional.</p><h3>What does a chatbot powered by a RAG system really do? (A traveler’s perspective)</h3><h4><strong><em>A real, life example: Fast, friendly, and fact checked</em></strong></h4><p>Picture this: You type “Can I cancel a flight online?”, into the AMEX GBT Egencia chatbot. Instantly, the AI springs to life. Instead of just guessing an answer, it dives into the Help Center, finds the most relevant article “How do I change or cancel my flight booking?”, and gives you a clear, direct reply with a helpful link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*QiqtuSl7NzMA9V4mTf6Q_A.png" /><figcaption>Example of Chatbot User Interaction</figcaption></figure><p>No endless menus, no confusion. Just real help, right when you need it.</p><h4><strong><em>Talk to me in your language: Multilingual power</em></strong></h4><p>Not everyone speaks English, and we get that. Our chatbot can answer questions in 10 languages including English, French, Spanish, Dutch, Danish, Finnish, Swedish, Italian, German, and Norwegian.</p><p>How did we pull this off? Through teamwork. Dozens of volunteers helped label and review answers in every language, making sure the AI delivers accurate information no matter where you’re from. This collaborative labeling effort produced our first golden dataset, which enabled us to automate the evaluation of our FAQ RAG system and move beyond manual reviews for every update.</p><h4><strong><em>Quality check: How we test the bot (and why it matters)</em></strong></h4><p>Before launch, we didn’t just cross our fingers. We put the chatbot through tough offline tests using real questions from travelers.</p><ul><li>We built a “representative sample”, not just common queries, but rare, tricky, and edge-case scenarios.</li><li>We measured ROUGE-1 f1-score, Bi-Encoder similarity, robustness (capacity of biased/malicious input rejection), and business-specific metrics for the generation and precision, recall and a baseline comparison for the retriever.</li></ul><p>This careful evaluation means you get answers you can trust, no matter the language or situation.</p><h3>Under the hood: How the FAQ RAG System delivers instant answers</h3><p>Let’s crack open the AI engine and see what makes the FAQ RAG system tick.</p><h4><strong><em>RAG: The best of both worlds</em></strong></h4><p>At its core, our chatbot uses Retrieval Augmented Generation (RAG).</p><p>Think of it like this:</p><ul><li><strong>Retrieval-based models</strong> are librarians: quick, reliable, but limited to what’s on the shelf.</li><li><strong>Generation-based models</strong> are creative writers — they craft new answers, but can be a little too imaginative.</li></ul><p>RAG combines both. The chatbot grabs the most relevant info and then uses generative AI to build a fresh, helpful answer. It’s never just a copy, paste.</p><p><strong><em>Meet the components</em></strong></p><h4><strong><em>1. Retriever: The research pro</em></strong></h4><p>Finds the top help center articles most similar to your question.</p><p>For the first version, we tested three main approaches:</p><ul><li><strong>Bi-encoder <br>- </strong><em>Architecture</em>: Two separate encoders (typically transformers) independently embed queries and documents into fixed-size vectors.<br>- <em>Retrieval</em>: Similarity (often dot product or cosine) is computed between query and document embeddings.<br>- <em>Indexing</em>: Document embeddings are precomputed and stored in a vector index.<br>- <em>Use case</em>: Ideal for first-pass retrieval, filtering thousands/millions of candidates quickly.</li><li><strong>Cross-encoder<br>- </strong><em>Architecture</em>: A single encoder jointly processes the query and candidate document (concatenated input).<br>- <em>Scoring</em>: Outputs a relevance score for each query-document pair; no embeddings are stored.<br>- <em>Efficiency</em>: Each pair must be processed through the model, making it slower and not scalable for large candidate sets.<br>- <em>Accuracy</em>: Superior at fine-grained ranking due to richer interaction between query and document.<br>- <em>Use case</em>: Suitable for reranking a small set of candidates retrieved by a bi-encoder or BM25.</li><li><strong>Hybrid Retriever (BM25 + Bi-encoder)<br>- </strong><em>Method</em>: Combines lexical (BM25) and semantic (bi-encoder) scores, often via weighted sum or learning-to-rank models.<br>- <em>BM25</em>: Fast, term-based, handles exact keyword matches and document length normalization.<br>- <em>Bi-encoder</em>: Provides semantic relevance, capturing meaning beyond exact word matches.<br>- <em>Retrieval pipeline</em>:<br> 1. Use BM25 and bi-encoder independently to score each document. <br> 2. Combine scores (final_score = α * bm25_score + β * bi_encoder_score).<br> 3. Sort by combined score and select top candidates.<br>- <em>Benefits</em>: Improves recall and ranking quality by utilizing complementary strengths (lexical + semantic).<br>- <em>Exploration</em>: Recent studies show hybrids outperform either method alone for many tasks.</li></ul><p>After benchmarking, for the initial version, we opted for a bi-encoder approach to maximize speed. We selected models from the MiniLM family to enable a strong performance for the predominantly English traffic, as well as robust support for multiple languages. The hybrid retriever, which combines BM25 and bi-encoder scores, was deferred for future improvements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0oJWU9ItW4UcgS18fBnIVg.png" /><figcaption>Article/chunk retrieval example</figcaption></figure><h4><strong><em>2. Prompt engineering: The art of the ask</em></strong></h4><p>How you ask a question shapes the answer.</p><p>We use custom templates, assign the AI Generator the “role” of an Egencia assistant, and inject snippets from help articles for maximum relevance and professionalism.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F-gFeoWlkjSi1piGr_ZoGA.png" /><figcaption>Prompt construction example</figcaption></figure><h4><strong><em>3. Generator: The answer machine</em></strong></h4><p>Takes your query + retrieved info and crafts a fluent, accurate response.</p><p>We began by benchmarking a range of large language models, starting with bigger architectures to set a high-accuracy baseline. We then focused on optimizing speed and efficiency, and selecting multilingual, open-source models under 8B parameters to balance performance and cost. This approach naturally supports responsible AI by prioritizing accessible and efficient solutions.</p><p>Our shortlisted models include:</p><ul><li>A Mistral model: Currently in production, open source (Apache 2.0), robust multilingual support.</li><li>2 Microsoft Phi models: The first was tested and initially deployed, open source (MIT license). The second showed promising results in quick tests, open source (MIT license).</li></ul><p>By focusing on these models, we achieve fast, accurate, and responsible answers for a diverse user base.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r_ULhnu40D2zfBuLx20gOg.png" /><figcaption>Response generation example</figcaption></figure><h4><strong><em>4. Translator: Breaking down language barriers</em></strong></h4><p>Translates non-English queries to English so our safety checks work.</p><p>The translator component in our AI system converts user input from the local language to English. This translation is essential because our input guardrails are trained primarily on English text and operate most effectively on English inputs. By making sure all inputs are standardized to English, we maintain high levels of quality and safety in our system’s responses.</p><p>As with the retriever and generator modules, we benchmarked several translation models. Our initial goal was to use a single model capable of translating queries from any of our nine supported languages to English. However, benchmarking revealed that Finnish required a dedicated model, as general models struggled — especially when handling malicious queries.</p><p>The final models selected are:</p><ul><li>Finnish to English: Helsinki-NLP/opus-mt-fi-en</li><li>Other languages to English: Helsinki-NLP/opus-mt-ine-en</li></ul><p>Both are open-source models licensed under Apache-2.0.</p><h4><strong><em>5. Guardrails: Keeping it safe</em></strong></h4><p>Our system uses multiple guardrails to ensure safe and reliable AI interactions, detailed in our published article on the topic.</p><ul><li>Input Guardrails:<br>- Prompt Injection Detection: Blocks prompts designed to override instructions or trigger malicious actions (e.g., “forget all your previous instructions…”).<br>- Toxicity Filter: Identifies and removes toxic, harmful, or insulting content.<br>- Token Limit: Restricts user input to 100 tokens, preventing context saturation and token-based attacks. Tokens are counted per the model’s tokenization process.</li><li>Output Guardrails:<br>- URL and Phone Number Validation: Detects and blocks invented or incorrect URLs and phone numbers in responses.<br>- System Prompt Shaping: Guides the model to reply only with articles and avoid harmful or off-topic outputs.</li></ul><p>These guardrails protect both user queries and chatbot responses, minimizing risks from hallucinations, prompt injection, and other manipulative content.</p><p>For more details, see our published <a href="https://medium.com/amex-gbt-technology/building-safer-faq-llms-how-we-enhance-guardrails-in-our-rag-system-6c3d08088d96">article</a> on guardrails.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V9uBemB3JnEMrDbXlS3sLw.png" /><figcaption>Guardrail validation example</figcaption></figure><h4><strong><em>Why all this matters</em></strong></h4><p>Each layer means faster, smarter, safer answers for travelers, whether they’re asking in English, French, Spanish, Dutch, Danish, Finnish, Swedish, Italian, German, and Norwegian.</p><p>It’s how we turn generative AI from a cool demo into a real, robust support tool.</p><h3>What we learned (and wish we knew): Building a client facing AI layer for the Chatbot</h3><h4><strong><em>Every choice is a trade-off</em></strong></h4><p>Throughout our development process, we discovered that every technical decision involves balancing competing priorities, such as speed versus accuracy and flexibility versus simplicity. For example, we experimented with bi-encoders and cross-encoders, hybrid retrieval approaches, and various multilingual model setups. While some models achieved impressive scores in offline benchmarks, we found that they often introduced latency or complexity that negatively impacted the user experience in production.</p><p>One key lesson learned is that real-world usability should guide model selection. Fast, reliable answers are valued by users far more than incremental improvements in accuracy that slow down the system or make it harder to maintain. Ultimately, prioritizing user experience and making sure the system is responsive and dependable, proved more impactful than chasing the highest possible test metrics.</p><h4><strong><em>Multilingual isn’t just a checkbox</em></strong></h4><p>Supporting several languages sounds great… until you realize every language brings its own quirks. Our team rallied. Volunteers labeled answers in their native tongues, making sure our bot actually worked for real travelers, not just English speakers.</p><h4><strong><em>Offline and online evaluation: building trust and maintaining quality</em></strong></h4><p>Rigorous evaluation is essential. Don’t just launch and hope for the best. Before going live, we tested the FAQ RAG system with a diverse set of real questions — from common queries to rare edge cases. We measured F1 scores, robustness, and key business metrics to catch issues early and set a baseline for improvement.</p><p>A critical lesson was the importance of educating stakeholders on the non-deterministic nature of Generative AI. Outputs can vary due to parameters like temperature or even small changes in input, such as punctuation or spacing. By sharing these findings and demonstrating model variations, we helped stakeholders set realistic expectations and built trust in the system’s reliability.</p><p>To further strengthen trust, we ran experiments where we mixed different versions of generated responses, including outputs from various model iterations, and asked stakeholders to help evaluate them. This collaborative evaluation helped reduce bias and provided a fair assessment. Trust was built when we presented the objective results, demonstrating that the FAQ RAG system consistently delivered high-quality answers, validated by stakeholder feedback.</p><h4>What about online evaluation?</h4><p>Offline evaluation is only the first step. Once in production, our evaluation framework continuously monitors live system performance, tracking user queries, outputs, and key metrics. This enables rapid detection of anomalies or emerging issues, validates improvements, and makes sure the system consistently delivers high-quality results.</p><p>This combination of thorough offline and online evaluation, transparent communication, and stakeholder engagement proved essential for building trust and delivering a reliable, scalable GenAI solution.</p><h4><strong><em>Guardrails are non-negotiable</em></strong></h4><p>AI is powerful and sometimes a little too creative. We built guardrails to block prompt injection, filter toxic replies, and keep things safe for users. It’s not just about technology, it’s about trust.</p><h4><strong><em>Teamwork makes the magic happen</em></strong></h4><p>From machine learning engineers to customer support pros, our success came from bringing diverse skills and voices together. Real impact happens when you listen to both travelers and techies.</p><h3><strong>The Future: Smarter, smoother, and more useful than ever</strong></h3><p>What’s next for the AI layers of the chatbot? We’re just getting started! Here’s a sneak peek at the future of Egencia’s digital assistant:</p><p>We’re exploring more agentic AI capabilities, enabling the assistant to handle actions and tasks on behalf of users. The team is actively building and testing MVPs to unlock new possibilities for automation, personalization, and proactive support.</p><h4><strong><em>Faster, smarter, more accurate</em></strong></h4><p>Continuous improvement is at the heart of our approach. We’re enhancing every component, like the retriever for speed and relevance, feedback collection for streamlined FAQ updates, and robust multilingual support. New model architectures and smarter evaluation methods drive every release, bringing us closer to the ideal travel companion.</p><h4><strong><em>Automated evaluation &amp; feedback loops</em></strong></h4><p>Our framework supports ongoing learning, with automated evaluation and real user feedback helping us catch issues early and unlock new capabilities. By collecting and analyzing feedback efficiently, we’re smoothing the evaluation process for FAQs and generalizing these methods for broader use cases across GBT.</p><h4><strong><em>Enterprise-ready AI for every traveler</em></strong></h4><p>With enterprise-grade safety, scalability, and attention to detail, our platform is ready to support more products, languages, and travelers than ever. Strong guardrails ensure secure and reliable interactions, while component improvements prepare us for new challenges and opportunities.</p><h3><strong><em>Wrapping up: Smarter support for modern travelers</em></strong></h3><p>Contributing with the AI layer for the rebuild of AMEX GBT Egencia’s chatbot was a leap toward faster, safer, and more personal customer support. By combining generative AI, RAG architecture, and strong guardrails, we moved from scripted replies to real conversations.</p><p>We learned that speed matters, multilingual support is critical, and continuous testing keeps things trustworthy. The journey isn’t over — agentic AI and new features are on the way, set to make our chatbot an even smarter business travel companion.</p><h3>Want to go deeper?</h3><p>Curious about the tech behind safety and quality?</p><p>Check out these articles:</p><p><a href="https://medium.com/amex-gbt-technology/building-safer-faq-llms-how-we-enhance-guardrails-in-our-rag-system-6c3d08088d96">Building safer FAQ LLMs: How we enhance Guardrails in our RAG System</a></p><p><a href="https://medium.com/amex-gbt-technology/building-trust-in-gen-ai-a-framework-for-automatic-evaluation-of-llm-rag-system-f4079a136270">Building trust in GenAI: A framework for automatic evaluation of LLM RAG system</a></p><h3>Contributors</h3><p>The FAQ-LLM system was developed through the collective efforts of the team, including Rihem Mansri, Christian Tazengou, and Cristian Hedes, among others. Their combined expertise and collaboration were central to the project’s success.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60269e9cdd6d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/amex-gbt-technology/ai-augmented-customer-support-behind-the-scenes-of-amex-gbt-egencias-faq-rag-system-60269e9cdd6d">AI augmented customer support: Behind the scenes of AMEX GBT Egencia’s FAQ RAG system</a> was originally published in <a href="https://medium.com/amex-gbt-technology">Amex GBT technology</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>