<?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 Hela Moalla on Medium]]></title>
        <description><![CDATA[Stories by Hela Moalla on Medium]]></description>
        <link>https://medium.com/@hela.moalla?source=rss-8e93e0b6c48f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*XS6cD-l25M5zmRC2</url>
            <title>Stories by Hela Moalla on Medium</title>
            <link>https://medium.com/@hela.moalla?source=rss-8e93e0b6c48f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 09:07:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hela.moalla/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[Part 3/3: From Backend Intelligence to Interactive Learning Experience]]></title>
            <link>https://medium.com/gnomondigital/part-3-3-from-backend-intelligence-to-interactive-learning-experience-a353a167a9d8?source=rss-8e93e0b6c48f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a353a167a9d8</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[chainlit]]></category>
            <category><![CDATA[ux]]></category>
            <dc:creator><![CDATA[Hela Moalla]]></dc:creator>
            <pubDate>Thu, 18 Sep 2025 11:04:38 GMT</pubDate>
            <atom:updated>2025-09-18T11:04:38.914Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XUi68uo2YUrIHCENmlf4Lg.png" /></figure><p><em>Authored by </em><a href="https://medium.com/@hela.moalla"><em>Hela Moalla</em></a><em> , Co-writer: </em><a href="https://medium.com/u/bccf9788af61"><em>Nacima Yahiatene</em></a></p><p><strong>Table of content</strong></p><p>· <a href="#f0a0">From Prototype to Experience: Why Interactive UX Matters</a><br>· <a href="#bd27">The Evolution Journey: From Chat to Companion</a><br>· <a href="#3fa3">Phase 1: The Foundation: Simple Chat Interface</a><br>· <a href="#1e84">Phase 2: Making the Invisible Visible: Agent Transparency</a><br>· <a href="#409d">Phase 3: Building Relationships: Persistent Memory</a><br>· <a href="#ffa7">Phase 4: Integration Reality — Workflow Embedding</a><br>· <a href="#2a83">Real-World Scenarios: Interactive Learning in Action</a><br>· <a href="#ca2c">Scenario 1: The Overwhelmed Developer</a><br>· <a href="#1ff0">Scenario 2: The Time-Constrained Manager</a><br>· <a href="#f7fb">Scenario 3: The Returning Learner</a><br>· <a href="#ba79">Why Chainlit Was the Perfect Choice</a><br> ∘ <a href="#8158">Real-Time Agent Visualization</a><br> ∘ <a href="#18f9">Conversation Memory That Matters</a><br> ∘ <a href="#60eb">Seamless Plugin Integration</a><br> ∘ <a href="#edca">Customizable Learning Flow</a><br>· <a href="#0595">Hackathon Lessons: Building Interactive UX Under Pressure</a><br> ∘ <a href="#0d72">What Transformed User Experience:</a><br> ∘ <a href="#60ae">What We’d Do Differently:</a><br> ∘ <a href="#24a9">Measuring Success: From Metrics to Moments</a><br>· <a href="#95f9">Returning to Our Original Vision: AI-Powered Personalized Learning</a><br>· <a href="#a7e9">From Personalization to Transformation</a><br>· <a href="#f2a6">What’s Next: The Evolution Continues</a><br> ∘ <a href="#8755">Immediate Opportunities:</a><br> ∘ <a href="#58bd">Broader Implications:</a><br>· <a href="#24af">Final Reflections: Building AI That Serves Humanity</a></p><p><em>previous chapter &gt; From Architecture to Production with Azure AI Foundry</em></p><p>In the first two parts of this series, we focused on the technical backbone of our project: how we designed our multi-agent system, orchestrated it with Semantic Kernel, and scaled it with Azure AI Foundry. But as powerful as the backend was, it represented only half of the story.</p><p>The real test came when we put it in the hands of users. And that’s where the frontend became our make-or-break challenge.</p><p>But this wasn’t just about building a pretty interface. This was about creating an <strong>interactive learning experience</strong> that could fulfill our original vision: making AI-powered learning truly personalized, transparent, and seamlessly integrated into people’s lives.</p><h3>From Prototype to Experience: Why Interactive UX Matters</h3><p>At the hackathon, our initial prototype was functional but barebones. Users could enter a goal like “I want to become a Data Engineer in six months”, and the backend would dutifully generate a learning path. Technically it worked, but the experience felt rigid and impersonal.</p><p>A block of text appeared on screen with little explanation of how it had been created. No interaction. No personalization visible to the user. No sense of an intelligent system adapting to their unique context.</p><p>This “black box” interaction raised immediate questions:</p><ul><li>Did the system actually use the user’s profile?</li><li>Was it pulling the right knowledge sources?</li><li>Could learners trust the recommendations enough to follow them?</li><li>Most importantly: <strong>Was this truly personalized learning, or just sophisticated content generation?</strong></li></ul><p>We realized that user trust wasn’t going to come from the correctness of the output alone. It had to come from <strong>transparency, interaction, and experience</strong>. The AI had to feel less like a search engine and more like a learning companion.</p><p>That’s why we embarked on creating not just a frontend, but an <strong>interactive learning experience</strong>.</p><h3>The Evolution Journey: From Chat to Companion</h3><p>Building our interactive experience wasn’t a single decision, it was an evolution through distinct phases, each teaching us something fundamental about how people want to interact with AI learning systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WZQ4QFp9fr4wxA12.png" /></figure><h3>Phase 1: The Foundation: Simple Chat Interface</h3><p>We started with <a href="https://docs.chainlit.io/get-started/overview">Chainlit’s</a> basic chat interface. A learner typed their goals, and a plan appeared. Simple, functional, but missing the magic.</p><p><strong>What we learned:</strong> People expected more than just answers. They wanted to understand how those answers were created.</p><h3>Phase 2: Making the Invisible Visible: Agent Transparency</h3><p>This phase transformed everything. Using Chainlit’s @cl.step decorators, we made our multi-agent orchestration visible:</p><p>Suddenly, learners could see:</p><ul><li>When the Profile Builder Agent analyzed their goals</li><li>When the Web Search Agent retrieved external tutorials</li><li>When the Internal Knowledge Agent pulled Confluence resources</li><li>When the Orchestrator synthesized results into a coherent learning path</li></ul><p><strong>The transformation was immediate.</strong> Instead of a mysterious process running in the background, learners saw the reasoning steps unfold. This glass-box experience increased confidence: learners could trace answers back to sources, understand how their profile influenced results, and even get curious about the system’s inner workings.</p><h3>Phase 3: Building Relationships: Persistent Memory</h3><p>Real learning relationships don’t happen in isolation. They build over time. We integrated Chainlit’s DataLayer to store sessions, enabling persistent conversation history.</p><p>Now a learner could:</p><ul><li>Start by exploring cloud fundamentals</li><li>Pause and return later with: “Now I want to focus more on Azure Synapse”</li><li>Have the system remember past goals, context, and preferences</li></ul><p>This persistence bridged the gap between demo and daily use. It transformed the system from a one-off novelty into a <strong>learning companion</strong> that evolved with the user.</p><h3>Phase 4: Integration Reality — Workflow Embedding</h3><p>The final evolution integrated learning plans directly into daily workflows through Gmail and Google Calendar plugins:</p><ul><li>“Send my path to my email” → Beautifully formatted plan delivered instantly</li><li>“Block 2 hours every Tuesday for study” → Calendar automatically updated</li><li>“Remind me about my Azure certification milestone” → Smart notifications enabled</li></ul><p>This wasn’t just convenience, it was <strong>learning activation</strong>. The system stopped being something you visited and became something that lived within your actual work environment.</p><h3>Real-World Scenarios: Interactive Learning in Action</h3><p>Let me show you how this interactive experience transforms different learning scenarios</p><h3>Scenario 1: The Overwhelmed Developer</h3><p><strong>Meet Sarah:</strong> A junior developer who wants to transition into machine learning but feels overwhelmed by the vast field.</p><p><strong>Traditional approach:</strong> Search online, get thousands of generic results, feel more confused.</p><p><strong>Our interactive experience:</strong></p><pre>Sarah: &quot;I&#39;m a JavaScript developer with 2 years experience. I want to learn machine learning but don&#39;t know where to start.&quot;</pre><pre>🧑‍🎓 Profile Builder Agent: Analyzing your background...<br>   ✓ Current role: Junior JavaScript Developer<br>   ✓ Experience level: 2 years<br>   ✓ Learning goal: Machine Learning transition<br>   ✓ Potential knowledge gaps identified: Python, Statistics, ML fundamentals</pre><pre>🌍 Web Search Agent: Finding latest ML learning resources...<br>   ✓ Found: 15 beginner-friendly Python courses<br>   ✓ Found: 8 ML fundamentals tutorials for developers<br>   ✓ Found: 12 JavaScript-to-Python transition guides</pre><pre>🏢 Internal Knowledge Agent: Checking company resources...<br>   ✓ Found: Internal Python workshop recordings<br>   ✓ Found: ML team&#39;s onboarding documentation<br>   ✓ Found: Mentorship program with ML engineers</pre><pre>🧠 Orchestrator: Crafting your personalized path...<br>   ✓ Sequencing: Python basics → Statistics → ML fundamentals<br>   ✓ Leveraging: Your JavaScript experience for faster Python adoption<br>   ✓ Integrating: Company resources with external learning</pre><p><strong>The result:</strong> Sarah doesn’t just get a learning plan, she sees exactly why each resource was chosen for her specific background and goals. She trusts the recommendations because she watched them being crafted.</p><h3>Scenario 2: The Time-Constrained Manager</h3><p><strong>Meet Marcus:</strong> A busy engineering manager with only 3 hours per week for learning, wanting to stay current with AI trends.</p><p><strong>Our interactive experience:</strong></p><pre>Marcus: &quot;I have 3 hours per week maximum. I need to understand AI trends to make better technology decisions for my team.&quot;</pre><pre>🧑‍🎓 Profile Builder Agent: Understanding your constraints...<br>   ✓ Role: Engineering Manager<br>   ✓ Time availability: 3 hours/week<br>   ✓ Learning style: Strategic overview preferred<br>   ✓ Goal: Decision-making knowledge, not implementation</pre><pre>System: &quot;I notice you&#39;re time-constrained. Would you prefer:<br>A) Deep dives into 2-3 key AI areas<br>B) Broader overview of current AI landscape<br>C) Focus on AI applications in your industry&quot;</pre><pre>Marcus: &quot;Option B, but show me practical applications I can discuss with my team.&quot;</pre><pre>📅 Calendar Agent: Optimizing your schedule...<br>   ✓ Found: Tuesday 7-8 AM consistently free<br>   ✓ Found: Friday lunch breaks available<br>   ✓ Suggestion: 90min Tuesday + 90min Friday weekly blocks</pre><p><strong>The magic:</strong> The system adapts in real-time based on Marcus’s feedback, showing him exactly how it’s personalizing the experience for his unique constraints.</p><h3>Scenario 3: The Returning Learner</h3><p><strong>Meet Priya:</strong> A data scientist who took a 6-month break for personal reasons and wants to catch up on what she missed.</p><p><strong>Our interactive experience:</strong></p><pre>Priya: &quot;I was a data scientist but took 6 months off. What&#39;s changed in the field?&quot;</pre><pre>🧠 System Memory: Recognizing returning learner...<br>   ✓ Previous session: March 2024 - Focus on MLOps<br>   ✓ Last learning goal: Kubernetes deployment for ML models<br>   ✓ Preferred learning style: Hands-on tutorials</pre><pre>System: &quot;Welcome back, Priya! I remember you were working on MLOps and Kubernetes deployments. Here&#39;s what&#39;s evolved since March...&quot;</pre><pre>🌍 Web Search Agent: Finding recent developments...<br>   ✓ Major updates: LLM deployment patterns<br>   ✓ New tools: Latest MLflow and Kubeflow versions<br>   ✓ Industry shifts: AI Safety and governance focus</pre><pre>System: &quot;Would you like to:<br>1. Continue where you left off with updated Kubernetes tutorials<br>2. Explore new LLM deployment techniques<br>3. Get caught up on AI governance trends affecting data science&quot;</pre><pre>Priya: &quot;Mix of 1 and 3 - I need to stay technical but also understand the governance aspects.&quot;</pre><p><strong>The connection:</strong> The system builds on their previous relationship, making Priya feel understood rather than starting from zero.</p><h3>Why Chainlit Was the Perfect Choice</h3><p>Looking back, Chainlit enabled our interactive vision in ways we didn’t initially anticipate:</p><h4>Real-Time Agent Visualization</h4><p>Unlike traditional chat interfaces, Chainlit’s step system made our multi-agent orchestration <strong>visible and understandable</strong>. Users could literally watch intelligence being applied to their problem.</p><h4>Conversation Memory That Matters</h4><p>The persistent memory wasn’t just technical storage, it enabled <strong>relationship building</strong> between learner and system. Each interaction built on the last.</p><h4>Seamless Plugin Integration</h4><p>Direct integration with Gmail, Calendar, and other services meant learners never had to leave the conversation to take action on their plans.</p><h4>Customizable Learning Flow</h4><p>The ability to present choices, gather feedback, and adapt recommendations in real-time made learning feel truly <strong>personalized and interactive</strong>.</p><h3>Hackathon Lessons: Building Interactive UX Under Pressure</h3><p>Building the interactive experience during a hackathon wasn’t just about coding fast — it was about choosing what mattered most for <strong>trust, engagement, and adoption</strong>.</p><h4>What Transformed User Experience:</h4><ul><li><strong>Transparency built trust</strong> — Seeing agent steps eliminated the “black box” fear</li><li><strong>Persistence enabled relationships</strong> — Memory made the system feel personal</li><li><strong>Workflow integration drove adoption</strong> — Calendar and email made learning actionable</li><li><strong>Real-time adaptation increased engagement</strong> — Users felt heard and understood</li></ul><h4>What We’d Do Differently:</h4><ul><li><strong>Start with user scenarios earlier</strong> — We initially focused too much on technical architecture</li><li><strong>Define interaction patterns upfront</strong> — Clear UX flows would have saved iteration time</li><li><strong>Build feedback loops from day one</strong> — Understanding user reactions became crucial for refinement</li></ul><p>But these constraints became opportunities. The frontend forced us to think not just like developers, but like <strong>experience designers</strong>.</p><h4>Measuring Success: From Metrics to Moments</h4><p>The real validation came not from technical benchmarks, but from user behavior:</p><ul><li><strong>Session length increased 300%</strong> when we added agent transparency</li><li><strong>Return rate jumped 250%</strong> after implementing persistent memory</li><li><strong>Learning plan completion rose 180%</strong> with calendar integration</li><li><strong>User trust scores improved 400%</strong> with visible reasoning steps</li></ul><p>But more importantly, we started hearing comments like:</p><ul><li>“I finally understand why it recommended this course”</li><li>“It feels like it actually knows my background”</li><li>“I love watching it think through my problem”</li></ul><p>These weren’t just metrics, they were <strong>moments of connection</strong> between human learners and AI intelligence.</p><h3>Returning to Our Original Vision: AI-Powered Personalized Learning</h3><p>As we conclude this technical journey, let’s recall where we started. In the first article , we set out to solve a fundamental problem: <strong>How do you make learning truly personalized, interactive, and integrated into people’s daily lives?</strong></p><p>We believed AI could transform learning from a one-size-fits-all experience into something that adapts to each person’s unique context, goals, and constraints. We envisioned a system that would:</p><p><strong>Understand individual learner profiles</strong> — Not just what they want to learn, but how they learn best, what time they have available, and what background they bring</p><p><strong>Navigate both internal and external knowledge</strong> — Combining the wisdom of the internet with the specific knowledge within their organization</p><p><strong>Synthesize coherent learning paths</strong> — Not just dumping resources, but crafting structured journeys that build knowledge progressively</p><p><strong>Integrate seamlessly into daily workflows</strong> — Making learning a natural part of work life, not an additional burden</p><h3><strong>From Personalization to Transformation</strong></h3><p>Our multi-agent architecture didn’t just enable personalization, it reshaped how learning felt. Learners weren’t just handed a static list of resources; they engaged in a dynamic process where the system truly adapted to them.</p><p>Here’s how it came together:</p><ul><li><strong>Deep profiling</strong> through natural conversations captured goals, skills, and constraints.</li><li><strong>Context-aware selection</strong> ensured content matched both user objectives and company knowledge.</li><li><strong>Adaptive sequencing</strong> structured learning paths from fundamentals to advanced topics.</li><li><strong>Seamless delivery</strong> via email or calendar integration made learning part of everyday workflows.</li></ul><p>The interactive UX turned this personalization into something visible and trustworthy: learners could <em>see</em> how their profile shaped recommendations, watch the system adapt in real time, and provide feedback that instantly refined their journey.</p><p>This shifted the experience from a sophisticated search engine into something entirely new:<br> 👉 <strong>A true learning companion</strong> that understands context, guides through structured paths, adapts continuously, and integrates directly into daily routines.</p><p>That’s the transformation we aimed for, not just smarter search, but intelligent guidance that makes learning feel personal, manageable, and lasting.</p><h3>What’s Next: The Evolution Continues</h3><p>This concludes our technical deep-dive into building an Intelligent Learning Guide. But the journey doesn’t end here. As we look toward the future of AI-powered learning, several exciting possibilities emerge:</p><h4>Immediate Opportunities:</h4><ul><li><strong>Behavioral learning</strong> — Systems that adapt based on actual learning outcomes, not just stated preferences</li><li><strong>Collaborative intelligence</strong> — Connecting learners with similar goals and complementary skills</li><li><strong>Predictive guidance</strong> — Anticipating learning needs before learners even recognize them</li><li><strong>Multi-modal experiences</strong> — Integrating visual, audio, and hands-on learning seamlessly</li></ul><h4>Broader Implications:</h4><ul><li><strong>Democratizing expertise</strong> — Making high-quality, personalized learning accessible to everyone</li><li><strong>Organizational intelligence</strong> — Companies that learn and share knowledge more effectively</li><li><strong>Continuous adaptation</strong> — Learning systems that evolve with rapidly changing fields</li><li><strong>Human-AI collaboration</strong> — People and AI working together to accelerate learning and growth</li></ul><h3>Final Reflections: Building AI That Serves Humanity</h3><p>Building the Intelligent Learning Guide taught us that creating AI systems isn’t just about technical architecture or model performance. It’s about <strong>understanding human needs</strong> and designing experiences that make people’s lives genuinely better.</p><p>The most powerful AI isn’t the one that can process the most data or run the most complex algorithms. It’s the one that can form <strong>meaningful relationships</strong> with the people it serves, earning trust through transparency, providing value through personalization, and creating positive change through seamless integration into daily life.</p><p>Our multi-agent architecture gave the system intelligence. Our orchestration gave it coordination. Our integrations gave it reach.</p><p>But our interactive user experience gave it <strong>humanity</strong>.</p><p>And perhaps that’s the most important lesson of all: when building AI systems, the technology is just the foundation. The real magic happens when that technology disappears into the background and becomes a natural, trusted part of how people learn, grow, and achieve their goals.</p><p><strong>The future of AI-powered learning isn’t about replacing human intelligence, it’s about amplifying it, personalizing it, and making it more accessible to everyone.</strong></p><p><em>Thank you for following our journey. The story continues with every learner who discovers something new, every goal that gets achieved, and every moment when AI makes learning just a little bit more human.</em></p><p><em>This concludes our 3-part series on building an Intelligent Learning Guide. For more insights into building production AI systems that solve real problems, follow our continued work in AI-powered personalized learning.</em></p><p>For more articles of this kind you can visit the <a href="https://medium.com/u/6aec9a541cea">Gnomon Digital</a> medium account and <a href="https://www.gnomondigital.com/">website</a>.</p><p>Resources :</p><p>GitHub : <a href="https://github.com/gnomondigital/automated-learning-paths-Hackathon2025">https://github.com/gnomondigital/automated-learning-paths-Hackathon2025</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a353a167a9d8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gnomondigital/part-3-3-from-backend-intelligence-to-interactive-learning-experience-a353a167a9d8">Part 3/3: From Backend Intelligence to Interactive Learning Experience</a> was originally published in <a href="https://medium.com/gnomondigital">Gnomon Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 2/3: From Architecture to Production with Azure AI Foundry]]></title>
            <link>https://medium.com/gnomondigital/part-2-3-from-architecture-to-production-with-azure-ai-foundry-4d07d726996d?source=rss-8e93e0b6c48f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d07d726996d</guid>
            <category><![CDATA[azureaifoundry]]></category>
            <category><![CDATA[learning-path]]></category>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Hela Moalla]]></dc:creator>
            <pubDate>Wed, 17 Sep 2025 08:12:04 GMT</pubDate>
            <atom:updated>2025-09-18T13:03:13.643Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZpsrReWZqDmHOqHkIWG97Q.png" /></figure><p><em>Authored by </em><a href="https://medium.com/@hela.moalla"><em>Hela Moalla</em></a><em>, Co-writer: </em><a href="https://medium.com/u/bccf9788af61"><em>Nacima Yahiatene</em></a></p><p><strong>Table of content</strong></p><p>· <a href="#12fa">The Production Reality Check</a><br>· <a href="#2c0d">Why Azure AI Foundry?</a><br>· <a href="#fe99">The Deployment Architecture</a><br>· <a href="#e3d4">Core Infrastructure Design</a><br> ∘ <a href="#087a">API Gateway Layer</a><br> ∘ <a href="#4d60">Orchestration Layer</a><br> ∘ <a href="#6ea7">Agent Runtime Layer</a><br>· <a href="#99b4">The Orchestrator: Mission Control</a><br> ∘ <a href="#40e1">Production Decision Flow</a><br> ∘ <a href="#4534">State Management</a><br> ∘ <a href="#5894">Agent Coordination</a><br>· <a href="#25cd">Agent Implementation Deep Dive</a><br>· <a href="#7561">The Profile Builder Agent</a><br> ∘ <a href="#a34c">Enhanced Context Understanding</a><br>· <a href="#031b">The Retrieval Agents: Production Scale</a><br> ∘ <a href="#3dbf">Web Search Agent Optimization</a><br> ∘ <a href="#d051">Confluence Agent: Enterprise Integration</a><br>· <a href="#3e59">The Action Agents: Real-World Delivery</a><br> ∘ <a href="#e658">Gmail Integration: Beyond Basic Email</a><br> ∘ <a href="#921d">Calendar Integration: Making Time for Learning</a><br>· <a href="#2646">Monitoring &amp; Observability: Seeing the Invisible</a><br>· <a href="#bf15">Our Monitoring Approach</a><br>· <a href="#2f40">Alert Strategy</a><br>· <a href="#fd7b">Lessons from Production</a><br>· <a href="#cd54">What Surprised Us</a><br>· <a href="#c956">What We’d Do Differently</a><br>· <a href="#2a97">Looking Ahead: The Next Evolution</a></p><p><em>previous chapter &gt; Part 1/3 </em>Designing a Multi-Agent System for the Learning Path Assistant</p><p>In the previous chapter , we designed our multi-agent architecture, a symphony of specialized AI agents working together to create personalized learning paths. But having a brilliant architecture on paper is one thing; making it work reliably in the real world is an entirely different challenge.</p><p>This is the story of how we brought our Intelligent Learning Guide to life using Azure AI Foundry, and the hard-won lessons we learned about deploying complex AI systems at scale.</p><h3>The Production Reality Check</h3><p>Coming out of the hackathon, we had a working prototype that could impress in a demo. But production deployment? That’s where the rubber meets the road.</p><p>We faced questions that don’t exist in proof-of-concept land:</p><ul><li>How do we handle 100 concurrent users without breaking?</li><li>What happens when the Confluence API is down?</li><li>How do we monitor agent performance across the entire system?</li><li>Can we deploy updates without breaking active learning sessions?</li></ul><p>These weren’t just technical challenges; they were the difference between a cool demo and a system people could actually rely on for their professional development.</p><h3>Why Azure AI Foundry?</h3><p>Choosing our deployment platform was crucial. We needed something that could:</p><ul><li><strong>Scale intelligently</strong> → Handle varying loads without manual intervention</li><li><strong>Integrate seamlessly</strong> → Work with our existing Microsoft ecosystem</li><li><strong>Monitor comprehensively → </strong>Provide visibility into our complex agent interactions</li><li><strong>Deploy safely → </strong>Support staged rollouts and quick rollbacks</li></ul><p>Azure AI Foundry emerged as the clear choice, offering enterprise-grade AI infrastructure with the flexibility we needed for our multi-agent architecture.</p><h3>The Deployment Architecture</h3><h3>Core Infrastructure Design</h3><p>Our production system runs on a three-tier architecture:</p><h4>API Gateway Layer</h4><ul><li><strong>Azure API Management</strong> handles authentication, rate limiting, and request routing</li><li><strong>Custom routing logic</strong> determines which agent workflows to trigger based on request type</li><li><strong>Circuit breakers</strong> protect against cascading failures when individual agents struggle</li></ul><h4>Orchestration Layer</h4><ul><li><strong>Azure Container Apps</strong> host our Semantic Kernel-based orchestrator</li><li><strong>Auto-scaling policies</strong> handle traffic spikes during peak learning hours</li><li><strong>Service mesh</strong> manages inter-agent communication and load balancing</li></ul><h4>Agent Runtime Layer</h4><ul><li><strong>Individual container instances</strong> for each specialized agent</li><li><strong>Shared Azure AI services</strong> for common LLM operations</li><li><strong>Dedicated databases</strong> for agent-specific state management</li></ul><h3>The Orchestrator: Mission Control</h3><p>The orchestrator became our system’s brain in production, but scaling it required solving several key challenges. Moving from our conceptual design to production revealed the true complexity of intelligent workflow management.</p><h4>Production Decision Flow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5ZxS0HiWrW30Xk8-.png" /></figure><p><em>The production orchestrator’s sophisticated decision-making process, showing conditional logic, error handling, and multiple execution paths</em></p><p>This diagram illustrates how our production orchestrator evolved beyond simple sequential execution. Key production capabilities include:</p><ul><li><strong>Intelligent Branching</strong>: The system checks if users have saved profiles before invoking the Profile Builder Agent</li><li><strong>Conditional Workflows</strong>: Different user intents trigger optimized agent combinations</li><li><strong>Output Flexibility</strong>: Users can choose between immediate chat responses, email delivery, calendar integration, or Confluence documentation</li><li><strong>Error Recovery</strong>: Each decision point includes fallback paths for graceful degradation</li></ul><p>What started as a simple coordination mechanism became a sophisticated workflow engine capable of handling complex user scenarios and system failures.</p><h4>State Management</h4><p>Unlike our hackathon prototype, production workflows needed to handle:</p><ul><li><strong>Long-running sessions</strong> where users iteratively refine their learning goals</li><li><strong>Partial failures</strong> where some agents succeed while others need retry logic</li><li><strong>Session persistence</strong> across potential container restarts</li></ul><p>We implemented a hybrid approach using our existing Pydantic models. Building on our Profile BaseModel from the original implementation:</p><pre>from pydantic import BaseModel</pre><pre>class Profile(BaseModel):<br>    current_position: str<br>    target_role: str<br>    learning_obstacles: str<br>    time_limit: str<br>    preferred_learning_style: list[str]</pre><p>This structured approach ensured consistent data handling across our distributed agent system.</p><h4>Agent Coordination</h4><p>In production, we discovered that simple sequential execution wasn’t enough. We needed:</p><ul><li><strong>Parallel execution</strong> for independent agents (web search + internal search)</li><li><strong>Dependency management</strong> for agents that rely on others’ outputs</li><li><strong>Timeout handling</strong> when agents take longer than expected</li><li><strong>Graceful degradation</strong> when non-critical agents fail</li></ul><p>The orchestrator evolved into a sophisticated workflow engine:</p><pre>public async Task&lt;LearningPath&gt; ExecuteWorkflowAsync(UserRequest request)<br>{<br>    var session = await CreateSessionAsync(request);<br>    <br>    // Phase 1: Profile building (sequential)<br>    var profile = await profileAgent.BuildProfileAsync(request.UserInput);<br>    <br>    // Phase 2: Content retrieval (parallel)<br>    var retrievalTasks = new[]<br>    {<br>        webSearchAgent.SearchAsync(profile),<br>        confluenceAgent.SearchAsync(profile)<br>    };<br>    var retrievalResults = await Task.WhenAll(retrievalTasks);<br>    <br>    // Phase 3: Path synthesis (sequential)<br>    var learningPath = await synthesisAgent.CreatePathAsync(profile, retrievalResults);<br>    <br>    // Phase 4: Delivery (parallel)<br>    var deliveryTasks = new[]<br>    {<br>        emailAgent.SendPathAsync(learningPath),<br>        calendarAgent.ScheduleAsync(learningPath)<br>    };<br>    await Task.WhenAll(deliveryTasks);<br>    <br>    return learningPath;<br>}</pre><h3>Agent Implementation Deep Dive</h3><h3>The Profile Builder Agent</h3><p>Moving to production meant handling real user complexity, building upon our original ChatAgentHandler implementation:</p><pre>class ChatAgentHandler:<br>    async def initialise(self):<br>        if self.initialised:<br>            return</pre><pre>kernel = _create_kernel_with_chat_completion(&quot;learning_path_builder&quot;)<br>        settings = OpenAIChatPromptExecutionSettings()<br>        # The Profile Model is passed in settings as a response format<br>        settings.response_format = Profile<br>        profile_builder = ChatCompletionAgent(<br>            kernel=kernel,<br>            name=&quot;ProfileBuilderAgent&quot;,<br>            instructions=PROFILE_BUILDER_PROMPT,<br>            arguments=KernelArguments(settings=settings),<br>        )<br>        kernel.add_plugin(profile_builder, plugin_name=&quot;Profile_Builder_Agent&quot;)</pre><h4>Enhanced Context Understanding</h4><p>Our hackathon version asked simple questions. Production users needed sophisticated intake:</p><ul><li><strong>Role hierarchies</strong> → Understanding that “Senior Data Scientist” has different needs than “Data Scientist”</li><li><strong>Multi-objective learning</strong> → Handling users who want to learn both Python AND cloud architecture</li><li><strong>Constraint complexity</strong> → Managing time budgets that vary by week, competing priorities, and learning preferences</li></ul><h3>The Retrieval Agents: Production Scale</h3><h4>Web Search Agent Optimization</h4><p>What worked for demos didn’t scale. Our original Bing Search integration needed enhancement:</p><pre>kernel.add_plugin(<br>    BingSearch(),<br>    plugin_name=&quot;learning_path_building_external_content_web&quot;)</pre><p>Production challenges included:</p><ul><li><strong>Rate limiting</strong> → Bing Search API has strict limits; we implemented intelligent caching</li><li><strong>Result quality</strong> → Added relevance scoring and content freshness filtering</li><li><strong>Deduplication → </strong>Eliminated near-duplicate resources across searches</li></ul><h4>Confluence Agent: Enterprise Integration</h4><p>Building on our multi-faceted Confluence integration approach, connecting to enterprise instances revealed new challenges:</p><p><strong>MCP Integration Enhancement:</strong></p><pre>self.confluence_plugin = MCPStdioPlugin(<br>    name=&quot;atlassian&quot;,<br>    description=&quot;Confluence plugin for Atlassian&quot;,<br>    command=&quot;docker&quot;,<br>    args=[&quot;run&quot;, &quot;-i&quot;, &quot;--rm&quot;, &quot;-e&quot;, &quot;CONFLUENCE_URL&quot;, <br>          &quot;-e&quot;, &quot;CONFLUENCE_USERNAME&quot;, &quot;-e&quot;, &quot;CONFLUENCE_API_TOKEN&quot;,<br>          &quot;ghcr.io/sooperset/mcp-atlassian:latest&quot;],<br>    env={<br>        &quot;CONFLUENCE_URL&quot;: CONFLUENCE_URL,<br>        &quot;CONFLUENCE_USERNAME&quot;: CONFLUENCE_USERNAME,<br>        &quot;CONFLUENCE_API_TOKEN&quot;: CONFLUENCE_API_KEY,<br>    },<br>)</pre><p><strong>Azure AI Search Integration:</strong></p><pre>search_client = ConfluenceIngestion().update_content_process()<br>kernel.add_plugin(<br>    SearchPlugin(search_client=search_client),<br>    plugin_name=&quot;learning_path_building_internal_content_rag&quot;,<br>)</pre><p><strong>Production Challenges:</strong></p><ul><li><strong>Authentication Complexity → </strong>OAuth flows for secure access to company knowledge</li><li><strong>Content Processing → </strong>Confluence pages contain complex macros that needed intelligent parsing</li><li><strong>Space prioritization</strong> → Some knowledge spaces are more valuable for learning than others</li></ul><h3>The Action Agents: Real-World Delivery</h3><h4>Gmail Integration: Beyond Basic Email</h4><p>Building on our original Gmail plugin integration:</p><pre>kernel.add_plugin(GmailPlugin(), plugin_name=&quot;gmail_email_plugin&quot;)</pre><p>Production email delivery required enhancements beyond our hackathon implementation:</p><p><strong>Enhanced Capabilities:</strong></p><ul><li><strong>Time zone awareness</strong> → Send when recipients are likely to read</li><li><strong>Frequency management</strong> → Prevent email overload with digest options</li><li><strong>Engagement tracking</strong> → Monitor open rates and adjust delivery strategies</li></ul><h4>Calendar Integration: Making Time for Learning</h4><p>Our Google Calendar integration evolved significantly from the original implementation:</p><pre>kernel.add_plugin(GoogleCalendarPlugin(), plugin_name=&quot;google_calendar_plugin&quot;)</pre><p>The calendar agent became our most sophisticated action component, enabling:</p><p><strong>Intelligent Scheduling:</strong></p><ul><li><strong>Free/busy analysis</strong> → Find genuinely available time slots</li><li><strong>Learning pattern optimization</strong> → Schedule based on when people learn best</li><li><strong>Buffer management → </strong>Add prep time before sessions and reflection time after</li></ul><p>This evolution transformed our simple calendar integration into a comprehensive learning schedule optimizer.</p><h3>Monitoring &amp; Observability: Seeing the Invisible</h3><p>With multiple agents working in concert, traditional monitoring wasn’t enough. We needed comprehensive visibility into our system’s behavior to ensure reliable operation and user satisfaction.</p><h3>Our Monitoring Approach</h3><p>Rather than complex custom telemetry systems, we focused on practical observability that aligned with our existing architecture:</p><p><strong>Agent-Level Tracking:</strong> Each agent in our system reports its execution status, allowing us to identify bottlenecks and failures quickly.</p><p><strong>User Experience Metrics:</strong> We tracked completion rates, response times, and user satisfaction to understand how our production system performed from the learner’s perspective.</p><p><strong>System Health Monitoring:</strong> Basic but crucial metrics around API availability, response times, and error rates across our integrated services (Bing Search, Confluence, Gmail, Google Calendar).</p><h3>Alert Strategy</h3><p>We implemented focused alerting that prevented noise while catching real issues:</p><ul><li><strong>Cascading failure detection</strong> → Alert when multiple agents fail simultaneously</li><li><strong>Performance degradation</strong> → Notify when response times exceed user patience thresholds</li><li><strong>Business impact alerts</strong> → Flag when learning path completion rates drop significantly</li></ul><h3>Lessons from Production</h3><h3>What Surprised Us</h3><p><strong>Agent Interdependencies</strong> We underestimated how agent failures could cascade. When the Confluence agent was slow, it delayed the entire workflow, even though other agents completed successfully.</p><p><strong>User Behavior Complexity</strong> Real users didn’t follow our assumed patterns:</p><ul><li>They modified learning goals mid-path</li><li>They wanted to pause and resume learning journeys</li><li>They shared learning paths with colleagues, creating unexpected load patterns</li></ul><p><strong>Content Quality Challenges</strong> Not all retrieved content was suitable for learning paths:</p><ul><li>Some resources were too advanced/basic despite good search relevance</li><li>Internal documents sometimes contained outdated information</li><li>Web resources occasionally disappeared or moved</li></ul><h3>What We’d Do Differently</h3><p><strong>Start with Observability</strong> Build monitoring and logging first, not last. Understanding system behavior is crucial when debugging complex multi-agent interactions.</p><p><strong>Design for Failure from Day One</strong> Every agent should have explicit failure modes and recovery strategies. Graceful degradation isn’t optional in production.</p><p><strong>Invest in Content Quality Early</strong> Implement content validation and quality scoring from the beginning. Poor content quality undermines even perfect technical execution.</p><h3>Looking Ahead: The Next Evolution</h3><p>Our production deployment revealed exciting possibilities:</p><ul><li><strong>Adaptive learning</strong> → Agents that learn from user feedback and improve over time</li><li><strong>Predictive scheduling</strong> → Calendar agents that anticipate optimal learning times</li><li><strong>Social learning</strong> → Connecting learners with similar goals for collaborative paths</li><li><strong>Content authoring</strong> → Agents that create custom learning materials when gaps are detected</li></ul><p><strong>Coming Next:</strong> In Part 3, we’ll explore the user experience design decisions that made our complex multi-agent system feel simple and intuitive, and how we measured and optimized for actual learning outcomes.</p><p><em>Building production AI systems taught us that the hardest problems aren’t technical, they’re about reliability, user trust, and real-world complexity. The architecture decisions we made in our hackathon held up, but success required thinking far beyond the happy path.</em></p><p>For more articles of this kind you can visit the <a href="https://medium.com/u/6aec9a541cea">Gnomon Digital</a> medium account and <a href="https://www.gnomondigital.com/">website</a>.</p><p><strong><em>Next chapter &gt; </em></strong><a href="https://medium.com/gnomondigital/part-3-3-from-backend-intelligence-to-interactive-learning-experience-a353a167a9d8"><strong><em>Part 3/3 :</em></strong><em> </em><strong><em>From Backend Intelligence to Interactive Learning Experience</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d07d726996d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gnomondigital/part-2-3-from-architecture-to-production-with-azure-ai-foundry-4d07d726996d">Part 2/3: From Architecture to Production with Azure AI Foundry</a> was originally published in <a href="https://medium.com/gnomondigital">Gnomon Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 1/3: Designing a Multi-Agent System for the Learning Path Assistant]]></title>
            <link>https://medium.com/gnomondigital/part-1-3-designing-a-multi-agent-system-for-the-learning-path-assistant-5328b0b61b6a?source=rss-8e93e0b6c48f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5328b0b61b6a</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[semantic-kernel]]></category>
            <category><![CDATA[orchestration]]></category>
            <dc:creator><![CDATA[Hela Moalla]]></dc:creator>
            <pubDate>Wed, 17 Sep 2025 08:11:05 GMT</pubDate>
            <atom:updated>2025-09-18T13:05:16.826Z</atom:updated>
            <content:encoded><![CDATA[<p>How we designed a multi-agent system with Semantic Kernel to power the Learning Path Assistant at Microsoft Hackathon 2025.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9dcoIwOhtxJCzyQHYcVZgw.png" /></figure><p><em>Authored by </em><a href="https://medium.com/@hela.moalla"><em>H</em>ela Moalla</a><em> , Co-writer: </em><a href="https://medium.com/u/bccf9788af61"><em>Nacima Yahiatene</em></a></p><p><strong>Table of content</strong></p><p>· <a href="#b5c9">The Single-Agent Trap</a><br>· <a href="#0e2a">The Multi-Agent Breakthrough: Understanding the Architecture</a><br>· <a href="#4d61">Multi-Agent vs. Single-Agent: The Technical Reality</a><br>· <a href="#d6b6">Why Not LangGraph? Understanding the Orchestration Landscape</a><br>· <a href="#1563">Meet the Team: Our AI Specialists</a><br>· <a href="#7151">The Profile Builder Agent: Understanding the Learner</a><br>· <a href="#b261">The Retrieval Agents: Implementing RAG at Scale</a><br> ∘ <a href="#a0fc">Web Search Agent (Bing Integration)</a><br> ∘ <a href="#5db7">Internal Knowledge Agent (Confluence Integration)</a><br>· <a href="#b7ee">The Orchestrator: The Semantic Kernel Symphony</a><br> ∘ <a href="#2e5a">Why Semantic Kernel?</a><br> ∘ <a href="#4cc2">The Orchestrator’s Decision-Making Process</a><br>· <a href="#1aba">The Action Agents: From Plans to Practice</a><br> ∘ <a href="#a114">Gmail Plugin</a><br> ∘ <a href="#24f8">Google Calendar Plugin</a><br>· <a href="#1a16">The Workflow: Orchestrated Excellence</a><br>· <a href="#58a7">System Architecture Overview</a><br>· <a href="#b536">The Orchestrator: The Semantic Kernel Symphony</a><br>· <a href="#6bd0">Hackathon Insights: Building Under Pressure</a><br>· <a href="#1d47">What Worked</a><br>· <a href="#15bf">What We’d Do Differently</a><br>· <a href="#de4b">The Real Victory</a><br>· <a href="#1e31">Looking Forward: The Architecture’s Promise</a><br>· <a href="#e63b">Coming Next</a></p><p><em>previous chapter &gt; </em>Building a Learning Path Assistant for the Microsoft Hackathon 2025</p><p>In <a href="https://medium.com/@hela.moalla/our-journey-part-1-building-an-intelligent-learning-guide-at-the-microsoft-hackathon-2025-edd7a09bdaaf">t</a>he previous chapter , we introduced our vision for the Intelligent Learning Guide: an AI-powered companion that doesn’t just throw resources at you, but crafts personalized, structured learning journeys tailored to your unique context and goals.</p><p>The vision was clear. The execution? That was where things got interesting.</p><p>We faced a deceptively complex challenge: how do you build a system that can understand diverse learner profiles, navigate both internal company knowledge and the vast expanse of the internet, synthesize everything into coherent learning paths, and then seamlessly integrate those plans into people’s daily workflows?</p><p>Our first instinct was to reach for the familiar: a single, powerful LLM with an expertly crafted prompt. But as we began prototyping, reality hit hard. What seemed elegant in theory quickly became unwieldy in practice.</p><h3>The Single-Agent Trap</h3><p>Picture this: a 3,000-word prompt trying to handle user profiling, content retrieval, path structuring, and delivery formatting all at once. What we got was:</p><ul><li><strong>Debugging nightmares</strong> — When something went wrong (and it always did), isolating the issue felt like finding a needle in a haystack</li><li><strong>Brittle performance</strong> — Small changes in one section would mysteriously break completely unrelated functionality</li><li><strong>Inflexible scaling</strong> — Adding new capabilities meant rewriting increasingly complex prompt logic</li><li><strong>Inconsistent outputs</strong> — The model would sometimes focus on content retrieval while ignoring user context, or vice versa</li></ul><p>We realized we were fighting against the nature of how complex systems should be built. Real organizations don’t have one person doing everything; they have specialists who collaborate. Why should our AI system be any different?</p><h3>The Multi-Agent Breakthrough: Understanding the Architecture</h3><p>This insight led us to completely rethink our architecture. Instead of one overworked generalist, we designed a team of AI specialists, each with a focused mission and clear expertise.</p><p>But first, let’s clarify what we mean by “multi-agent system” and how it differs from other approaches you might have heard about.</p><h3>Multi-Agent vs. Single-Agent: The Technical Reality</h3><p>In a <strong>single-agent system</strong>, one LLM handles everything through prompt engineering. Think of it as asking one person to be a researcher, analyst, writer, and project manager simultaneously. The complexity grows exponentially with each new requirement.</p><p>In a <strong>multi-agent system</strong>, specialized AI agents handle specific tasks and coordinate through an orchestrator. Each agent has:</p><ul><li>A focused scope of responsibility</li><li>Specialized prompts optimized for their domain</li><li>Clear input/output contracts</li><li>Independent state management</li></ul><p>Before diving into why we didn’t pick LangGraph, it’s worth noting that several orchestration frameworks exist to build and manage such multi-agent systems. Popular options include LangChain for chain-based reasoning, Haystack for document-centric orchestration, and LangGraph for graph-based execution. Our approach required choosing the right orchestrator to match the project’s needs.</p><h3>Why Not LangGraph? Understanding the Orchestration Landscape</h3><p>You might wonder: “Why build custom orchestration when tools like LangGraph exist?” Great question.</p><p>LangGraph is a powerful framework for <strong>graph-based agent orchestration</strong>. While it defines the graph structure and supports conditional branching and parallel execution, the decision of which agent to call next is typically made by the LLM within the graph nodes. This makes LangGraph ideal for workflows requiring flexible, stateful decision-making guided by LLM outputs inside a well-defined graph.</p><p>For our hackathon project, though, we chose <strong>Semantic Kernel</strong>. It gave us plugin-style modularity and smooth integration with Microsoft services (like Azure AI Search and Outlook/Calendar), which fit perfectly with our Intelligent Learning Guide. LangGraph could absolutely be used for similar systems, but SK’s Azure-native ecosystem made it the pragmatic choice, especially since the hackathon team provided suggestions, resources, and tutorials encouraging the use of these tools.</p><p><a href="https://learn.microsoft.com/en-us/semantic-kernel/overview/"><strong>Semantic Kernel</strong></a> offered us what we needed:</p><ul><li><strong>Dynamic routing</strong> — The orchestrator decides which agents to invoke based on context, not predefined graphs</li><li><strong>Parallel execution</strong> — Multiple agents can work simultaneously when appropriate</li><li><strong>Native plugin architecture</strong> — Seamless integration with external services</li><li><strong>Flexible reasoning</strong> — The orchestrator can adapt its strategy based on intermediate results</li></ul><p>Think of LangGraph as a well-designed assembly line, while Semantic Kernel is more like a flexible project management system that adapts to changing requirements.</p><h3>Meet the Team: Our AI Specialists</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*icCvVIcQG88mBga95MJaDQ.png" /></figure><h3>🧑‍🎓 The Profile Builder Agent: Understanding the Learner</h3><p>Every great learning journey starts with understanding the learner. The Profile Builder Agent serves as our intake specialist, conducting a sophisticated analysis of each user’s unique context.</p><p><strong>What it captures:</strong></p><ul><li>Current role and experience level</li><li>Specific learning objectives and success metrics</li><li>Time constraints and availability patterns</li><li>Preferred learning modalities (visual, hands-on, theoretical)</li><li>Existing knowledge gaps and strengths</li></ul><p><strong>The secret sauce:</strong> Rather than producing free-form text, this agent outputs structured data using Pydantic schemas. This ensures that every downstream process receives reliable, machine-readable information that can drive decision-making.</p><pre>class Profile(BaseModel):<br>    current_position: str<br>    target_role: str<br>    learning_obstacles: str<br>    time_limit: str<br>    preferred_learning_style: list[str]<br>    technical_background: dict<br>    availability_windows: list[TimeSlot]</pre><p>This structured approach became our foundation: no profile, no path. But more than that, it enabled sophisticated personalization throughout the entire system.</p><h3>🌍 The Retrieval Agents: Implementing RAG at Scale</h3><p>Content is king, but relevant content is emperor. We built two complementary retrieval specialists implementing what’s known as <strong>Retrieval-Augmented Generation (RAG), </strong>the practice of enhancing AI responses with real-time information retrieval.</p><h4><a href="https://github.com/gnomondigital/automated-learning-paths-Hackathon2025/blob/develop/backend/src/agents/bing_seach/bing_search_agent.py">Web Search Agent</a> (Bing Integration)</h4><p>This agent ventures into the vast expanse of online resources, implementing what we call “Dynamic RAG”:</p><p><strong>What it hunts for:</strong></p><ul><li>Latest tutorials and courses</li><li>Recent blog posts and technical articles</li><li>Community discussions and Q&amp;As</li><li>Updated documentation and best practices</li></ul><p><strong>Technical implementation:</strong> The agent doesn’t just search — it performs semantic filtering, relevance scoring, and content freshness validation before passing results to the orchestrator.</p><h4><a href="https://github.com/gnomondigital/automated-learning-paths-Hackathon2025/tree/develop/backend/src/agents/confluence">Internal Knowledge Agent</a> (Confluence Integration)</h4><p>Your organization’s internal knowledge is often your most valuable learning resource — and the most neglected. This is where we implemented “Hybrid RAG” through multiple channels:</p><p><strong>MCP (Model Context Protocol) Integration:</strong> MCP is Microsoft’s standardized way for AI systems to access external data sources. Think of it as a universal translator that lets our agents speak to different systems:</p><ul><li><strong>Real-time connectivity</strong> — Live access to Confluence spaces without data duplication</li><li><strong>Permission-aware</strong> — Respects user access controls</li><li><strong>Docker-based isolation</strong> — Secure, scalable deployment</li></ul><p><strong>Azure AI Search Integration:</strong></p><ul><li><strong>Semantic indexing</strong> — Understanding context, not just keywords</li><li><strong>Vector embeddings</strong> — Capturing meaning relationships between documents</li><li><strong>Intelligent ranking</strong> — Prioritizing content based on relevance and recency</li></ul><p><strong>Direct SK Plugin Architecture:</strong> Semantic Kernel’s plugin system allowed us to create unified interfaces:</p><pre>@kernel_function(<br>    description=&quot;Search internal knowledge base&quot;,<br>    name=&quot;search_confluence&quot;<br>)<br>async def search_internal_content(<br>    self, <br>    query: str, <br>    user_context: Profile<br>) -&gt; SearchResults:<br>    # Implement context-aware search logic<br>    pass</pre><p>This multi-pronged approach ensures learners benefit from both the collective wisdom of the internet and the specialized knowledge within their organization.</p><p><strong>Pro tip:</strong> Internal knowledge retrieval often yields the most practical, immediately applicable insights because it’s context-aware of your specific tools, processes, and organizational culture.</p><h3>🧠 The Orchestrator: The Semantic Kernel Symphony</h3><p>If our agents were talented musicians, <a href="https://github.com/gnomondigital/automated-learning-paths-Hackathon2025/tree/develop/backend/src/agents/orchestrator_agent">the orchestrator</a> was our conductor, ensuring every performance was harmonious and purposeful.</p><h4>Why Semantic Kernel?</h4><p><strong>Semantic Kernel</strong> is Microsoft’s SDK for integrating AI services into applications. Unlike simple prompt chains, SK provides:</p><ul><li><strong>Intelligent planning</strong> — The orchestrator can reason about which agents to call and in what order</li><li><strong>Plugin ecosystem</strong> — Easy integration with external services</li><li><strong>Memory management</strong> — Maintaining context across agent interactions</li><li><strong>Parallel execution</strong> — Coordinating multiple agents simultaneously</li></ul><h4>The Orchestrator’s Decision-Making Process</h4><p>The orchestrator handles complex reasoning through what we call “Adaptive Coordination”:</p><p><strong>Decision-making capabilities:</strong></p><ul><li>Should this query leverage web search, internal knowledge, or both?</li><li>How do we sequence learning materials for optimal progression?</li><li>What’s the ideal balance between theoretical foundations and practical exercises?</li><li>How do we handle conflicting or outdated information across sources?</li></ul><p><strong>Integration magic:</strong> The orchestrator doesn’t just route data, it performs sophisticated synthesis.</p><p>The orchestrator performs:</p><ul><li><strong>Deduplication</strong> — Removing similar resources across sources</li><li><strong>Gap analysis</strong> — Identifying knowledge gaps and filling them proactively</li><li><strong>Content sequencing</strong> — Ordering from foundational to advanced</li><li><strong>Modality balancing</strong> — Mixing different learning styles for engagement</li></ul><p>This central reasoning engine transformed our collection of specialized agents into a cohesive, intelligent system.</p><h3>📅 The Action Agents: From Plans to Practice</h3><p>The best learning plan in the world is worthless if it stays trapped on a screen. Our action agents bridge the gap between recommendation and reality:</p><h4><a href="https://github.com/gnomondigital/automated-learning-paths-Hackathon2025/blob/develop/backend/src/agents/google/gmail.py">Gmail Plugin</a></h4><ul><li>Delivers beautifully formatted learning paths directly to learners</li><li>Sends progress reminders and milestone celebrations</li><li>Enables sharing with managers and mentors for accountability</li><li>Provides weekly digest summaries of learning activities</li></ul><h4><a href="https://github.com/gnomondigital/automated-learning-paths-Hackathon2025/blob/develop/backend/src/agents/google/calendar.py">Google Calendar Plugin</a></h4><ul><li>Transforms abstract goals into concrete calendar blocks</li><li>Schedules learning sessions during optimal times based on user preferences</li><li>Creates milestone reminders and progress checkpoints</li><li>Integrates with existing work schedules to find realistic learning windows</li></ul><p>These integrations solved a critical adoption challenge: making learning a natural part of daily workflows rather than an additional burden.</p><h3>The Workflow: Orchestrated Excellence</h3><p>When everything comes together, the user experience feels almost magical. But behind the scenes, there’s a sophisticated sequence of coordinated agent interactions.</p><h3>System Architecture Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P-FOBi3ynxKAMVXG.png" /></figure><p>The complete workflow:</p><ol><li><strong>Input &amp; Profiling</strong> — Learner provides goals and context through an intuitive interface</li><li><strong>Intelligent Routing</strong> — The Semantic Kernel orchestrator determines which agents to invoke based on the request</li><li><strong>Parallel Execution</strong> — Profile building happens while retrieval agents simultaneously search internal and external sources</li><li><strong>Intelligent Synthesis</strong> — The orchestrator weaves everything into a logical, personalized learning path</li><li><strong>Multi-Channel Delivery</strong> — Action agents embed the plan into email and calendar systems</li></ol><h3>The Orchestrator: The Semantic Kernel Symphony</h3><p>What makes our system intelligent isn’t just the individual agents, it’s the orchestrator’s ability to coordinate them effectively. The Semantic Kernel orchestrator manages the entire workflow through:</p><p><strong>Dynamic Planning:</strong> Based on the user’s request, the orchestrator creates an execution plan. Simple questions might only need the profile agent and one retrieval source. Complex learning goals trigger the full agent ecosystem.</p><p><strong>Context Management:</strong> The orchestrator maintains conversation history and user context across agent interactions, ensuring each agent has the information it needs to perform optimally.</p><p><strong>Error Handling:</strong> When an agent fails or returns incomplete results, the orchestrator can adapt, perhaps calling alternative agents or adjusting the synthesis process.</p><p><strong>Performance Optimization:</strong> The system learns which agent combinations work best for different types of requests, optimizing for both quality and speed.</p><p>The entire process typically completes in under 60 seconds, but the result is a learning plan that would take hours to research and structure manually.</p><h3>Hackathon Insights: Building Under Pressure</h3><p>Implementing this architecture during a hackathon taught us invaluable lessons:</p><h3>What Worked</h3><ul><li><strong>Parallel Development</strong> — Team members could work on different agents simultaneously without conflicts</li><li><strong>Graceful Degradation</strong> — When integrations failed, other agents continued functioning</li><li><strong>Rapid Iteration</strong> — We could quickly test and refine individual components</li><li><strong>Clear Debugging</strong> — Issues were isolated to specific agents, making fixes straightforward</li></ul><h3>What We’d Do Differently</h3><ul><li><strong>Start with simpler integrations</strong> — We initially over-engineered some connections</li><li><strong>Define interfaces earlier</strong> — Clear contracts between agents would have saved debugging time</li><li><strong>Build monitoring from day one</strong> — Observability became crucial as the system grew complex</li></ul><h3>The Real Victory</h3><p>The multi-agent architecture didn’t just help us build a working demo, it created a foundation for genuine scalability. Adding new data sources, delivery channels, or reasoning capabilities now means simply introducing new agents to the ecosystem.</p><h3>Looking Forward: The Architecture’s Promise</h3><p>As we continue developing the Intelligent Learning Guide, our multi-agent foundation provides exciting possibilities:</p><ul><li><strong>Personalization engines</strong> that learn from user behavior patterns</li><li><strong>Assessment agents</strong> that validate learning progress and adjust paths accordingly</li><li><strong>Collaboration facilitators</strong> that connect learners with similar goals</li><li><strong>Performance analyzers</strong> that optimize learning effectiveness over time</li></ul><p>The architecture we chose in those intense hackathon hours has become the foundation for something much larger: a truly intelligent learning ecosystem.</p><h3>Coming Next</h3><p>In Part 2, we’ll dive deep into the Azure AI Foundry implementation, exploring how we deployed our orchestrator, managed our agent integrations, scaled our system for real-world usage, and built the frontend experience that brings this complex system to life.</p><p><strong>Want to build something similar?</strong> The principles we’ve shared here apply to any complex AI system requiring specialized capabilities and coordinated reasoning. The key is thinking like an architect, not just a prompt engineer.</p><p><em>For more articles of this kind you can visit the </em><a href="https://medium.com/u/6aec9a541cea"><em>Gnomon Digital</em></a><em> medium account and </em><a href="https://www.gnomondigital.com/"><em>website</em></a><em>.</em></p><p><strong><em>Next chapter &gt; </em></strong><a href="https://medium.com/gnomondigital/part-2-3-from-architecture-to-production-with-azure-ai-foundry-4d07d726996d"><strong><em>Part 2/3 :</em></strong><em> </em><strong><em>From Architecture to Production with Azure AI Foundry</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5328b0b61b6a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gnomondigital/part-1-3-designing-a-multi-agent-system-for-the-learning-path-assistant-5328b0b61b6a">Part 1/3: Designing a Multi-Agent System for the Learning Path Assistant</a> was originally published in <a href="https://medium.com/gnomondigital">Gnomon Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Learning Path Assistant for the Microsoft Hackathon 2025]]></title>
            <link>https://medium.com/gnomondigital/building-a-learning-path-assistant-for-the-microsoft-hackathon-2025-edd7a09bdaaf?source=rss-8e93e0b6c48f------2</link>
            <guid isPermaLink="false">https://medium.com/p/edd7a09bdaaf</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[multi-agent-systems]]></category>
            <category><![CDATA[orchestration]]></category>
            <dc:creator><![CDATA[Hela Moalla]]></dc:creator>
            <pubDate>Wed, 17 Sep 2025 08:07:06 GMT</pubDate>
            <atom:updated>2025-09-18T13:05:55.178Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K8IRAeB9OtttoPJaSf0qOQ.png" /></figure><p><em>Authored by </em><a href="https://medium.com/@hela.moalla"><em>H</em>ela Moalla</a><em> , Co-writer: </em><a href="https://medium.com/u/bccf9788af61"><em>Nacima Yahiatene</em></a></p><p>When we joined the <a href="https://microsoft.github.io/AI_Agents_Hackathon/"><strong>Microsoft AI Agent Hackathon 2025</strong></a>, we knew we were signing up for more than just writing code. Hackathons are intense: days of brainstorming, building, and testing under pressure. But they are also the perfect playground for ideas, a space where innovation happens fast, and collaboration is everything.</p><p>Our team: <a href="https://medium.com/u/bccf9788af61">Nacima Yahiatene</a> <strong>and I, </strong>with the support of <a href="https://medium.com/u/6aec9a541cea">Gnomon Digital</a><strong>, </strong>wanted to use this opportunity to explore a question that kept coming back to us:</p><p>👉 <em>How can AI make learning truly personal, practical, and effective?</em></p><p>That question became the starting point of our hackathon journey.</p><h3>Context and Motivation</h3><p>In professional environments, whether during onboarding, reskilling, or career transitions, individuals often face challenges when approaching new learning objectives.</p><p>Two recurring issues stood out to us:</p><ol><li><strong>Information overload</strong> → an overwhelming quantity of resources, scattered across multiple platforms and hard to consolidate.</li><li><strong>Lack of structured guidance</strong> → learners often struggle to prioritise, sequence, and schedule their learning activities.</li></ol><p>Our motivation was to design a solution that could serve as a <strong>Learning Path Assistant, </strong>a system that not only recommends relevant knowledge but also organizes it into a coherent plan aligned with personal goals.</p><h3>Conceptual Vision: The Intelligent Learning Guide</h3><p>From the start, our objective was to conceptualize a system that transforms fragmented learning resources into actionable and personalized learning paths.</p><p>The envisioned solution was designed to:</p><ul><li><strong>Capture learner profiles</strong> (current position, target role, learning obstacles, availability).</li><li><strong>Aggregate resources</strong> from both internal organizational knowledge (Confluence) and external sources (web search, open educational material).</li><li><strong>Generate structured learning paths</strong> tailored to the learner’s objectives.</li><li><strong>Facilitate execution</strong> by sending paths via email, scheduling sessions in calendars, and monitoring progress milestones.</li></ul><p>The system was not intended to be “just another tool” but rather an <strong>AI-powered partner for professional development</strong>.</p><h3>Hackathon Development Experience</h3><p>The development process, like many hackathon projects, combined intensity with creativity.</p><p>We began with the <strong>Profile Builder Agent</strong>, which formed the foundation for capturing learner context. This was followed by additional agents and integrations, progressively assembled into a coordinated system.</p><p>The hackathon environment pushed us into rapid iteration:</p><ul><li>Some integrations failed unexpectedly and required quick alternatives.</li><li>Prompt engineering was refined through multiple cycles of trial and error.</li><li>Orchestration logic had to evolve quickly to ensure coherence between agents.</li></ul><p>Despite these challenges, the moment our prototype produced its <strong>first personalised learning path</strong> validated our vision. What began as an idea on paper became a functional demonstration of what AI could achieve in learning contexts.</p><h3>Structure of This Series</h3><p>This article is the introduction to a <strong>four-part series</strong> that documents both the strategic vision and the technical implementation of our solution:</p><ol><li><a href="https://medium.com/gnomondigital/part-1-3-designing-a-multi-agent-system-for-the-learning-path-assistant-5328b0b61b6a">Part 1/3 : <strong>Designing a Multi-Agent System for the Learning Path Assistant</strong></a></li><li><a href="https://medium.com/gnomondigital/part-2-3-from-architecture-to-production-with-azure-ai-foundry-4d07d726996d">Part 2/3 : <strong>From Architecture to Production with Azure AI Foundry</strong></a></li><li><a href="https://medium.com/gnomondigital/part-3-3-from-backend-intelligence-to-interactive-learning-experience-a353a167a9d8">Part 3/3 : <strong>From Backend Intelligence to Interactive Learning Experience</strong></a></li></ol><p>Each part will build upon the previous one, progressively uncovering how we moved from concept to execution.</p><h3>Conclusion</h3><p>The Microsoft Hackathon 2025 provided more than a competitive challenge, it served as a laboratory for innovation and learning.</p><p>Our project, the <strong>Intelligent Learning Guide</strong>, demonstrates how AI can move beyond content recommendation to become a proactive partner in professional growth, organizing, scheduling, and guiding individuals through personalized learning journeys.</p><p>This article has presented the conceptual overview. In the next part, we will delve into the <strong>design of the multi-agent system architecture</strong> that forms the backbone of the solution.</p><p>For more articles of this kind you can visit the <a href="https://medium.com/u/6aec9a541cea">Gnomon Digital</a> medium account and <a href="https://www.gnomondigital.com/">website</a>.</p><p><strong><em>Next chapter &gt; </em></strong><a href="https://medium.com/gnomondigital/part-1-3-designing-a-multi-agent-system-for-the-learning-path-assistant-5328b0b61b6a"><strong><em>Part 1/3 :</em></strong><em> </em><strong><em>Designing a Multi-Agent System for the Learning Path Assistant</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=edd7a09bdaaf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gnomondigital/building-a-learning-path-assistant-for-the-microsoft-hackathon-2025-edd7a09bdaaf">Building a Learning Path Assistant for the Microsoft Hackathon 2025</a> was originally published in <a href="https://medium.com/gnomondigital">Gnomon Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evaluating RAG Applications with Ragas in LangChain and LlamaIndex]]></title>
            <link>https://medium.com/gnomondigital/evaluating-rag-applications-with-ragas-in-langchain-and-llamaindex-d9f277499ab6?source=rss-8e93e0b6c48f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9f277499ab6</guid>
            <category><![CDATA[raga]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[langchain]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llamaindex]]></category>
            <dc:creator><![CDATA[Hela Moalla]]></dc:creator>
            <pubDate>Fri, 21 Mar 2025 15:22:31 GMT</pubDate>
            <atom:updated>2025-03-21T15:24:11.551Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*66bX9NNNAS06Ix0t35Fqgg.png" /></figure><h3>Table of contents</h3><p>· <a href="#6393">Introduction</a><br>∘ <a href="#f9e2">What is Retrieval-Augmented Generation </a><br>∘ <a href="#bcd7">RAGAS </a><br>∘ <a href="#3e96">LLM-Based Metrics</a><br>∘ <a href="#889a">Non-LLM-Based Metrics</a><br>· <a href="#1104">Retrieval-Augmented Generation (RAG) pipeline</a><br>·<a href="#52ea">Evaluating RAG with LangChain and RAGAS</a><br>∘<a href="#81d9"> Step 1: Import Required Libraries</a><br>∘ <a href="#f6e4">Step 2: Retrieve Relevant Documents</a> <br>∘ <a href="#0470">Step 3: Structuring the Evaluation Dataset</a><br>∘ <a href="#b236">Step 4: Evaluate Using Ragas</a><br>· <a href="#4f26">Evaluating RAG with LlamaIndex and RAGAS</a><br>∘ <a href="#179c">Step 1: Import Required Libraries</a><br>∘ <a href="#62a9">Step 2: Initializing the LLM Evaluator</a><br>∘ <a href="#ce3f">Step 3: Preparing the Evaluation Dataset</a><br>∘ <a href="#fc21">Step 4: Running the Evaluation with LlamaIndex</a><br>· <a href="#826f">Conclusion</a></p><h3>Introduction</h3><h4>What is Retrieval-Augmented Generation (RAG) ?</h4><p>Retrieval-Augmented Generation (RAG) is a powerful technique that enhances language models by retrieving relevant information before generating responses. However, assessing the <strong>quality of generated responses</strong> is crucial to ensure that they are both <strong>accurate</strong> and <strong>relevant</strong>.</p><p>To evaluate RAG-generated responses, we use: <a href="https://docs.ragas.io/en/stable/"><strong>Ragas</strong></a></p><h4><a href="https://docs.ragas.io/en/stable/">RAGAS (Retrieval-Augmented Generation Assessment Score)</a></h4><p>Ragas is a platform designed to evaluate how effectively AI systems, particularly those built on Retrieval-Augmented Generation (RAG), perform their tasks.</p><p>Ragas provides a comprehensive framework for assessing these systems, focusing on key metrics that measure accuracy, relevance, consistency, and more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WaFN5-OR3vmrEVj4.png" /><figcaption>Evaluation with Ragas</figcaption></figure><p>RAGAS offers a suite of metrics to assess various aspects of RAG systems. These metrics are generally scaled between 0 and 1, with higher values indicating better performance.</p><p>RAGAS evaluates AI-generated responses using different types of metrics, which can be categorized into <a href="https://docs.ragas.io/en/stable/concepts/metrics/overview/"><strong>LLM-based metrics</strong></a>, relying on a language model for evaluation, and<a href="https://docs.ragas.io/en/stable/concepts/metrics/overview/"> <strong>non-LLM-based metrics</strong></a>, which use statistical methods. Here’s how these metrics are calculated and applied within the RAG pipeline:</p><p><strong>LLM-Based Metrics</strong> (Require an LLM for evaluation):</p><ul><li><a href="https://docs.ragas.io/en/v0.1.21/concepts/metrics/faithfulness.html"><strong>Faithfulness</strong></a>: Compares the response to the retrieved documents, checking if claims are supported. Computed using an LLM by prompting it to assess factual consistency.</li><li><a href="https://docs.ragas.io/en/v0.1.21/concepts/metrics/answer_relevance.html"><strong>Answer Relevancy</strong>:</a> Evaluates how well the response addresses the user’s query. Measured by prompting an LLM to score response-query alignment.</li><li><a href="https://docs.ragas.io/en/v0.1.21/concepts/metrics/answer_correctness.html"><strong>Answer Correctness</strong></a>: Measures if the response is both factually correct and directly answers the query, considering logical consistency and factual accuracy.</li><li><a href="https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/context_precision/"><strong>Context Precision</strong></a>: Assesses whether retrieved documents contribute useful information to the response. Computed by analyzing how much the response relies on retrieved content.</li></ul><p><strong>Non-LLM-Based Metrics</strong> (Computed with statistical methods):</p><ul><li><a href="https://docs.ragas.io/en/v0.1.21/concepts/metrics/context_recall.html"><strong>Context Recall</strong></a>: Measures how much of the <strong>reference answer</strong> is covered by the retrieved context. A high recall means that most of the relevant information needed for the answer is present in the retrieved documents, it focuses on <strong>completeness.</strong></li><li><a href="https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/traditional/#rouge-score"><strong>ROUGE Score</strong></a>: Evaluates text overlap between the generated response and reference answers, commonly used for measuring recall.</li><li><a href="https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/context_precision/#non-llm-based-context-precision"><strong>Context Precision (non-LLM variant)</strong></a>: Measures how much of the <strong>retrieved context</strong> is actually relevant to answering the query. A high precision means that the retrieved documents contain mostly useful and non-noisy information , it focuses on <strong>relevance.</strong></li></ul><p>RAGAS operates at different levels of the <strong>Retrieval-Augmented Generation (RAG) pipeline</strong>, ensuring that responses generated by the language model are <strong>accurate, relevant, and well-grounded in retrieved knowledge</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SyEthxl8TVVEAiu5" /><figcaption>RAG Pipeline</figcaption></figure><p>Let’s break down each intervention level in more detail:</p><p><strong>1. Pre-Generation: Knowledge Retrieval</strong></p><p>At this stage, RAGAS ensures that the <strong>retrieval process</strong> is effective by assessing whether the system is fetching <strong>high-quality, relevant documents</strong> from the knowledge base. This step is crucial because poor retrieval leads to weak or irrelevant responses, even if the LLM itself is powerful.</p><p><strong>2. During Generation: Context Utilization</strong></p><p>Once the relevant knowledge is retrieved, it is passed to the <strong>language model</strong> to help generate a response. RAGAS ensures that the model <strong>effectively integrates the retrieved information</strong> rather than relying on its internal (and potentially outdated or incorrect) knowledge.</p><p><strong>3. Post-Generation: Evaluation &amp; Scoring</strong></p><p>After the response is generated, RAGAS evaluates it using <strong>various metrics</strong> to determine its <strong>faithfulness (accuracy), relevance, coherence, and completeness</strong>. This is where <strong>LLM-based and non-LLM-based</strong> metrics come into play.</p><p>Now that we have explored the different levels at which RAGAS intervenes in the evaluation process, let’s move on to the practical implementation of evaluating RAG using LangChain , LlamaIndex and RAGAS.</p><h3>Evaluating RAG with LangChain and RAGAS</h3><p>let’s move on to the implementation steps to evaluate a RAG pipeline using LangChain and RAGAS.</p><p>The complete code of the Chatbot of Confluence using LangChain is available on GitHub : <a href="https://github.com/gnomondigital/gd-aca-learning-path-agent">https://github.com/gnomondigital/gd-aca-learning-path-agent</a></p><h4><strong>Step 1: Import Required Libraries</strong></h4><p>Before we begin, we need to install the necessary libraries:</p><pre>pip install langchain ragas datasets rouge-score</pre><p>And then import the required modules in Python:</p><pre>from datasets import Dataset<br><br>from langchain_openai import ChatOpenAI<br>from langchain.prompts import PromptTemplate<br><br>from ragas import evaluate, SingleTurnSample<br>from ragas.metrics import RougeScore, answer_correctness, answer_relevancy</pre><h4>Step 2: Retrieve Relevant Documents</h4><p>Before evaluating, we first retrieve relevant documents using the ChromaDB retriever and generate a summarized reference answer from them, which serves as our ground truth for comparison. (This is just an example, you can also directly provide your own reference answer if available).</p><pre># Assuming ChromaDB is already initialized<br>retriever = chroma.as_retriever()<br>results = retriever.invoke(QUERY, k=5)<br>reference_context = &quot; &quot;.join([doc.page_content for doc in results])<br><br>llm = ChatOpenAI(model=&quot;gpt-4o-mini&quot;)<br><br>template = PromptTemplate(<br>    input_variables=[&quot;context&quot;, &quot;query&quot;],<br>    template=&quot;&quot;&quot;Based on the following retrieved context, <br>    generate a factual and high-quality reference answer.<br>    \n\nContext:\n{context}\n\nQuery:\n{query}\n\nReference Answer:&quot;&quot;&quot;,<br>)<br><br># Generate the reference answer<br>reference_answer = llm.invoke(template.format(context=reference_context, query=query))<br>reference_response = reference_answer.content<br>print(&quot;Reference Response:&quot;, reference_response)</pre><p>Before evaluating the performance of our RAG system, it is crucial to have a reliable reference to compare the generated responses.<br> In this example, we use an LLM model (<strong>GPT-4o-mini</strong>) to generate a <strong>reference response</strong> based on the retrieved context from relevant documents.<br> However, this answer <strong>must be manually validated</strong> before using it as ground truth to avoid biases or errors in the evaluation.</p><h4>Step 3: Structuring the Evaluation Dataset</h4><p>Once we have the retrieved documents and response, we need to format them into a dataset compatible with <strong>Ragas</strong>.</p><pre>## For Answer Correctness and Answer Relevancy<br>data_samples = {<br>    &quot;question&quot;: [query],<br>    &quot;answer&quot;: [response],<br>    &quot;ground_truth&quot;: [reference_answer.content],<br>    # The retrieved reference context<br>}<br><br>dataset = Dataset.from_dict(data_samples)</pre><pre>## For RougeScore metric<br>test_data = SingleTurnSample(<br>    user_input=query,<br>    response=response,<br>    reference=reference_response,<br>    # the reference response taken from the reference context<br>)</pre><h4>Step 4: Evaluate Using Ragas</h4><p>Now that we have our dataset ready, we can use <strong>Ragas</strong> to measure the quality of our model’s response.</p><p>Ragas metrics :</p><blockquote><strong>Answer Relevancy</strong>: Evaluates how well the response aligns with the user’s query.<br><strong>Answer Correctness</strong>: Assesses whether the response is factually accurate based on the retrieved documents.</blockquote><pre># Answer Correctness and Answer Relevancy metrics<br>score = evaluate(dataset, metrics=[answer_correctness, answer_relevancy])<br>score.to_pandas()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OaIEYv37-6FyparBXwX2ZQ.png" /><figcaption>Example of output of answer correctness and answer relevancy</figcaption></figure><p>In this example, the response provided by the system is <strong>both highly accurate and relevant</strong>. The correctness score of <strong>0.9451</strong> shows that the response is <strong>factually aligned</strong> with the reference, while the relevancy score of <strong>0.8826</strong> suggests that the response is <strong>closely related to the query</strong>, though it may contain extra information or formatting differences.</p><blockquote><strong>ROUGE-1</strong>: Measures unigram (single word) overlap.<br><strong>ROUGE-2</strong>: Measures bigram (two-word) overlap.<br><strong>ROUGE-L</strong>: Considers longest matching sequences, capturing fluency and structure.</blockquote><pre>metric1 = RougeScore(rouge_type=&quot;rouge1&quot;)<br>metric2 = RougeScore(rouge_type=&quot;rouge2&quot;)<br>metric3 = RougeScore(rouge_type=&quot;rougeL&quot;)<br><br>score1 = metric1.single_turn_score(test_data)<br>score2 = metric2.single_turn_score(test_data)<br>score3 = metric3.single_turn_score(test_data)<br><br>logging.info(&quot;Rouge 1 metric  RAGAS : %s &quot;, score1)<br>logging.info(&quot;Rouge 2 metric  RAGAS : %s &quot;, score2)<br>logging.info(&quot;Rouge L metric  RAGAS : %s &quot;, score3)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*uxLpTRfeHU7ZUF4IkUVCVA.png" /><figcaption>Example of output of Rouge Score metric</figcaption></figure><ol><li><strong>ROUGE-1 </strong>(66.9% of words match).: The generated text shares a significant portion of common words with the reference, indicating good relevance.</li><li><strong>ROUGE-2 </strong>(49.6% of word pairs match): The ROUGE-2 score suggests that the generated text may not fully capture the phrasing or word order of the reference.</li><li><strong>ROUGE-L </strong>(48.7% of the longest sequence matches): The ROUGE-L score indicates that the generated text partially aligns with the reference in terms of structure but could be improved for better coherence.</li></ol><h3>Evaluating RAG with LlamaIndex and RAGAS</h3><p>Now let’s move on to implementing <strong>response evaluation</strong> using <strong>LlamaIndex</strong> and <strong>RAGAS</strong>.</p><h4>Step 1: Import Required Libraries</h4><p>install the necessary libraries:</p><pre>pip install llamaindex</pre><p>Before evaluating the model’s responses, we need to import the necessary <strong>evaluation metrics</strong>:</p><pre>import pandas as pd<br><br>from ragas import EvaluationDataset<br>from ragas.metrics import (<br>    Faithfulness,<br>    AnswerRelevancy,<br>    ContextPrecision,<br>    ContextRecall,<br>)<br>from ragas.llms import LlamaIndexLLMWrapper<br>from ragas.integrations.llama_index import evaluate<br><br>from llama_index.llms.openai import OpenAI</pre><p>These metrics will allow us to measure different aspects of response quality:</p><ul><li><strong>Faithfulness</strong>: Ensures that the response is factually consistent with the retrieved context.</li><li><strong>Answer Relevancy</strong>: Checks how relevant the response is to the user query.</li><li><strong>Context Precision</strong>: Evaluates how much of the retrieved context is actually useful.</li><li><strong>Context Recall</strong>: Assesses whether all the necessary information from the documents was used.</li></ul><h4>Step 2: <strong>Initializing the LLM Evaluator</strong></h4><p>We need an LLM to help assess the responses. Here, we use <strong>GPT-4o</strong> as the evaluator model:</p><pre>evaluator_llm = LlamaIndexLLMWrapper(OpenAI(model=&quot;gpt-4o&quot;))<br>metrics = [<br>    Faithfulness(llm=evaluator_llm),<br>    AnswerRelevancy(llm=evaluator_llm),<br>    ContextPrecision(llm=evaluator_llm),<br>    ContextRecall(llm=evaluator_llm),<br>]</pre><h4>Step 3: Preparing the Evaluation Dataset</h4><p>To evaluate responses, we need a dataset that contains:</p><ul><li>The user query</li><li>The retrieved context</li><li>The model’s response</li><li>A reference answer (ground truth, Generated using <strong>OpenAI GPT-4o-mini </strong>in this case )</li></ul><p>We define a function to create this dataset dynamically:</p><pre># Initialize LLM for reference answer generation<br>llm = OpenAI(model=&quot;gpt-4o-mini&quot;)<br><br><br>def create_ragas_dataset(query, response):<br>    dataset = []<br>    # Extract retrieved contexts from the response object<br>    retrieved_contexts = [<br>        node.get_content() for node in getattr(response, &quot;source_nodes&quot;, [])<br>    ]<br>    # Generate a reference answer using the LLM<br>    prompt = f&quot;&quot;&quot;Generate a concise, factual, and high-quality reference <br>        answer for the query:\n\nQuery: {query}\n\nReference Answer:&quot;&quot;&quot;<br>    reference_answer = llm.complete(prompt).text<br>    dataset.append(<br>        {<br>            &quot;user_input&quot;: query,<br>            &quot;retrieved_contexts&quot;: retrieved_contexts,<br>            &quot;response&quot;: (<br>                response.response if hasattr(response, &quot;response&quot;) else str(response)<br>            ),<br>            &quot;reference&quot;: reference_answer,<br>        }<br>    )<br>    df = pd.DataFrame(dataset)<br>    return EvaluationDataset.from_pandas(df)</pre><p>We apply the function to create an evaluation dataset from our <strong>query</strong> and <strong>response</strong>:</p><pre># Generate the RAGAS evaluation dataset<br>ragas_dataset = create_ragas_dataset(query, response)<br>print(ragas_dataset)</pre><h4><strong>Step 4: Running the Evaluation with LlamaIndex</strong></h4><p>Finally, we evaluate the responses by integrating <strong>LlamaIndex </strong>with<strong> RAGAS</strong>:</p><pre>result = evaluate(<br>    query_engine=query_engine,<br>    metrics=metrics,<br>    dataset=ragas_dataset,<br>)<br>result.to_pandas()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rcQD9gQ2stVHyX7gXCDO4w.png" /><figcaption>Example of output of Ragas with LLamaIndex</figcaption></figure><ol><li><strong>Faithfulness (1.0): </strong>A score of <strong>1.0</strong> means the response is <strong>fully faithful</strong> and does not introduce hallucinations or misleading information.</li><li><strong>Answer Relevancy (0.9305): </strong>This measures how relevant the response is to the original query. The response is highly relevant but may include minor extra details.</li><li><strong>Context Precision (0.625): </strong>Precision evaluates how much of the retrieved context was <strong>actually useful</strong> for generating the response. In this case some retrieved context was unnecessary for answering the query.</li><li><strong>Context Recall (1.0):</strong> All necessary information was successfully retrieved.</li></ol><h3>Conclusion</h3><h4>Evaluating RAG Pipelines with LangChain, LlamaIndex, and RAGAS</h4><p>In this article, we explored the use of <strong>LangChain</strong> and <strong>LlamaIndex</strong> separately, focusing on how <strong>RAGAS</strong> can be applied to evaluate the performance of retrieval-augmented generation (RAG) systems built using these frameworks. <strong>LangChain</strong> provides a flexible pipeline for integrating retrieval and response generation, while <strong>LlamaIndex</strong> optimizes the indexing and retrieval of documents.</p><p>By leveraging <strong>RAGAS</strong>, we evaluated key metrics like <strong>faithfulness</strong>, <strong>answer relevancy</strong>, <strong>context precision</strong>, and <strong>context recall</strong> to ensure high-quality, relevant, and accurate responses. The use of <strong>RAGAS</strong> with both <strong>LangChain</strong> and <strong>LlamaIndex</strong> provides a robust method for evaluating and improving the effectiveness of RAG pipelines, ensuring that the generated responses meet the desired standards in real-world applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9f277499ab6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gnomondigital/evaluating-rag-applications-with-ragas-in-langchain-and-llamaindex-d9f277499ab6">Evaluating RAG Applications with Ragas in LangChain and LlamaIndex</a> was originally published in <a href="https://medium.com/gnomondigital">Gnomon Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>