<?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 Bizom on Medium]]></title>
        <description><![CDATA[Stories by Bizom on Medium]]></description>
        <link>https://medium.com/@bizom?source=rss-ed8caaa51cbb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6Mxi3tqg2A7POJuXPH1f5g.png</url>
            <title>Stories by Bizom on Medium</title>
            <link>https://medium.com/@bizom?source=rss-ed8caaa51cbb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 05:08:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bizom/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[How We Reduced Developer Time to Fix Bugs!]]></title>
            <link>https://medium.com/@bizom/how-we-reduced-developer-time-to-fix-bugs-b55a7e4faeb2?source=rss-ed8caaa51cbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/b55a7e4faeb2</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[bugs]]></category>
            <dc:creator><![CDATA[Bizom]]></dc:creator>
            <pubDate>Tue, 21 Jul 2026 08:33:13 GMT</pubDate>
            <atom:updated>2026-07-21T08:33:13.971Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>By Rahul Ghosh</em>,</strong> Senior Tech Lead</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*17QJIDKFYdNEZPPd0PdkJg.png" /></figure><p>Bizom uses MySQL as its primary database to support daily operations and meet the needs of its customers. Each day, millions of requests come in, making hundreds of thousands of transactions across the customer base. With the ever-growing list of features and supports, another item grew parallely. Yes, it’s bugs!</p><p>Now, the challenge with bugs is that they need to be reproducible consistently, in order for the developers to fix them permanently. Debugging directly on a production server is generally a big red flag, and for good reason. Like most teams, we follow this best practice strictly and only consider it in rare, justifiable emergencies.</p><p>Bizom has a staging environment, which is a copy of the production environment with sensitive information of the customers masked. This is used by the developers to identify and fix bugs, along with verifying the new feature set that is built. Other teams, like product and sales, use the staging environment for demo purposes. Sometimes the customers themselves use this environment before confirming the go-live.</p><p>In one of the earlier hackathons, one of the teams in Bizom developed a cloning solution, which would leverage the MYSQL dump and import technique, to copy the entire database and apply masking of sensitive data points of the customer. As for the code, the production environment commit would be checked, and the same codebase would be pushed to the staging server for the respective customer.</p><p>Our platform is built on a multi-tenant architecture, a design choice that offers significant benefits in terms of both scalability and security. At present, the total database size has reached around 20TB. The previous solution served us well for the past couple of years, but as the database has grown significantly in size, we’re starting to hit some limitations. Now, to clone the individual schemas to the staging environment, we faced the following challenges:-</p><ol><li>Once our databases grew beyond 100GB per schema, the MySQL dump and import process started to slow down noticeably. This meant developers spent a lot of time waiting for the database to clone before they could dive in and fix bugs!</li><li>Resetting the environment was not possible, so we had to re-clone it from scratch. This was not ideal for quick iterations.</li><li>Custom codes, patches introduced by developers themselves on behalf of the other teams, make it harder for themselves to reproduce and fix bugs.</li><li>The staging environment was actively in use, making it impossible to overwrite without disrupting ongoing activities.</li></ol><p>Bug fixing became a slow process because it took time to reproduce and confirm issues on the staging environment. Until that step was done, developers couldn’t really make progress on resolving them.</p><h3>Approach</h3><p>Looking at this problem, we identified a couple of ways to solve the challenges. Some of them are listed as follows:-</p><ol><li><strong>Optimize the dump and import process</strong>: We currently rely on standard MySQL dump and import techniques. To improve performance, we had planned to optimize this workflow by introducing parallelization during the dump and restore phases.</li><li>Exclude non-essential tables from cloning: Our database contains several large log tables that contribute significantly to storage usage. By implementing a filtering mechanism, we can selectively exclude such tables from the cloning process, reducing both time and resource consumption.</li><li>Clone only a subset of the tables: As an alternative to the previous approach, a filtering mechanism was considered to selectively include specific tables in the cloning process.</li><li><strong>Limit the data set being cloned: </strong>Instead of copying the entire dataset, we aim to implement a delta synchronization approach — transferring only the most recent and relevant data from production to staging. This will significantly reduce the volume of data handled during each sync.</li></ol><p>We focused heavily on these three main strategies, each of which went through several rounds of ideation and refinement.</p><p>Option 4 would be ideally the best choice, but it had many limitations for our system. Some of them being that all the tables would have to have an identifier(id, time-range) in order to effectively copy the data, with the index being present on the identifier alone. This was not present in all the tables, and to apply to all of them would be time consuming. Another challenge involves handling foreign key constraints. For instance, an invoice record may reference an order that lies outside the defined scope of the delta sync, resulting in referential integrity issues during the cloning process. Third, other teams used the same schema in the staging environment for demo purposes. Creating a conflict of data points would hardly be beneficial to our cause. Consistency of data is highly desirable.</p><p>The second and third options also looked good, but require extra maintenance of the filtered table list per schema. A major drawback is handling the foreign key constraints across multiple tables. This would lead the developers to effectively debug the cloning procedure, not the bug that they were supposed to solve. When new tables are added, developers need to ensure this new table is handled accordingly.</p><p><strong>I learnt later on that the above 3 approaches were tried by another team in another hackathon, but they had failed hard!</strong></p><p>Option 1 seems the best choice, and the tool that we wanted to go with is <a href="https://github.com/mydumper/mydumper">MyDumper</a>. One recurring challenge was the continuous growth of data. In the absence of a consistent archival strategy across all tables, core transactional data kept expanding rapidly. As a result, the scalability of this solution was inherently limited — even in the near term. And while it might work for a single customer, applying it across all customers would be unsustainable.</p><h3>Relook at the problem statement</h3><p>The primary goal is to enable safe and efficient debugging in the production environment without compromising data integrity. The key challenge lies in debugging live systems, where unintended writes or overwrites could corrupt critical data — an unacceptable risk for Bizom and its customers.</p><p>To address this, we need a solution that allows developers to inspect and troubleshoot issues in real-time while ensuring that no accidental modifications occur. This requires implementing safeguards that prevent unintended data changes while still providing comprehensive visibility into system behavior.</p><p>Talking to our developers and QA team, we found out the following:-</p><ol><li>The data at the current point in time is not required. Most of the bugs were for data which were a few days/weeks old.</li><li>A precise, unchanged copy of all settings and configurations is necessary.</li><li>Exact production codebase replication was required.</li></ol><p>Given the considerations above, it became evident that a separate environment was needed — one that could be accessed by both developers and the QA team. Since real-time, up-to-the-minute data wasn’t a requirement, designing and implementing this environment became significantly more straightforward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/0*rq4yi1dx6WBCaiZK" /></figure><p>Here’s how:-</p><ol><li>Bizom performs scheduled daily backups of the server and database during off-peak hours.</li><li>Generate a new copy of the server and the database, using the backup that was created from the previous step.</li><li>Link the server and database in step 2 and ensure sensitive data is properly masked before deploying and making it available to the internal team.</li></ol><p>These steps create a new setup, where the developers and QA can safely debug and reproduce the bugs, respectively. These gave the following benefits:-</p><ol><li>Safe debugging of the code, any overwrites of data would only affect the newly created database.</li><li>No overwrites of settings and configurations, as it is exactly the same present in the production environment.</li><li>Creating an entire database server with the snapshot technique is typically faster than copying the largest individual database within it.</li><li>All the customers’ data were provided simultaneously, thereby reducing developers’ requests for a particular clone.</li><li>Developers do not have to wait for days for the data to become available.</li></ol><p>The only trade-off with this solution is the cost. Given the volume of data involved, the monthly expense represents a significant investment for a company of our size. However, we made a strategic decision to move forward, anticipating that it would alleviate a key bottleneck: developer productivity. By enabling faster debugging and issue resolution, we believe the time saved will translate into long-term cost savings for Bizom.</p><h3>Further improvements</h3><p>The initial implementation of this solution was focused solely on the web platform. Subsequent iterations introduced enhancements that improved developer experience and usability. Given the clear benefits, the solution was eventually extended to support mobile applications as well.</p><p>However, cost optimization remained a key concern. We identified an opportunity to reduce expenses further by evaluating the nature of the database usage. Since the database server was being recreated daily and the previous instance purged, the data was inherently temporary, offering no long-term value in persisting it. Additionally, by analyzing developer login patterns, we gained insights into actual usage times, which further informed our optimization strategy.</p><p>A straightforward solution emerged: the new setup would be provisioned only on weekdays (Monday to Friday) and remain inactive over the weekends. Based on observed usage patterns, the setup is automatically torn down at 11:00 PM IST each night and re-initialized the following morning — striking a balance between availability and resource efficiency.</p><p>With this approach, the total cost of the setup is reduced, resulting in savings of nearly 49%. This not only brings significant cost efficiency to the organization but also provides developers with the added benefit of a fresh, dedicated environment for debugging and issue resolution.</p><p>Internal metrics indicate a 20% improvement in the average bug lifecycle turnaround time. Additionally, monthly clone request numbers have decreased by approximately 20–30%, reflecting greater efficiency in issue resolution and workflow management.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b55a7e4faeb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parallel Queries: Solving Our Data Performance Puzzle]]></title>
            <link>https://medium.com/@bizom/parallel-queries-solving-our-data-performance-puzzle-14d7dbcb1ea6?source=rss-ed8caaa51cbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/14d7dbcb1ea6</guid>
            <category><![CDATA[sql-queries]]></category>
            <category><![CDATA[parallel-queries]]></category>
            <category><![CDATA[enginnering]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Bizom]]></dc:creator>
            <pubDate>Tue, 21 Jul 2026 08:29:32 GMT</pubDate>
            <atom:updated>2026-07-21T08:29:32.924Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>By Rahul Ghosh,</strong> Senior Tech Lead</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lLu0N54_tUk9VZSr75DuYQ.png" /></figure><p>We’re excited to share how we recently tackled a significant performance challenge to make a key feature even better for our users.</p><p>Our platform includes a powerful Auto Replenishment System (ARS). This module is a game-changer for inventory management, helping brands effortlessly place orders. It works by analyzing historical sales data, looking back anywhere from 30 days to six months, to provide intelligent, data-driven recommendations. This means our customers can keep their shelves stocked and their businesses running smoothly, all based on smart insights.</p><p>However, as the underlying formulas driving these recommendations grew more sophisticated, we noticed a bottleneck: the time it took to fetch the necessary data started increasing significantly, sometimes exceeding five minutes. While this was understandable, given the massive volumes of transactional data (think orders and sales) that our system handles daily, we knew long wait times weren’t acceptable. Our goal is always to deliver a seamless and efficient experience, especially when clients are making critical ordering decisions.</p><p>Our goal is always to deliver a seamless and efficient experience, so we made it a priority to optimize this process. We’re committed to ensuring our clients get the recommendations they need, precisely when they need them, without any frustrating delays.</p><h3>Unraveling the Performance Mystery</h3><p>We looked into the causes of the delay. After analyzing the situation, we found that the queries were taking too long to execute and load the data. Bizom uses a MySQL database with the InnoDB engine for data storage. We also noticed that indexes were applied to certain columns, particularly those used for filtering data. Given that MySQL is known for its performance with indexes and has a proven track record, we were left wondering why it was taking so much time.</p><p>Our deep dive revealed the culprit. The specific queries in question involved a <strong>composite index</strong> on both a date column and an ID column. These filters were applied in a particular order: first, a <strong>date range</strong> using a BETWEEN clause, followed by a search on an “outlet_id” using an “IN” clause with a <strong>large number of values</strong>.</p><p>This combination effectively translated into a highly inefficient query pattern behind the scenes. Imagine asking the database to do something like this for every single outlet:</p><p><em>WHERE (date BETWEEN “start_date” AND “end_date” AND outlet_id = ‘first_value’) OR (date BETWEEN “start_date” AND “end_date” AND outlet_id = ‘second_value’) OR …</em></p><p>While each individual OR condition could leverage the index, combining a range scan with a massive IN clause across many OR conditions was forcing the database to work much harder than necessary. The MySQL optimizer decided to bypass the index and perform a full table scan, which rendered the indexes ineffective. For smaller IN clauses, the indexes were successfully utilized. This insight was key to devising our solution.</p><h3>Solution: Leveraging Parallelism</h3><p>We’re constantly striving for peak performance, and to that end, we’ve been implementing key optimizations to ensure our system remains fast, responsive, and robust as we continue to grow. Our latest focus has been on refining how our database handles complex queries.</p><p>A crucial insight from our recent work involved the common IN clause, especially when dealing with a large number of values. We discovered that by intelligently splitting the number of values in the IN clause into smaller, more manageable groups, we could dramatically improve query efficiency. This strategy allows the database to more effectively utilize its indexes, leading to significantly faster data retrieval. It’s a prime example of how small, targeted adjustments can lead to substantial performance gains, ensuring a smoother experience for all our users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*BljNYQ2jxRryN6PS" /></figure><p>While we had a promising solution, we quickly hit a roadblock. Our initial approach involved executing data queries sequentially. This meant each new query had to wait for the one before it to finish, and we also incurred overhead from repeatedly establishing database connections.</p><p>Our testing confirmed that this sequential method actually led to a significant performance degradation. In fact, it proved to be even less efficient than some of the less-than-ideal alternatives we had considered, such as using an overly long list of values within a single IN clause. This observation highlighted the critical need for a more concurrent strategy to truly unlock the performance gains we were targeting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*6n7n6VnwC9GDHyNh" /></figure><p>Given that our application is developed in Java, a language with excellent built-in support for concurrent processing, we saw a clear path forward. Our engineering team went to work, not just on the application side but also deeply considering how MySQL would handle these parallel requests.</p><p>Our solution involved restructuring the queries to enable the application to run multiple independent queries concurrently. Instead of one monolithic, slow query, we break it down into smaller, optimized chunks. This allows MySQL to leverage its own internal mechanisms for handling concurrent requests more efficiently.</p><p>Crucially, we also focused on careful tuning of the parallelism limits within our application. Overwhelming the database with too many concurrent queries can be just as detrimental as running them sequentially. Our goal was to find the “sweet spot” — enough parallel execution to significantly speed up data retrieval without causing resource contention or stability issues on the MySQL server itself.</p><p>Upon deploying our latest optimizations to production, we immediately saw significant reductions in data load times.</p><ol><li>For a common data operation, we’ve achieved a remarkable <strong>minimum 75% reduction in loading time</strong>, making a previously lengthy process significantly faster.</li><li>Another critical data load now completes with at least a <strong>50% increase in efficiency</strong>, cutting down the wait time for essential information.</li></ol><p>These improvements mean our users can access the information they need quickly, enhancing their overall productivity.</p><p>Now that’s a major efficiency gain!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14d7dbcb1ea6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reimagining E2E Testing at Bizom: From Manual Scripts to Intelligent RI Agents]]></title>
            <link>https://medium.com/@bizom/reimagining-e2e-testing-at-bizom-from-manual-scripts-to-intelligent-ri-agents-c133900007ba?source=rss-ed8caaa51cbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c133900007ba</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[e2e-testing]]></category>
            <category><![CDATA[playwrights]]></category>
            <dc:creator><![CDATA[Bizom]]></dc:creator>
            <pubDate>Thu, 09 Jul 2026 07:45:49 GMT</pubDate>
            <atom:updated>2026-07-21T06:40:44.343Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>By Santhosh J S,</em></strong><em> Senior Tech Lead</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MJ7r06YrHaClXLDwTFTOiw.png" /></figure><p>Testing is the safety net of any software platform — it’s what gives teams confidence to deploy changes without breaking production. But at Bizom, we realized that traditional E2E testing approaches were no longer sufficient for our fast-paced, complex B2B distribution platform.</p><p>In the world of FMCG and retail distribution, our platform serves multiple user types. Traditional test automation scripts, while helpful, had significant limitations: they were brittle, required constant maintenance, and couldn’t adapt to UI changes without developer intervention.</p><p>We needed E2E testing that could:</p><ul><li><strong>Adapt intelligently</strong> to UI changes <strong>without breaking</strong></li><li><strong>Understand test intent</strong> rather than blindly executing hardcoded steps</li><li><strong>Generate test coverage automatically</strong> for new features</li><li><strong>Self-heal</strong> when minor UI changes occurred</li><li><strong>Provide meaningful insights</strong> beyond pass/fail status</li></ul><p>To solve these challenges, we adopted a hybrid agent-based approach, combining the power of Playwright’s robust testing framework with AI agents that could understand, plan, and execute tests intelligently.</p><h3>Let’s Understand the Approach</h3><h4>The Foundation: Playwright Test Framework</h4><p>We built a solid foundation using Playwright — a modern, reliable browser automation framework. Playwright provides auto-waiting, network interception, multi-browser support, and a built-in test runner.</p><p>However, even with Playwright’s robustness, writing and maintaining tests remained a manual, time-consuming process.</p><h4>Enter AI Agents: From Script Writers to Test Designers</h4><p>We created a three-stage intelligent testing system where specialized AI agents collaborate to plan, generate, and heal tests automatically, powered by large language models (LLMs).</p><ol><li>Planner Agent: Understanding Test Requirements</li></ol><p>The <strong>Planner Agent</strong> understands <em>what</em> needs to be tested. It explores the live application, maps user flows, analyzes different user journeys, and designs comprehensive scenarios, generating structured test plans in markdown. This ensures <strong>semantic coverage</strong> — testing based on intent and user goals.</p><p>2. Generator Agent: Translating Plans to Executable Tests</p><p>The Generator Agent figures out <em>how</em> to test it. This agent:</p><ul><li>Reads the test plan and navigates the actual application UI.</li><li>Takes accessibility snapshots and executes test steps live.</li><li>Generates clean, reusable TypeScript tests using the <strong>Page Object Model</strong>.</li></ul><p>It understands the page semantically, looking for elements by their accessible name or role, making tests far more resilient.</p><p>3. Healer Agent: Self-Healing and Root Cause Analysis</p><p>When tests fail, the Healer Agent steps in. It executes failing tests in debug mode, performs root cause analysis (checking for selector changes, timing issues, etc.), edits test files to address issues, and re-runs tests to validate the fix. The Healer automatically fixes 80% of test failures due to minor UI changes.</p><h3>Handling Real-World Complexity: Context-Aware Testing</h3><p>We ensure E2E tests operate in stateful environments through:</p><ul><li><strong>Authentication fixtures</strong></li><li><strong>Data builders</strong></li><li><strong>Cleanup strategies</strong></li></ul><p>AI agents leverage these fixtures intelligently, understanding when to reuse state versus when to start fresh.</p><h3>Implementation Details: How We Built the Agent System</h3><h4>Model Context Protocol (MCP) for Agent Communication</h4><p>We implemented the Model Context Protocol (MCP) — an open standard for connecting AI models with development tools. MCP acts as a bridge, allowing AI agents to interact with the browser, inspect test results, understand project structure, and generate code following <em>our</em> architectural conventions.</p><h4>Agent Orchestration and Workflow</h4><p>The three agents work in a coordinated workflow:</p><ol><li><strong>Planner Agent</strong> → Generates <strong>Test Plan</strong> (Markdown)</li><li><strong>Generator Agent</strong> → Generates <strong>Tests</strong> (TypeScript)</li><li><strong>Playwright Runner</strong> → Executes Tests</li><li><strong>Healer Agent</strong> (If fails) → <strong>Debugs, Fixes Code, Re-runs</strong></li></ol><h3>Real-World Impact: What We Achieved</h3><p>Our adaptive, intelligent testing system resulted in significant gains:</p><ul><li><strong>10x faster test planning:</strong> Planner agent generates comprehensive test plans in minutes.</li><li><strong>Automated test generation:</strong> Generator agent creates complete test suites.</li><li><strong>Self-healing tests:</strong> Healer agent automatically fixes most UI-related failures.</li><li><strong>100% database validation coverage:</strong> All CRUD operations verify both UI state and database integrity.</li><li><strong>Reduced maintenance burden</strong> by ~70% compared to traditional scripting.</li></ul><h3>Conclusion</h3><p>We built a next-generation E2E testing system by combining Playwright’s robustness with three specialized AI agents. We moved away from treating tests as static artifacts and instead embraced adaptive, intelligent testing.</p><p>The journey from manual test scripting to AI-powered autonomous testing has fundamentally transformed how we approach quality assurance at Bizom. Engineers can focus on building great features, confident that AI agents are continuously ensuring quality.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c133900007ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running production in half and half : CakePHP & Laravel]]></title>
            <link>https://medium.com/@bizom/running-production-in-half-and-half-cakephp-laravel-ee1bbe685878?source=rss-ed8caaa51cbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee1bbe685878</guid>
            <category><![CDATA[cakephp]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Bizom]]></dc:creator>
            <pubDate>Thu, 09 Jul 2026 06:17:34 GMT</pubDate>
            <atom:updated>2026-07-21T06:39:13.054Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>By Shubham Chawala,</em></strong><em> Architect</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pUhcQlSTDXGXtb_KHiO4SA.png" /></figure><p>Upgrading the system, including framework versions and database versions is a critical technical change necessary for ensuring system stability and security. As software evolves, older versions often include deprecated features that are no longer supported. Additionally, each new version introduces enhancements and additional capabilities that can significantly improve performance and scalability.</p><p>Upgradation also addresses vulnerabilities identified in older versions, reducing the risk of exploits and ensuring compliance with modern security standards. Furthermore, newer versions often bring optimization improvements, making the system more efficient, reliable, and prepared to handle increased workloads or complex operations.</p><p>Staying up to date is essential for maintaining compatibility with modern tools, libraries, and integrations, ensuring the system remains robust and future-ready.</p><h3>Upgrading and Migrating Frameworks: CakePHP to Laravel</h3><p>For our system, we are using CakePHP, a PHP framework that has served us well over the years. However, as technology evolves, upgrading becomes inevitable. Initially, we planned to upgrade from CakePHP 2 to a newer version. However, after thorough research and team discussions, we decided to explore migrating to Laravel, which is the most popular php framework.</p><h3>Why Consider Laravel Over CakePHP?</h3><p>While this is out of scope for this article. But to just give gist around it. Laravel stands out because of its robust capabilities, a large and thriving community, and an extensive market skill set. One of the most compelling reasons for considering Laravel is its frequent releases and consistent community support. Unlike CakePHP, which has slower release cycles and a relatively limited community, Laravel’s ecosystem provides the latest features, better documentation, and long-term support that align with modern software development needs.</p><h3>The Challenge: Migrating from CakePHP to Laravel</h3><p>While both CakePHP and Laravel are PHP frameworks, they differ significantly in terms of architecture, configurations, session management, folder structures, and much more. Migrating from CakePHP to Laravel isn’t just about rewriting code; it involves rethinking the way the entire system functions.</p><p>One of the biggest challenges is the scale of our product, Bizom, a feature-rich platform serving over 600+ clients. With new customers going live every month, fulfilling customer requirements, and enhancing the product, we have a large and continuous development pipeline. A complete migration before launching would not only be a monumental task but would also disrupt ongoing development and operations.</p><p>However, in engineering, the word “impossible” simply does not exist. So, how do we achieve this migration? The solution lies in a phased approach — module-based migration.</p><h3>The Approach: Running CakePHP and Laravel in Parallel</h3><p>To execute a module-based migration, we needed to run CakePHP and Laravel frameworks in parallel. This posed two major technical challenges:</p><ol><li><strong>Request Handling</strong>: How to determine which requests should be processed by CakePHP and which by Laravel.</li><li><strong>Session Management</strong>:CakePHP and Laravel use different mechanisms for session management, so a unified approach was essential.</li></ol><h3>Understanding the Infrastructure and Request Flow</h3><p>To address these challenges, we first analyzed how system processes requests:</p><ol><li>A request enters the <strong>load balancer</strong>, which distributes traffic across multiple instances using a configured approach.</li><li>The load balancer forwards the request to underlying instances.</li><li>The server forwards requests through a unified request handler layer, which manages routing internally.</li><li>Within our front-controller, the request object is initialized, processed, and a response is returned to the client.</li></ol><h3>The Two Possible Solutions for Running Frameworks in Parallel</h3><p>We considered two solutions to run CakePHP and Laravel simultaneously:</p><ol><li><strong>Using CURL Calls</strong>:<br>In this approach, whenever a request hits the CakePHP code, it would trigger a CURL call to the Laravel codebase. While this ensures functionality, it introduces an additional network call, significantly increasing latency and impacting performance.</li><li><strong>Routing Logic in front-controller</strong>:The second approach involves implementing logic directly in the front controller logic to decide, at runtime, whether a request should be processed by CakePHP or Laravel. This approach eliminates the need for network calls, making it far more efficient and reducing latency.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*XDLg0P6YaMbeyQ5blZsjbw.png" /></figure><p>We opted for the second solution — routing requests at the front controller<strong> level</strong>. This allows us to run both frameworks in parallel without impacting performance.</p><h3>The Magical Code: Running Two Frameworks in Parallel</h3><p>Here’s pseudo code for how we implemented the logic in front-controller to serve requests efficiently:</p><pre>// Load configuration for Laravel integration<br>configData = parseJson(readFile(&quot;laravelConfigurations.json&quot;))<br>laravelAdapter = new LaravelAdapter(configData)<br>global.adapter = laravelAdapter<br>requestUri = getRequestUri()<br>if (global.adapter.isLaravelModule(requestUri)) {<br>// Delegate to Laravel module entry-point<br>entryPoint = buildPath(&quot;../path_to_laravel&quot;)<br>include(entryPoint)<br>} else {<br>// Proceed with custom or legacy app handling<br>handleCustomApp()<br>}</pre><p>This is how we make a decision about which framework will serve the request based on the api path. To facilitate this, we created a JSON file called laravelConfiguration.json. This file specifies which apis have been migrated to Laravel. Below is the JSON structure:</p><pre>{<br>&quot;enable&quot;: true,<br>&quot;routes&quot;: {<br>&quot;SampleController&quot;: {<br>&quot;SampleAction&quot;: false<br>},<br>&quot;api_path/&quot;: true,<br>},<br>&quot;session&quot;: {<br>&quot;csrfTokenName&quot;: &quot;_token&quot;<br>}<br>}</pre><p>If you look at the JSON, api_path it is under a feature flag. In the configuration, certain modules can be selectively enabled or disabled. If a module is marked as enabled, it will be handled by one system; otherwise, it defaults to being handled by another. This allows for flexible routing between systems based on module-level settings.</p><p>In summary, the router checks whether the module is enabled in the configuration. If it is, the request is redirected to laravel framework. Otherwise, it continues to be served by CakePHP.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee1bbe685878" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimizing ELB Access Log Queries at Bizom]]></title>
            <link>https://medium.com/@bizom/optimizing-elb-access-log-queries-at-bizom-9f9b90a3e6bf?source=rss-ed8caaa51cbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f9b90a3e6bf</guid>
            <category><![CDATA[log-queries]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[logs]]></category>
            <dc:creator><![CDATA[Bizom]]></dc:creator>
            <pubDate>Tue, 07 Jul 2026 07:39:06 GMT</pubDate>
            <atom:updated>2026-07-21T06:37:38.523Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>By Rahul Ghosh,</em></strong><em> Senior Tech Lead</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mu7i6HiclBmXj0Jkd0u_6w.png" /></figure><h3>Introduction: Unlocking the Gold Mine</h3><p><strong>Load Balancer Access Logs</strong> are often described as a gold mine of information. They provide a high-fidelity record of every request, every 5xx error, and every millisecond of latency hitting your infrastructure. At Bizom, the potential of this data was clear, but the reality was frustrating.</p><p>Early in my journey here, my mentor pointed out that our ability to debug and improve the system was directly tied to how well we could navigate these logs. The advice was simple but powerful: <em>Treat Athena not just as a tool, but as a library. If you can master the art of searching it, you unlock a wealth of insights that are otherwise buried in the noise.</em></p><p>However, we soon encountered a significant architectural bottleneck. Querying raw ELB access logs directly in S3 was both performance-prohibitive and cost-inefficient. At Bizom’s scale, processing tens of millions of daily requests, the sheer volume of our logs meant that even simple analytical queries required scanning massive amounts of unoptimized data, creating a drag on our engineering velocity</p><p>The problem wasn’t <strong>Amazon Athena</strong> (AWS’s serverless query service) itself, but the raw, <strong>row-oriented GZIP format</strong> that Application Load Balancers use by default. Even with daily partitioning, fetching just one hour of data was sluggish. Trying to aggregate trends across days or months was practically impossible. Every query felt like digging through a mountain of granite with a hand shovel because Athena had to scan every single byte of text to find a specific record.</p><p>This wasn’t just an inconvenience; it was a long-term blocker for our engineering velocity. We needed a solution that could scale with our growth. We needed to transform our “gold mine” from a dormant, expensive storage bin into a high-speed, cost-effective analytical resource.</p><h3>Moving from Reactive to Predictive</h3><p>Before diving into the architecture, it is important to understand why ELB access logs are the “first point of contact” for every request hitting Bizom.</p><p><strong>What are these logs?</strong></p><p>An <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html">ELB access log</a> captures detailed information about requests sent to your load balancer. A typical raw log looks like this:</p><pre>https 2026-01-12T10:53:26.123456Z <br>app/bizom-load-balancer/50dc6c495c0c9188 192.168.1.1:54321 10.0.0.1:80 0.001 0.320 0.001 200 200 1024 2048 <br>&quot;GET https://api.bizom.com:443/v1/orders HTTP/1.1&quot; &quot;Mozilla/5.0...&quot; <br>ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2</pre><p>To an external observer, this might look like a wall of text. But to an engineer, these fields (<strong>client_ip, target_processing_time, elb_status_code, and request_url</strong>) are the vital signs of the application.</p><p><strong>Predictive vs. Reactive Maintenance</strong></p><p>Historically, we treated these logs <strong>reactively</strong>. When a customer or support team reported an error, we went “hunting” for the specific issue. By transforming this data into a high-speed analytical resource, we shifted our entire engineering culture toward <strong>predictive maintenance</strong>:</p><ul><li><strong>Catching Latency Creep:</strong> We can monitor target_processing_time across all API versions to catch performance degradation before it becomes a bottleneck.</li><li><strong>Error Spiking:</strong> We can set up queries to find 4xx or 5xx trends per User-Agent or Client IP, helping us identify broken app versions or malicious bot activity in real-time.</li></ul><h3>Phase 1: Solving the Slowness (The Athena Win)</h3><p>The primary hurdle was the storage format. ELBs dump raw, GZIP-compressed text logs into S3. Because text is row-oriented, Athena must scan every single byte of a file to locate a specific <em>trace_id or status_code</em>. Searching a single day’s logs resulted in significant latency and high scan costs.</p><p><strong>The Architecture</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/0*0hCNPQ4F08lluSbk" /></figure><p>The following flow describes how we transitioned from raw logs to an optimized analytical layer:</p><p><strong>1. Data Ingress:</strong> ELB writes raw .log.gz files to the S3 Raw Bucket, triggering an ObjectCreated event.</p><p><strong>2. Asynchronous Decoupling:</strong> The event is pushed to <strong>Amazon SQS</strong>. This decouples the bursty log generation from our processing layer, ensuring zero data loss during traffic spikes.</p><p><strong>3. Converter Service (AWS Fargate):</strong> A Spring Boot application polls SQS, downloads the GZIP files, parses them via Regex into POJOs, and aggregates them into <strong>128KB JSON chunks in memory</strong>.</p><p><strong>4. Optimized Ingestion:</strong> The service sends these chunks to <strong>Kinesis Data Firehose</strong> via PutRecordBatch, using surgical retry logic for reliability.</p><p><strong>5. Final Transformation &amp; Storage:</strong> Firehose performs inline conversion to <strong>Apache Parquet</strong> and writes partitioned files to the destination S3 bucket.</p><p><strong>6. Consumption:</strong> Engineers query the Parquet data via <strong>Amazon Athena</strong>.</p><p><strong>Why Fargate and SQS?</strong></p><p>We built a dedicated <strong>Converter Service</strong> to bridge the gap between raw S3 logs and Kinesis Firehose. While AWS Lambda is a common choice for S3 triggers, we opted for <strong>AWS Fargate</strong> for several reasons:</p><ul><li><strong>Execution Limits:</strong> ELB access logs arrive in massive bursts. Lambda’s 15-minute timeout and memory constraints for high-throughput stream processing risked partial executions and “Out of Memory” errors.</li><li><strong>Resource Predictability:</strong> Fargate allowed us to define specific CPU and Memory profiles that could handle the sustained heavy lifting of GZIP decompression and Regex parsing without cold-start penalties.</li><li><strong>Managed Scaling:</strong> By using <strong>SQS</strong> as a buffer, Fargate tasks consume messages at a steady, manageable pace, preventing downstream service exhaustion.</li></ul><p><strong>Why Kinesis Data Firehose?</strong></p><p>We chose Firehose as our delivery stream because it acts as a managed “Swiss Army Knife” for data ingestion:</p><ul><li><strong>Native Format Conversion:</strong> It handles the complex JSON-to-Parquet conversion natively using the AWS Glue Schema Registry, removing the need for us to write and maintain custom Parquet serialization logic in our application code.</li><li><strong>Automated Partitioning:</strong> Firehose manages the S3 prefixing (year/month/day) automatically, ensuring our data lake remains organized and query-efficient.</li><li><strong>Managed Scale &amp; Durability:</strong> As a fully managed service, it scales automatically with our throughput and handles the retries and buffering to S3, allowing our team to focus on the business logic rather than infrastructure plumbing.</li></ul><p><strong>Choosing the Columnar Format: Parquet vs. ORC</strong></p><p>We evaluated both Apache Parquet and ORC for our columnar storage. We ultimately chose Parquet for our stack because:</p><ul><li><strong>Athena Native:</strong> Parquet is the industry standard for Athena, offering superior predicate pushdown and compression.</li><li><strong>Schema Evolution:</strong> Parquet handles schema changes more gracefully, which is critical as ELB access log formats evolve.</li><li><strong>Ecosystem Maturity:</strong> The integration between Firehose and Parquet is highly optimized and battle-tested in the AWS ecosystem.</li></ul><p><strong>Result</strong></p><p>Our metrics spoke for themselves. Query times dropped from <strong>20s to under 2s</strong>, and our scan volume dropped from <strong>8GB to ~200MB</strong> for many queries. We had achieved the speed; however, our billing dashboard soon revealed we had simply shifted our costs to a new bottleneck.</p><h3>Phase 2: Solving the Cost</h3><p>While our Athena bill started reducing, our Kinesis Firehose costs began to climb. After an audit, we found the culprit: <strong>Firehose’s 5KB billing tax</strong>, which was causing us to be billed for nearly 3.5x more data than we were actually sending.</p><p>Firehose rounds every incoming record up to the nearest 5KB for billing. Our average ELB access log is only <strong>1.4KB</strong>. By sending logs one by one, we were paying for 3.6KB of <em>empty air</em> per line, a <strong>3.5x markup.</strong></p><p><strong>The Fix: In-Memory Aggregation</strong></p><p>We refactored our Fargate service to “pack” logs before transmission. Instead of sending one record per log line, we aggregate them into larger chunks.</p><p><strong>Earlier</strong></p><p>Each record was sent to Firehose separately, so even a small record was billed as 5KB</p><pre>{&quot;timestamp&quot;: &quot;2026-01-12...&quot;, &quot;request_id&quot;: &quot;abc-123&quot;, ...}</pre><p><strong>Optimized Approach</strong></p><p>This involved multiple json objects joined by a new line (\n), which is sent as One Firehose record.</p><pre>{&quot;timestamp&quot;: &quot;2026-01-12...&quot;, &quot;request_id&quot;: &quot;abc-1&quot;}\n<br>{&quot;timestamp&quot;: &quot;2026-01-12...&quot;, &quot;request_id&quot;: &quot;abc-2&quot;}\n<br>{&quot;timestamp&quot;: &quot;2026-01-12...&quot;, &quot;request_id&quot;: &quot;abc-3&quot;}\n</pre><p>We implemented an aggregation threshold of <strong>128KB</strong>. This ensures that we consistently exceed the 5KB billing floor, aligning our billed volume with our actual data footprint. Consequently, instead of sending 100 separate logs (which AWS would bill as <strong>500KB</strong> due to rounding), we now transmit a single <strong>128KB</strong> aggregated record. This shift effectively eliminates the ‘padding tax,’ reducing our billed ingestion volume by nearly<strong> 75%</strong> for the same amount of raw data.</p><p><strong>Surgical Retry Logic</strong></p><p>Aggregated records mean higher stakes; if one 128KB chunk fails, we lose nearly 100 log lines. We implemented “surgical” retry logic to handle partial failures (like throttling) without duplicating data that was successfully ingested.</p><pre>// Simplified Surgical Retry Logic<br>public void sendWithRetry(List&lt;Record&gt; batch, int attempt) {<br>    PutRecordBatchRequest request = PutRecordBatchRequest.builder()<br>            .deliveryStreamName(streamName)<br>            .records(batch).build();</pre><pre>    PutRecordBatchResponse response = firehoseClient.putRecordBatch(request);</pre><pre>    if (response.failedPutCount() &gt; 0) {<br>        List&lt;Record&gt; retryBatch = new ArrayList&lt;&gt;();<br>        for (int i = 0; i &lt; response.requestResponses().size(); i++) {<br>            // Only retry records that specifically returned an error code<br>            if (response.requestResponses().get(i).errorCode() != null) {<br>                retryBatch.add(batch.get(i));<br>            }<br>        }<br>        // Exponential backoff before retrying subset<br>        backoff(attempt);<br>        sendWithRetry(retryBatch, attempt + 1);<br>    }<br>}</pre><p><strong>Result</strong></p><p>By implementing record aggregation, we reduced our daily Firehose expenditure by ~75%. This shift effectively eliminated the ‘padding tax’ and aligned our billed volume with our actual data footprint.</p><h3>A Word of Caution: The Cost of Bad Queries</h3><p>While Parquet is a “Gold Mine”, it can quickly become an expensive one if queried incorrectly. Athena charges based on the amount of data scanned ($5.00 per TB).</p><p>Even with a columnar format, a “bad” query can spike costs:</p><ol><li><strong>Avoid SELECT *:</strong> Always specify only the columns you need. Because Parquet is columnar, Athena only reads the files for the columns you name. SELECT * forces Athena to scan the entire dataset, negating the benefits of Parquet.</li><li><strong>Always use Partition Keys:</strong> Never run a query without a WHERE clause on the partition keys (e.g., year, month, day). Without them, Athena performs a full table scan.</li><li><strong>Be Selective with Time Ranges:</strong> If you are debugging a specific incident, filter by time (hours or minutes) in addition to your partition keys. The goal is to be as selective as possible; scanning 10 minutes of logs is significantly cheaper and faster than scanning a full 24 hours.</li><li><strong>Use LIMIT for Previewing:</strong> If you just want to see the data structure or verify your logic, use LIMIT. This allows the engine to stop the scan as soon as it finds enough records to satisfy your request.</li></ol><p><strong>Remember:</strong> Parquet makes queries fast, but query discipline makes them cheap.</p><h3>Engineering References</h3><ul><li><strong>Firehose Billing:</strong> <a href="https://aws.amazon.com/firehose/pricing/">AWS Record Size Rounding</a></li><li><strong>Columnar Benefits:</strong> <a href="https://docs.aws.amazon.com/athena/latest/ug/columnar-storage.html">Optimizing Athena with Parquet</a></li><li><strong>Safety Thresholds:</strong> We capped batches at <strong><em>100 records / 750KB</em></strong> to ensure we stay well under the 4MB Firehose limit while maintaining a safety buffer.</li><li><strong>AWS Fargate Scaling:</strong> <a href="https://www.google.com/search?q=https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-autoscaling.html">Best practices for SQS-based scaling on ECS</a></li></ul><h3>Appendix 1: Performance Benchmarks</h3><p>To quantify the success of this transition, we ran identical analytical queries against both the <strong>Legacy (Raw GZIP)</strong> and <strong>Optimized (Parquet)</strong> datasets.</p><p><strong>Query:</strong> 5xx count for 1 day, taken on hourly basis</p><pre>SELECT SUBSTRING(request_url, 1, 100) as URL______________________________, count(*) as count<br>FROM &lt;database&gt;<br>WHERE year IN (&#39;2026&#39;) AND month IN (&#39;01&#39;) AND day IN (&#39;11&#39;, &#39;12&#39;)<br>AND target_status_code &gt;= &#39;500&#39; AND request_url LIKE &#39;%&#39;<br>AND time between &#39;2026-01-11T18:30:00&#39; AND &#39;2026-01-12T18:29:59&#39;<br>GROUP BY request_url<br>ORDER BY count(*) desc</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*Onw3I1pVTBYMNfqTK2b5cw.png" /></figure><pre>SELECT time,client_ip,target_ip,request_verb,request_url,trace_id,user_agent,target_status_code<br>FROM &lt;database&gt;<br>WHERE year = &#39;2026&#39;<br>AND month = &#39;01&#39;<br>AND (( time &gt;= &#39;2026-01-02T00:00:00)&#39; and time &lt;= &#39;2026-01-12T23:59:59)&#39; ) )<br>And target_status_code &gt;= &#39;500&#39;<br>AND ( request_url LIKE &#39;%customer%&#39; )</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*qpJzzrRtVq_P4DHCOIlwyw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f9b90a3e6bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scaling AI Agents Without Sacrificing Accuracy]]></title>
            <link>https://medium.com/@bizom/scaling-ai-agents-without-sacrificing-accuracy-974fcb4d04f5?source=rss-ed8caaa51cbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/974fcb4d04f5</guid>
            <category><![CDATA[ai-hallucination]]></category>
            <category><![CDATA[vector]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai-accuracy]]></category>
            <dc:creator><![CDATA[Bizom]]></dc:creator>
            <pubDate>Tue, 07 Jul 2026 07:17:36 GMT</pubDate>
            <atom:updated>2026-07-21T06:36:27.885Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>By Samarth Patel,</em></strong><em> Senior Software Engineer</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ec3FSSebcqEvY--DGyR2eA.png" /></figure><p>At Bizom, we’ve deeply integrated AI agents across our products. These agents help users by summarizing information, extracting insights, and responding with context-aware intelligence. To support this, we generate thousands of summaries every single day.</p><p>But as we scaled, a very real problem surfaced: how do we ensure these agents aren’t hallucinating? When an AI confidently produces an incorrect summary, the impact isn’t just a bad user experience. It can mislead users, distort business understanding, and slowly erode trust. We needed a reliable way to continuously evaluate, validate, and keep these summaries in check.</p><h3>Why Hallucinations Happen (and Why They Get Worse at Scale)</h3><p>LLMs are not databases. They do not “look up” information. Instead, they generate responses by predicting the most probable next token based on patterns they have seen during training. As Andrej Karpathy famously describes it, they are essentially a compressed representation of the internet, not a factual source of truth.</p><p>Hallucinations usually creep in when</p><ul><li>the model does not have enough reliable grounding data</li><li>the prompt leaves ambiguity</li><li>the underlying input is noisy or incomplete</li><li>the model is forced to “fill gaps” instead of admitting it does not know</li></ul><p>At a small scale this might feel acceptable or even ignorable. But once you integrate it into the production grade system, even a small hallucination rate becomes a serious reliability problem. A one percent failure rate is no longer harmless. It means dozens of wrong outputs daily, which directly impacts users and business workflows.</p><h3>How Do You Measure “Correctness” ?</h3><p>Once we acknowledged hallucinations as a real risk, the next question sounded deceptively simple: how do we check if a summary is correct?</p><p>Very quickly, we realized there is no straightforward answer.</p><p>Unlike deterministic systems, an LLM by nature is indeterministic and their output does not have a single “golden truth.” The same context can legitimately produce multiple valid summaries depending on phrasing, emphasis, and representation. So a rule-based validation system did not work. Manually reviewing summaries clearly did not scale. Asking another LLM to “judge” correctness introduced new uncertainty because now we were trusting one probabilistic system to evaluate another.</p><p>In short, correctness was subjective, dynamic, and highly contextual. That was the real challenge.</p><p>So instead of trying to define correctness explicitly, we reframed the problem.</p><p>Our agents operate inside well-defined contexts within our product. If ten summaries are generated under the same context, they may differ in wording, but semantically they should broadly say the same thing. If one summary suddenly looks very different from the rest, that is a strong signal that something is off.</p><p>This thought led us to treat hallucination not as a correctness problem, but as an outlier detection problem.</p><h3>Solution: Detecting Hallucinations Using Vector Outliers</h3><p>We start by taking a random sample of the generated summaries from audit logs. These summaries are then transformed into vector representations using embedding models, turning each summary into a point in a high-dimensional space that captures its meaning rather than its exact wording. In this space, summaries originating from the same context should naturally form tight clusters.</p><p>A naïve approach would be pairwise similarity across all logs (N×N), but at our scale this is computationally expensive and impractical.</p><p>Instead, we plot all vectors in space and compute the centroid — representing “expected” behavior for that context.</p><figure><img alt="Vector representation of both the words" src="https://cdn-images-1.medium.com/max/512/0*y9JWhlRk5lVuH-KD" /><figcaption>Vector representation of both the words</figcaption></figure><p>For each summary, we then measure its distance from the centroid.</p><p>If the distance exceeds a defined threshold, we flag it as an outlier. These are highly likely candidates for hallucination or abnormal behavior.</p><p>This approach is:</p><ul><li>scalable (single pass instead of N² comparisons)</li><li>mathematically explainable</li><li>context-preserving</li><li>effective in highlighting truly suspicious summaries</li></ul><h3>Conclusion</h3><p>As AI becomes more deeply integrated into deterministic systems, there’s a growing need for observability platforms to monitor and measure the non-deterministic behavior of models. We highlighted one such approach, introducing observability to detect and control hallucinations, ensuring AI outputs remain reliable and trustworthy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=974fcb4d04f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>