<?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[Call Center Studio - Medium]]></title>
        <description><![CDATA[Insights from the Call Center Studio Team at the intersection of cloud, AI, and customer experience. - Medium]]></description>
        <link>https://medium.com/call-center-studio?source=rss----60847e130fc5---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Call Center Studio - Medium</title>
            <link>https://medium.com/call-center-studio?source=rss----60847e130fc5---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 21:17:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/call-center-studio" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a Daily Customer Churn Risk Scoring System]]></title>
            <link>https://medium.com/call-center-studio/building-a-daily-customer-churn-risk-scoring-system-6777147d0c45?source=rss----60847e130fc5---4</link>
            <guid isPermaLink="false">https://medium.com/p/6777147d0c45</guid>
            <category><![CDATA[xgboost]]></category>
            <category><![CDATA[churn]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[bigquery-ml]]></category>
            <dc:creator><![CDATA[Enes]]></dc:creator>
            <pubDate>Thu, 08 Jan 2026 16:50:15 GMT</pubDate>
            <atom:updated>2026-01-08T16:50:14.339Z</atom:updated>
            <content:encoded><![CDATA[<h3>Abstract</h3><p>Customer churn in B2B SaaS, particularly contact center platforms presents unique challenges compared to consumer applications. Usage patterns are cyclical, multi-dimensional (calls, chats, agent activity…), and a single customer’s behavior can shift dramatically based on business seasonality.</p><p>Critically, we approached churn not as a binary classification problem (“will they churn: yes/no”) but as a <strong>continuous risk signal that evolves over time</strong>. We train on churned versus active examples, but treat the model’s probability output as a ranking signal rather than a hard prediction. A customer isn’t simply “churned” or “safe”; they exist on a spectrum, and their position shifts daily based on behavior. This reframing changes the operational model: instead of predicting a single event, we track trajectory. Action isn’t triggered by crossing a threshold once, but by sustained elevated risk or sudden trajectory changes.</p><p>This article describes the design and deployment of a daily churn scoring system that transforms raw telephony activity into actionable risk signals.</p><h3>The Problem</h3><p>Contact center platforms generate rich behavioral data: call volumes, durations, answer rates, agent utilization. Yet most churn happens silently and usage gradually declines over weeks before contract termination. The challenge isn’t data scarcity; it’s transforming high-frequency operational metrics into a meaningful leading indicator.</p><p>Traditional approaches face two tensions:</p><ol><li><strong>Sensitivity vs. Stability</strong>: A model responsive enough to catch sudden usage drops will also produce noisy scores from normal weekend dips</li><li><strong>Recency vs. Context</strong>: Recent behavior matters most, but without historical context, you can’t distinguish “bad week” from “declining trajectory”</li></ol><h3>Methodology</h3><h3>Data Model</h3><p>The core data grain is <strong>customer-day</strong>: each row represents one tenant’s activity on one calendar day. Source data comes from the platform’s activity tables, capturing:</p><ul><li><strong>Call metrics</strong>: total calls, incoming calls, answered incoming calls, total duration</li><li><strong>Chat metrics</strong>: total chat interactions</li><li><strong>Agent metrics</strong>: number of logged-in agents</li></ul><p>We define <strong>call answer rate</strong> as answered incoming calls divided by total incoming calls. <strong>Agent utilization</strong> wasn’t directly modeled in this iteration but remains a candidate for future features.</p><h3>Feature Engineering Strategy</h3><p>Rather than feeding raw daily metrics directly into a model, we constructed features at two temporal resolutions:</p><p><strong>Short-horizon features</strong> (last 30 days) capture immediate behavior at day-level granularity:</p><ul><li>Total calls, answered calls, chat interactions per day</li><li>Call answer rate per day</li><li>These are pivoted into columns (day_1, day_2, … day_30) to preserve sequence information</li></ul><p><strong>Long-horizon features</strong> (12-month history) provide trajectory context using monthly buckets:</p><ul><li>Each bucket covers ~30 days (0–30, 31–60, 61–90, … up to 331–360 days back)</li><li>Metrics are averaged within each bucket: call volume, duration, answer rate, agent count</li><li>Rolling window averages: 2-month, 3-month, 6-month</li><li><strong>Percentage changes between windows</strong> (e.g., 3-month average vs 2-month average)</li></ul><p>This dual-resolution approach lets the model learn both “what happened recently” and “is this part of a longer pattern.” The percentage-change features proved particularly valuable, they capture acceleration, not just level.</p><h3>Handling the Churned/Active Split</h3><p>A subtle but critical design decision: how do you align time series for customers who churned at different dates?</p><p>We define churn as contract termination or non-renewal as recorded by the sales team. This is distinct from ‘usage churn’ (prolonged inactivity), though in practice, usage decline typically precedes the formal sales record.</p><p>For <strong>churned customers</strong>, ground truth labels come from the sales team’s historical records of churned customers. Because these labels often arrive late (after the customer has already stopped usage), we anchor the feature window to <strong>one week before</strong> the sales-recorded churn date. This intentional shift encourages the model to learn patterns that <em>precede</em> visible churn signals, capturing the trajectory toward churn rather than the aftermath.</p><p>For <strong>active customers</strong>, we anchor to the current date. This prevents data leakage, we never use post-churn silence as a feature.</p><p>To ensure temporal consistency in evaluation, training examples for active accounts are constructed as-of specific historical cut-off dates, not just “as of today.” This avoids the trap where active customer features implicitly contain information about survival that churned customers couldn’t have had at their anchor dates.</p><p>This alignment logic required <strong>four SQL pipeline variants</strong>: churned × short-horizon, churned × long-horizon, active × short-horizon, active × long-horizon. Each variant handles the date anchoring differently, then results are combined into a unified feature set per customer.</p><h3>Model Selection</h3><p>We used XGBoost trained directly in BigQuery ML. The model is technically a classifier (predicting churned vs. active), but we use the <strong>probability output as a continuous score</strong> rather than thresholding to a binary prediction. This gives us a daily risk ranking that can be tracked over time.</p><p>XGBoost offered several advantages for this problem:</p><ul><li><strong>Handles mixed feature types well</strong>: Our feature set combined raw counts, rates, and percentage changes at different scales, gradient boosting handles this heterogeneity without extensive normalization</li><li><strong>Built-in feature importance</strong>: Critical for explaining to customer success teams <em>why</em> a score changed</li><li><strong>Robust to class imbalance</strong>: Churned customers are naturally a minority; tree-based ensembles with proper weighting handle this better than many alternatives</li></ul><p>Training in BigQuery ML specifically enabled SQL-native feature pipelines without data movement, and version-controlled model artifacts alongside query logic.</p><p>The train/test split (80/20) preserved churn rate proportions in both sets via stratified sampling.</p><h3>Infrastructure Evolution</h3><p>The initial deployment used <strong>Apache Airflow (Cloud Composer)</strong> for orchestration, a natural choice given the multi-step SQL dependencies. However, we found this was more infrastructure than our use case required: a single daily batch job with linear dependencies doesn’t need a full DAG scheduler with worker pools.</p><p>We migrated to a simpler architecture: <strong>Cloud Functions triggered by Cloud Scheduler</strong>. For our constraints, this reduced operational costs while maintaining the same daily cadence. The function executes the inference SQL, writes scores to BigQuery, and the Looker Studio dashboard refreshes automatically.</p><p>The lesson for our team: match infrastructure complexity to actual workflow complexity.</p><h3>Findings</h3><h3>Quantitative Outcomes</h3><p>We can’t disclose exact lift metrics, but directionally: in backtesting, customers in the top risk decile showed substantially higher actual churn rates compared to the bottom decile. More importantly, because features are anchored one week before sales-recorded churn, the model learns pre-churn patterns, giving customer success teams lead time to intervene before the formal churn event.</p><h3>The Variance Problem</h3><p>Early iterations revealed a critical issue: <strong>short-horizon feature sensitivity caused score volatility</strong>.</p><p>A customer’s score could swing significantly in a single day based on normal operational variation, weekends, holidays, or simply variable call volumes. While this sensitivity successfully caught customers who suddenly stopped usage entirely, it also generated noise for healthy customers with variable but stable usage patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ssC0CdapE06CezwAsXY-IQ.png" /><figcaption><strong>Example of High Variance in a Day</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_0yM5MIBUtJ_pGYaDSG9lw.png" /><figcaption>Sudden usage stop: all metrics drop to zero on June 7th</figcaption></figure><h3>Interpreting Score Trajectories</h3><p>The dashboard design reflects a key insight: <strong>individual scores matter less than trajectories</strong>.</p><p>A customer hovering at 30% for weeks differs fundamentally from one who jumped from 10% to 30% yesterday. The monitoring approach therefore emphasizes:</p><ul><li>Rolling average of last N predictions (smoothing daily noise)</li><li>Standard deviation as a stability indicator</li><li>Sustained threshold crossings rather than point-in-time alerts</li></ul><p>The dual-view dashboard (daily metrics + monthly aggregates) allows investigating <em>why</em> a score changed. Did call volume drop? Did answer rates decline? This interpretability proved essential for customer success teams taking action on alerts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FGsxinQ95GZuySdId2FKrA.png" /><figcaption>Daily and monthly metrics dashboard: investigating <em>why</em> a score changed</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fiijyiSovYJKF9FvyFkEeA.png" /><figcaption>Sustained elevated risk: score rises from ~25% to 95% over two weeks</figcaption></figure><h3>Lessons Learned</h3><p><strong>Temporal feature engineering is underrated.</strong> The percentage-change features (comparing 3-month to 2-month windows) proved more predictive than raw averages. They capture whether a customer is accelerating toward churn or stabilizing.</p><p><strong>Backtesting requires careful date handling.</strong> We built parallel backtesting queries that shift the observation window backward, allowing evaluation of “would we have caught this churn 30 days before it happened?” Getting the date alignment right between churned and active examples is fiddly but essential for honest evaluation.</p><p><strong>Simpler infrastructure often wins.</strong> For our use case, the Composer → Cloud Functions migration taught us that operational simplicity has compounding value; fewer moving parts means fewer maintenance burdens.</p><h3>Future Directions</h3><p>Two improvements are planned:</p><ol><li><strong>Ensemble for stability</strong>: Training a second model on long-horizon features only (12-month aggregates), then averaging scores with the full model, would reduce daily noise while preserving sensitivity to sudden drops</li><li><strong>Expanded feature set</strong>: Payment behavior (invoice delays, partial payments) and support ticket volume likely contain complementary churn signal not captured by usage alone</li></ol><h3>Conclusion</h3><p>Churn prediction in B2B contexts requires respecting the multi-scale nature of business behavior. Daily operational metrics matter, but only when contextualized by longer-term trajectories. By framing churn as a continuous risk score rather than a binary event, we enabled proactive intervention based on sustained signals rather than a reactive response to point predictions.</p><p>The system described here, deployed in production with daily scoring, demonstrates that SQL-native ML pipelines can deliver actionable insights without complex infrastructure, provided feature engineering captures the right temporal relationships.</p><h3>References</h3><ul><li>BigQuery ML Documentation: <a href="https://cloud.google.com/bigquery/docs/bqml-introduction">https://cloud.google.com/bigquery/docs/bqml-introduction</a></li><li>XGBoost: Chen &amp; Guestrin (2016), “XGBoost: A Scalable Tree Boosting System”: <a href="https://arxiv.org/abs/1603.02754">https://arxiv.org/abs/1603.02754</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6777147d0c45" width="1" height="1" alt=""><hr><p><a href="https://medium.com/call-center-studio/building-a-daily-customer-churn-risk-scoring-system-6777147d0c45">Building a Daily Customer Churn Risk Scoring System</a> was originally published in <a href="https://medium.com/call-center-studio">Call Center Studio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an Internal Helpdesk Chatbot: From Messy Support Data to Production RAG]]></title>
            <link>https://medium.com/call-center-studio/building-an-internal-helpdesk-chatbot-from-messy-support-data-to-production-rag-4a9e5837fb4b?source=rss----60847e130fc5---4</link>
            <guid isPermaLink="false">https://medium.com/p/4a9e5837fb4b</guid>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[customer-support]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Enes]]></dc:creator>
            <pubDate>Thu, 08 Jan 2026 16:50:01 GMT</pubDate>
            <atom:updated>2026-01-08T16:50:00.128Z</atom:updated>
            <content:encoded><![CDATA[<h3>Abstract</h3><p>Customer support teams accumulate years of institutional knowledge, scattered across ticket systems, chat logs, and email threads. This knowledge is invaluable but largely inaccessible: buried in HTML-heavy emails, mixed with signatures and disclaimers, duplicated across forwarded threads.</p><p>We built an internal helpdesk chatbot to surface this knowledge automatically. The system answers questions about our contact center platform, handles routine inquiries, and escalates to human agents when needed, all deployed via WhatsApp for immediate accessibility.</p><p>This article covers the end-to-end journey: extracting knowledge from messy support records, building a retrieval-augmented generation (RAG) pipeline, and deploying a chatbot that handles real user queries. A follow-up article will detail the multi-tenant platform architecture.</p><h3>System at a Glance</h3><ul><li><strong>Data sources</strong>: Zoho tickets, chats, internal documentation, web content, PDFs</li><li><strong>Storage</strong>: PostgreSQL with pgvector, Cloud Storage, Firestore</li><li><strong>Retrieval</strong>: Hybrid search (semantic + keyword), Reciprocal Rank Fusion</li><li><strong>LLM</strong>: Self-hosted LLM on Azure</li><li><strong>Channel</strong>: WhatsApp via Dialogflow</li></ul><h3>The Problem</h3><p>Our helpdesk team answers the same categories of questions repeatedly: How do I configure IVR routing? Why is my agent stuck in “not answering” status? How do I update queue limits? The answers exist, spread across thousands of resolved tickets and chat transcripts, but finding them requires either deep institutional memory or time-consuming searches.</p><p>We wanted a system that could:</p><ol><li>Answer routine configuration and troubleshooting questions instantly</li><li>Know when it <em>doesn’t</em> know, and escalate gracefully to humans</li><li>Learn from our actual support history, not generic documentation</li></ol><h3>Data: The Foundation</h3><h3>Source Diversity</h3><p><strong>Zoho Tickets</strong>: Tens of thousands of email threads with heavy HTML markup, forwarded chains, legal disclaimers, and agent signatures. A single ticket might contain 15+ back-and-forth messages buried under layers of quoted replies.</p><p><strong>Chat History</strong>: Thousands of JSON-structured conversations including bot responses that needed filtering, along with human agent and customer exchanges.</p><p><strong>Internal Documentation</strong>: Product guides, configuration manuals, articles, and troubleshooting documents.</p><p><strong>Web Content</strong>: Scraped pages from internal websites and PDF documentation normalized into a consistent format for ingestion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sMEOjWDVckQQUkQ0N428Ng.png" /><figcaption><strong>End-to-end Pipeline</strong></figcaption></figure><h3>The Cleaning Challenge</h3><p>Raw helpdesk data is surprisingly noisy. A typical email thread contains multiple forwarded message chains, HTML styling artifacts, agent signatures with contact details, legal disclaimers, out-of-office auto-replies, and survey invitation blocks.</p><p>We built a multi-stage cleaning pipeline that progressively strips away noise while preserving the actual support content, handling email chain detection, signature removal, system notification filtering, and marketing boilerplate trimming.</p><h3>From Conversations to Knowledge</h3><p>Raw conversations aren’t directly useful for retrieval. A 15-message thread about queue configuration contains maybe 2–3 sentences of actual knowledge. We needed to extract generalizable Q&amp;A pairs.</p><p><strong>Relevance Filtering</strong>: First, we filtered out noise: marketing emails, out-of-office replies, system notifications, promotional content. This removed roughly half the raw data.</p><p><strong>Semantic Clustering</strong>: We embedded the remaining conversations and clustered them using density-based methods. This grouped similar issues together, all the “agent stuck in status” conversations in one cluster, all the “IVR configuration” requests in another. Clustering at this scale requires significant memory (document count × embedding dimension), so we first bucketed by coarse metadata (ticket category, language), then clustered within buckets to keep the embedding matrix tractable.</p><p><strong>Within-Cluster Deduplication</strong>: Many tickets are near-duplicates (same issue, different customer). We deduplicated within clusters using embedding similarity, keeping representative examples while eliminating redundancy.</p><p><strong>Knowledge Extraction</strong>: Using structured LLM extraction, we converted conversations into Q&amp;A pairs. The extraction was conservative. We only created knowledge entries for genuinely generalizable information, not one-time requests or customer-specific situations. Each entry includes context fields (applicable product version, preconditions) and links back to source tickets for verification. Anything requiring account-specific context is excluded and routed to human agents at query time.</p><h3>Processing Efficiency</h3><p>The entire pipeline, filtering, clustering, deduplication, and LLM extraction, cost a fraction of what manual processing would require, using a self-hosted model for extraction. The bottleneck was memory for clustering, not inference costs.</p><h3>Privacy &amp; Security</h3><p>Working with real support history requires careful data handling:</p><p><strong>PII Redaction</strong>: We aggressively redact common PII (emails, phone numbers, account IDs) and apply NER-based masking for names and organizations. Remaining artifacts are handled via allowlists/denylists and ongoing audits.</p><p><strong>Access Controls</strong>: The platform enforces tenant isolation, each customer environment is logically separated with its own document store. Query access requires authentication, and all interactions are logged for audit.</p><p><strong>Data Residency</strong>: We do not send support corpus documents to third-party LLM APIs; model inference runs in our controlled environment. Channel traffic (WhatsApp/Dialogflow) follows the provider’s standard delivery path.</p><h3>Architecture Overview</h3><p>The chatbot runs on our internal RAG platform, a multi-tenant system built primarily on GCP. The platform handles vector storage (PostgreSQL with pgvector), chat history management (Firestore), and document storage (Cloud Storage).</p><p>LLM inference is served from a self-hosted deployment on Azure for our model and runtime constraints. The platform supports multiple LLM providers, allowing flexibility across tenants. A follow-up article will detail its architecture, including hybrid search implementation, query transformation strategies, and performance tuning.</p><h3>Retrieval Pipeline</h3><p>When a user asks “How do I add a custom status?”, the system:</p><ol><li><strong>Generates multiple query variants</strong> (original question, context-refined rewrite, and a HyDE-style synthetic answer embedding) to improve recall for both short and conversational queries</li><li><strong>Retrieves in parallel</strong> using hybrid search (semantic + keyword)</li><li><strong>Fuses and deduplicates results</strong> across retrievers (RRF + dedupe) to balance semantic and lexical matches</li><li><strong>Generates a response</strong> grounded strictly in the highest-quality retrieved context</li></ol><p>In practice, we apply multiple query transformations in our helpdesk tenant, each treated as one retrieval signal among several. Final selection is determined by fusion and ranking, with escalation triggered when retrieved evidence is weak.</p><p>The retrieval configuration is tenant-specific. For the helpdesk chatbot, we tuned toward precision over recall, better to acknowledge uncertainty than to hallucinate an answer about system configuration. With a large document corpus, answers often require synthesizing information across multiple retrieved chunks. Query transformation strategies and data stores are configurable per tenant, allowing different retrieval behaviors for different use cases.</p><h3>Human Escalation</h3><p>Not every query should be answered by a bot. We implemented LLM-based tool-calling for human escalation, the model decides when to invoke the escalation function based on explicit requests, detected frustration or urgency, complex account issues, and queries outside the knowledge domain. The system routes appropriately rather than attempting answers it can’t reliably provide.</p><h3>Deployment: WhatsApp Integration</h3><p>We deployed the chatbot on WhatsApp for immediate accessibility. Support staff can query the system from their phones without logging into internal tools.</p><p>Typical queries include:</p><ul><li>“How do I update a user’s status?”</li><li>“What’s the process for configuring call routing?”</li><li>“Agent showing ‘not answering’, troubleshooting steps?”</li></ul><p>The WhatsApp integration connects to the platform via Dialogflow, maintaining conversation context across messages.</p><h3>Results</h3><h3>Latency</h3><p>Time-to-first-token on the core RAG service is under 6 seconds. End-to-end delivery in WhatsApp is typically 9–13 seconds depending on answer length, since WhatsApp doesn’t support true token streaming and responses are delivered as discrete messages. We mitigate perceived wait time using typing indicators while the response generates.</p><h3>Quality</h3><p>We validated the system by comparing responses against our previous documentation-only approach. Internal technical support leads reviewed over 200 historical queries sampled across the top ticket categories: troubleshooting, configuration procedures, and edge cases.</p><p>The knowledge-base-grounded approach produced notably better responses across all categories. For troubleshooting queries, the old system offered generic device-level advice like “check microphone settings,” while the new approach provides contextual, platform-specific steps with clear escalation paths. For procedures, incomplete or tangential answers were replaced with step-by-step guidance covering multiple methods. For edge cases, where the old system often returned irrelevant results or nothing at all, the new approach acknowledges complexity and suggests appropriate support contacts.</p><p>Here are representative examples showing the difference:</p><p><strong>Example 1: Campaign Data Question</strong></p><p><em>Query</em>: “There’s a field showing remaining data in the campaign, what causes this?”</p><p><em>Old approach</em>: “Remaining data in campaigns refers to data that hasn’t been called at all. The untouched data count shows the difference from remaining data count.”</p><p><em>New approach</em>: “The remaining data section shows phones that couldn’t be reached or weren’t answered despite reaching the maximum call attempts, as well as calls where agents didn’t enter any result code. You can check this using the campaign calls section in the supervisor screen.”</p><p><strong>Example 2: Backup Trunk Configuration</strong></p><p><em>Query</em>: “We need to configure backup trunk settings, how should we proceed?”</p><p><em>Old approach</em>: “For backup trunk settings, activate ‘Enable Backup Call Plan’ in the Call Rules section. Then select a pre-prepared call plan from the ‘Backup Call Plan’ field.”</p><p><em>New approach</em>: “To configure backup trunk settings, follow these steps: (1) Gather required information: determine necessary IP addresses and trunk details, (2) Create trunk definitions in the system with correct names and settings, (3) Check and update routing settings for the backup trunk, (4) Run test calls to verify the backup trunk works correctly, (5) Document the configurations for future reference.”</p><p>The pattern is consistent: the old approach often surfaced tangential or incomplete information, while the knowledge-base approach provides contextual, actionable guidance drawn from actual resolved support interactions.</p><p>For questions within the knowledge domain (configuration, troubleshooting, procedures), the chatbot provides contextual answers grounded in actual support history. Queries requiring human judgment, complex account issues, edge cases, route appropriately to human agents via the escalation tool.</p><h3>Lessons Learned</h3><p><strong>Data quality dominates model quality.</strong> We spent more time on data cleaning and deduplication than on prompt engineering. The retrieval pipeline can only surface what’s in the knowledge base, garbage in, garbage out.</p><p><strong>Conservative knowledge extraction pays off.</strong> Early iterations extracted too many Q&amp;A pairs, including one-time requests and customer-specific situations. These cluttered retrieval results. Being strict about generalizability improved answer quality significantly.</p><p><strong>Hybrid search outperforms pure semantic search for technical content.</strong> Configuration queries often contain specific terms (queue names, status codes) that semantic search alone misses. Keyword matching catches these; RRF fusion combines both signals effectively.</p><p><strong>Human escalation isn’t a failure mode, it’s a feature.</strong> The bot knowing its limits builds trust. Users prefer “I’ll connect you to an agent” over a confidently wrong answer about system configuration.</p><h3>What’s Next</h3><p><strong>Platform Deep-Dive</strong>: A follow-up article will cover the multi-tenant RAG architecture: hybrid search implementation, query transformation strategies, and other optimizations.</p><p><strong>Expanded Knowledge Sources</strong>: We’re integrating call transcripts and expanding documentation coverage to broaden the bot’s knowledge domain.</p><p><strong>Feedback Loop</strong>: Implementing mechanisms to capture which bot responses were helpful, feeding back into knowledge base refinement.</p><h3>Conclusion</h3><p>Building a helpdesk chatbot isn’t primarily an LLM problem, it’s a data problem. The model is commodity infrastructure; the value comes from turning years of scattered support interactions into accessible, retrievable knowledge.</p><p>The real work is in the data funnel: cleaning messy records, filtering irrelevant content, clustering similar issues, deduplicating redundancy, and extracting generalizable knowledge. With that foundation in place, the RAG pipeline and chatbot deployment become straightforward engineering.</p><p>The system now handles routine queries automatically, freeing human agents for complex issues that genuinely require human judgment, exactly the division of labor that makes sense.</p><h3>References</h3><ol><li>Lewis, P. <em>et al.</em> “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.” <strong>arXiv:2005.11401</strong> (2020). (<a href="https://arxiv.org/abs/2005.11401">arXiv</a>)</li><li>Gao, L., Ma, X., Lin, J., &amp; Callan, J. “Precise Zero-Shot Dense Retrieval without Relevance Labels.” <strong>arXiv:2212.10496</strong> (2022). (<a href="https://arxiv.org/abs/2212.10496">arXiv</a>)</li><li>Cormack, G. V., Clarke, C. L. A., &amp; Büttcher, S. “Reciprocal Rank Fusion outperforms Condorcet and individual Rank Learning Methods.” <strong>SIGIR ’09</strong> (2009). (<a href="https://cormack.uwaterloo.ca/cormacksigir09-rrf.pdf">cormack.uwaterloo.ca</a>)</li><li>pgvector<strong> </strong>“Open-source vector similarity search for Postgres.” (Project documentation / repository). (<a href="https://github.com/pgvector/pgvector">github.com</a>)</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a9e5837fb4b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/call-center-studio/building-an-internal-helpdesk-chatbot-from-messy-support-data-to-production-rag-4a9e5837fb4b">Building an Internal Helpdesk Chatbot: From Messy Support Data to Production RAG</a> was originally published in <a href="https://medium.com/call-center-studio">Call Center Studio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Technical Foundations of a Successful Call Center Migration]]></title>
            <link>https://medium.com/call-center-studio/behind-the-scenes-of-a-successful-call-center-migration-c961e1aed9e1?source=rss----60847e130fc5---4</link>
            <guid isPermaLink="false">https://medium.com/p/c961e1aed9e1</guid>
            <category><![CDATA[customer-service]]></category>
            <category><![CDATA[call-center]]></category>
            <category><![CDATA[cloud-contact-center]]></category>
            <category><![CDATA[customer-experience]]></category>
            <dc:creator><![CDATA[Oğuzhan ŞAHİN]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 07:40:44 GMT</pubDate>
            <atom:updated>2025-12-31T07:40:42.961Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UlPN089bA_ZOJ_KZKnXxSA.jpeg" /></figure><h3>A Systematic Analysis Based on Call Center Studio</h3><h3>Abstract — Problem Definition</h3><p>Modern call centers operate at the intersection of real-time communication, data-driven decision-making, and customer experience management. As customer expectations rise and communication channels diversify, legacy call center infrastructures — often built on monolithic, on-premise systems — struggle to meet requirements such as elasticity, high availability, and seamless integration with CRM, analytics, and AI-driven services.</p><p>Organizations therefore initiate migrations to cloud-native platforms like <strong>Call Center Studio</strong> to address limitations in scalability, maintenance cost, and innovation speed. However, industry data shows that more than <strong>40% of contact center migration projects experience delays or operational disruption</strong>, primarily due to insufficient process design rather than technical incompatibility (Gartner, 2023).</p><p>This article analyzes call center migration not as a simple platform replacement, but as a <strong>socio-technical transformation</strong>. It presents a structured methodology, technical architecture decisions, testing strategies, and post-migration optimization practices used in real Call Center Studio migration projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RrjXGWZi-Ie1OhOluviMBw.jpeg" /></figure><h3>Methodology — Applied Migration Approach</h3><h3>1. Business-Driven System Discovery</h3><p>Before any architectural decision is made, the migration process begins with <strong>operational modeling</strong> rather than infrastructure analysis.</p><p>Key artifacts collected during discovery include:</p><ul><li>Existing call flow diagrams (IVR trees, queue logic)</li><li>Average and peak call volumes (Erlang C–based traffic analysis)</li><li>SLA definitions (ASA, AHT, abandon rate)</li><li>Integration touchpoints (CRM, ticketing, payment, workforce tools)</li></ul><p>This phase prevents a common anti-pattern: <em>rebuilding legacy inefficiencies in a modern platform</em>. Instead, migration becomes an opportunity for <strong>process refactoring</strong>.</p><h3>2. Migration as a Controlled Engineering Project</h3><p>Call center migration is treated as a <strong>multi-phase engineering project</strong>, not a cutover task.</p><p>Typical phases include:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JjrR_Wekp-LMzuEVFED-AA.png" /></figure><p>Risk mitigation strategies — such as dual routing, soft launches, and rollback plans — are defined early to ensure operational continuity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*F30eUXPFRB4uQo_6pqjdfg.png" /></figure><h3>3. Cloud-Native Architecture Design</h3><p>Call Center Studio migrations are built on <strong>cloud-native, event-driven architectures</strong>. Core principles include:</p><ul><li>Stateless call routing services</li><li>API-based integrations</li><li>Horizontal scalability</li><li>Regional redundancy</li></ul><p>A simplified architecture includes:</p><p>A simplified architecture includes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*p_VR5hWL6IZgChN1Gqad4A.png" /></figure><p>This design enables:</p><ul><li>Dynamic load distribution during peak hours</li><li>Independent scaling of IVR, routing, and agent services</li><li>Faster deployment cycles for new features</li></ul><h3>4. Realistic Testing with Production-Level Scenarios</h3><p>Testing is one of the most underestimated migration stages. In Call Center Studio projects, testing goes beyond functional validation.</p><h4>Test categories include:</h4><ul><li><strong>Load testing:</strong> Simulating peak concurrency (e.g., Black Friday traffic)</li><li><strong>Failure testing:</strong> SIP drops, agent disconnects, network latency</li><li><strong>Behavioral testing:</strong> Agent status transitions, wrap-up timing</li><li><strong>Integration testing:</strong> CRM sync delays, API rate limits</li></ul><p>Example load-testing logic:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*qi434m1CNTNpMRvup6hG2A.png" /></figure><p>These simulations reveal bottlenecks before customers experience them.</p><h3>Findings &amp; Practical Implementation</h3><h3>1. User Adoption as a System Variable</h3><p>Migration success correlates strongly with <strong>agent and supervisor adoption</strong>. Data from multiple projects shows:</p><ul><li>Clear onboarding reduces average handling time (AHT) by <strong>12–18%</strong></li><li>Early feedback loops lower post–go-live incident volume by <strong>30%</strong></li></ul><p>As a result, migration plans include:</p><ul><li>Role-based UI configurations</li><li>Scenario-based training (not feature walkthroughs)</li><li>Real-time support during early production days</li></ul><h3>2. Post Go-Live Optimization Through Data</h3><p>Go-live is treated as the beginning of <strong>observability-driven improvement</strong>.</p><p>Metrics continuously monitored include:</p><ul><li>Queue distribution efficiency</li><li>Call drop rate</li><li>Agent occupancy</li><li>IVR exit points</li></ul><p><strong>Example insight:</strong></p><p>Analysis showed that 22% of callers abandoned at the third IVR layer. Simplifying the menu reduced abandonment by 9% within two weeks.</p><p>This feedback loop transforms the platform into a <strong>living system</strong>, not a static tool.</p><h3>Conclusion — Industry Implications</h3><p>A successful call center migration is not defined by system activation, but by <strong>measurable operational improvement</strong>.</p><p>Based on Call Center Studio migration experiences, key industry conclusions are:</p><ol><li>Migration is primarily an <strong>organizational and process challenge</strong>, not a technical one.</li><li>Cloud-native architectures enable resilience, but only if paired with proper design.</li><li>Testing with real-world scenarios is critical to customer experience protection.</li><li>Continuous optimization delivers long-term ROI beyond initial migration goals.</li></ol><p>As call centers evolve into intelligent customer engagement hubs, migration strategies must mature from “system replacement” to <strong>strategic platform transformation</strong>.</p><h3>References</h3><ol><li>Gartner. <em>Market Guide for Contact Center as a Service</em>, 2023.</li><li>Cisco Systems. <em>Cloud Contact Center Design Guide</em>, 2022.</li><li>ITU-T Recommendation E.600 — <em>Traffic Engineering for Telecommunication Networks</em>.</li><li>Amazon Web Services. <em>Well-Architected Framework — Reliability Pillar</em>.</li><li>McKinsey &amp; Company. <em>The Future of Customer Care</em>, 2021.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c961e1aed9e1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/call-center-studio/behind-the-scenes-of-a-successful-call-center-migration-c961e1aed9e1">The Technical Foundations of a Successful Call Center Migration</a> was originally published in <a href="https://medium.com/call-center-studio">Call Center Studio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Media Queries: Building Container-Aware Dynamic Overflow Systems with ResizeObserver]]></title>
            <link>https://medium.com/call-center-studio/beyond-media-queries-building-container-aware-dynamic-overflow-systems-with-resizeobserver-e270353e1501?source=rss----60847e130fc5---4</link>
            <guid isPermaLink="false">https://medium.com/p/e270353e1501</guid>
            <dc:creator><![CDATA[Doğancan Ülgü]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 07:39:01 GMT</pubDate>
            <atom:updated>2025-12-31T07:39:00.314Z</atom:updated>
            <content:encoded><![CDATA[<h3>Abstract</h3><p>In the landscape of modern dashboard design, UI components are increasingly modular. Layouts featuring collapsible sidebars, multi-pane split views, and dynamic widgets have rendered traditional CSS Media Queries insufficient. This article explores the engineering challenges of “Container-Aware” responsiveness. Specifically, we detail a robust implementation of a dynamic overflow management system using the <strong>ResizeObserver API</strong> in React. We move beyond simple “What is ResizeObserver?” to a deep architectural analysis of dual-rendering strategies, width caching, and direct DOM manipulation for performance optimization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jKhNoA0n-vipwkBH9oYn0g.png" /></figure><h3>1. The Problem: The “Viewport-Dependency” Trap</h3><h3>1.1 The Failure of Media Queries</h3><p>Standard responsive design relies on the Viewport (the browser window size). However, a component’s available space is often determined by its parent container, not the window.</p><p>Consider a dynamic width component. If a user expands a navigation sidebar from 60px to 250px, the Filter Bar’s available width shrinks, even though the viewport remains unchanged. CSS Media Queries cannot detect this change.</p><h3>1.2 The Dynamic Content Variable</h3><p>Unlike static navigation links, filter elements (Date Pickers, Multi-selects, Search inputs) have variable widths. A “Status” filter might be 100px, while a “Date Range” filter is 240px. Hard-coding breakpoints (e.g., max-width: 1200px) leads to &quot;brittle UI&quot;—where adding a single new filter requires manual adjustment of CSS breakpoints across the entire application.</p><h3>1.3 Theoretical Requirements</h3><p>To solve this, we require a system that:</p><ol><li><strong>Observes</strong> the parent container’s width in real-time.</li><li><strong>Calculates</strong> the sum of child element widths dynamically.</li><li><strong>Transfers</strong> overflowing elements to a secondary “More” menu without losing their internal state (e.g., selected values).</li></ol><h3>2. Methodology: Why ResizeObserver?</h3><p>Historically, developers used the window.onresize event, but this only fires when the browser window changes. Modern alternatives include:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MSFPZzvxwyTdBK5kwGBm1w.png" /></figure><p><strong>The ResizeObserver API</strong> is the optimal choice because it provides a performant way to observe changes to an element’s content box. It avoids the “layout thrashing” typically associated with manual getBoundingClientRect() calls inside a scroll or resize listener.</p><h3>3. Implementation: The Dual-Rendering Architecture</h3><p>To ensure a seamless user experience, we implement a <strong>Dual-Rendering Stratey</strong>. Every child element is rendered in two locations: the “Main Row” and the “Overflow Menu.”. Therefore, calculation and style creation can be easily applied.</p><h3>3.1 Dual Rendering</h3><pre>&lt;div id=&quot;container-{customId}&quot;&gt;<br>  &lt;!-- Ana satır elemanları --&gt;<br>  &lt;div id=&quot;filter-{customId}-0&quot;&gt;{child[0]}&lt;/div&gt;<br>  &lt;div id=&quot;filter-{customId}-1&quot;&gt;{child[1]}&lt;/div&gt;<br>  &lt;div id=&quot;filter-{customId}-2&quot;&gt;{child[2]}&lt;/div&gt;<br>  ...<br>  <br>  &lt;!-- Overflow Menu --&gt;<br>  &lt;!-- N unvisible box count --&gt;<br>  &lt;div id=&quot;menu-{customId}&quot; class=&quot;dropdown&quot;&gt;<br>    &lt;button&gt;Filter / +N&lt;/button&gt; <br>    &lt;nav&gt;<br>      &lt;div id=&quot;menu-filter-{customId}-0&quot;&gt;{child[0]}&lt;/div&gt;<br>      &lt;div id=&quot;menu-filter-{customId}-1&quot;&gt;{child[1]}&lt;/div&gt;<br>      &lt;div id=&quot;menu-filter-{customId}-2&quot;&gt;{child[2]}&lt;/div&gt;<br>      ...<br>    &lt;/nav&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><h3>3.2 Establishing the Observer</h3><p>We utilize a single ResizeObserver instance to manage the entire component. This reduces memory overhead compared to attaching individual observers to every child.</p><pre>expport const FilterContainer = (children) =&gt; {<br>  const [isHiddenMenuButton, setIsHiddenMenuButton] = useState(false);<br>  const [visibleCount, setVisibleCount] = useState(0);<br>  const filterCache = useRef({});<br>  <br>  useEffect(() =&gt; {<br>    const observer = new ResizeObserver((entries) =&gt; {<br>      <br>      calculateElementWidth(); // set width to filterCache<br>      <br>      calculateVisibility(entries);<br>    });<br><br>    // container, children<br>    observer.observe(document.getElementById(containerId);<br>    const childrenIds = children.forEach((_,i) =&gt; {<br>      observer.observe(document.getElementById(childrenId);<br>    }<br>    return () =&gt; observer.disconnect();<br>  }, []);<br>};</pre><h3>4. The Visibility Calculation Algorithm</h3><p>The heart of this system is the visibility algorithm. It must account for three variables: <strong>Container Width</strong>, <strong>Item Widths</strong>, and <strong>The Overflow Button Width</strong>.</p><h3>4.1 Accumulative Width Logic</h3><p>The algorithm iterates through the cached widths and checks if the cumulative sum (including gaps/margins) exceeds the container width.</p><h3>4.2 Handling the “Last Element” Edge Case</h3><p>If n elements fit perfectly and there are no elements left, the Menu Button should not be displayed. Otherwise, the width of the button that opens the menu is added to the calculation.</p><pre>const calculateVisibility = () =&gt; {<br><br>  // Pseudocode for the Visibility Loop<br>  let accumulatedWidth = INITIAL_PADDING;<br>  let count = 0;<br>  <br>  for (const [id, width] of Object.entries(filterCache)) {<br>    const isLast = index === totalItems - 1;<br>    const currentTotal = accumulatedWidth + width + (index * gap);<br>    <br>    if (isLast &amp;&amp; currentTotal &lt;= containerWidth) {<br>      // Everything fits!<br>      showInMainRow(id);<br>      hideMenuButton();<br>    } else if (currentTotal + menuButtonWidth &lt;= containerWidth) {<br>      // Fits with room for the &quot;More&quot; button<br>      showInMainRow(id);<br>      count++; // visible count<br>      accumulatedWidth += width;<br>    } else {<br>      // Overflow detected<br>      hideInMainRow(id);<br>    }<br>  }<br>}</pre><h3>5. Usages and UI Examples</h3><h3>5.1 Usages</h3><p>The primary design goal of this architecture is to provide a “plug-and-play” experience for developers. The <strong>FilterContainer</strong> serves as the central engine, abstracting all the complexities of the ResizeObserver API, width caching, and DOM-level visibility toggling.</p><p>As a developer, you don’t need to manually calculate breakpoints or track state. You simply wrap the elements you want to be responsive inside the FilterContainer, and the system handles the rest.</p><pre>&lt;FilterContainer id=&quot;{customId}&quot;&gt; // To avoid conflicts in multiple uses<br>  &lt;Filter title=&quot;Agents&quot; ... /&gt; // Any HTML element can be used<br>  &lt;Filter title=&quot;Queues&quot; ... /&gt;<br>  &lt;Filter title=&quot;Teams&quot; ... /&gt;<br>  &lt;Filter title=&quot;Statuses&quot; ... /&gt;<br>  &lt;Filter title=&quot;Alerts&quot; ... /&gt;<br>&lt;/FilterContainer&gt;</pre><h3>5.2 UI Examples</h3><p><strong>Scenario A: Sufficient Space</strong> When the container is wide enough, every filter is rendered in the main row. There is no need for an overflow menu, and the layout remains horizontal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GTyNDZxCvnR6ra5XZpZbpQ.png" /><figcaption>Everything Fits!</figcaption></figure><p><strong>Scenario B:</strong> <strong>The Overflow </strong>Trigger As the container narrows — perhaps because the user opened a sidebar — the space becomes insufficient. If we let CSS handle this, items would either wrap to a new line (breaking the header height) or disappear (losing functionality). Instead, the system detects the collision and injects an overflow button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1B7xVbBeZU3ePFRfT6LIgA.png" /><figcaption>Visible More Button If not fits!</figcaption></figure><p><strong>Scenario C: Interaction and Accessibility</strong> When the user clicks the overflow button, the “hidden” components must be accessible. These are not just static links; they are active React components that must maintain their state (selected values, focus, etc.) even when moved into a vertical dropdown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oSNGVdIqzUWhVHCd_Q8HJA.png" /><figcaption>Unvisible Box are grouped in Menu</figcaption></figure><h3>6. Engineering for Performance</h3><p>A major concern with JavaScript-based layout is <strong>jank</strong> (visual stutter). We mitigate this via three specific optimizations:</p><h3>6.1 Direct DOM Manipulation</h3><p>Updating React state on every pixel of a resize operation can trigger expensive re-renders of the entire filter tree. Instead, we use refs to manipulate the display style property directly.</p><pre>const changeDisplay = (id, mode) =&gt; {<br>  const el = document.getElementById(id);<br>  if (el) el.style.display = mode;<br>};</pre><p><em>Note: We only sync the “Count” back to React state once the loop is finished to update the “+N” badge.</em></p><h3>6.2 The ResizeObserver Batch</h3><p>The ResizeObserver callback provides an array of entries. If multiple elements resize simultaneously (e.g., a window maximize), they are processed in a single batch, preventing redundant calculation cycles.</p><h3>6.3 Width Caching</h3><p>By storing widths in a useRef object (filterWidthCache), we avoid recalculating offsetWidth (which triggers layout reflow) during the logic phase. We only update the cache when the observer detects a specific change.</p><h3>7. Conclusion</h3><p>As web applications move toward highly modular, dashboard-centric layouts, the Viewport-centric model of responsiveness is becoming an anti-pattern. The ResizeObserver API provides the necessary primitives to build &quot;Smart Components&quot; that understand their own spatial constraints. By combining direct DOM manipulation for performance with a dual-rendering strategy for state persistence, we can create complex UI patterns like Dynamic Overflow Menus that are both robust and performant.</p><p>Here is the article to learn detail of <a href="https://medium.com/@dogancanulgu/52e4b3d49dbd">Filter</a>.</p><h3>References</h3><ul><li><strong>MDN Web Docs.</strong> (2024). <em>ResizeObserver API</em>. <a href="https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver">https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver</a></li><li><strong>W3C Specification.</strong> (2023). <em>Resize Observer</em>. Editor’s Draft. <a href="https://www.w3.org/TR/resize-observer/">https://www.w3.org/TR/resize-observer/</a></li><li><strong>Google Developers.</strong> (2020). <em>ResizeObserver: It’s like document.onresize for Elements</em>. <a href="https://web.dev/resize-observer/">https://web.dev/resize-observer/</a></li><li><strong>React Documentation.</strong> (2024). <em>Manipulating the DOM with Refs</em>. <a href="https://react.dev/learn/manipulating-the-dom-with-refs">https://react.dev/learn/manipulating-the-dom-with-refs</a></li><li><strong>Can I Use.</strong> (2025). <em>Browser Support for ResizeObserver</em>. <a href="https://caniuse.com/resizeobserver">https://caniuse.com/resizeobserver</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e270353e1501" width="1" height="1" alt=""><hr><p><a href="https://medium.com/call-center-studio/beyond-media-queries-building-container-aware-dynamic-overflow-systems-with-resizeobserver-e270353e1501">Beyond Media Queries: Building Container-Aware Dynamic Overflow Systems with ResizeObserver</a> was originally published in <a href="https://medium.com/call-center-studio">Call Center Studio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Chaos to Order: Engineering a Unified Frontend Filtering Architecture]]></title>
            <link>https://medium.com/call-center-studio/from-chaos-to-order-engineering-a-unified-frontend-filtering-architecture-52e4b3d49dbd?source=rss----60847e130fc5---4</link>
            <guid isPermaLink="false">https://medium.com/p/52e4b3d49dbd</guid>
            <dc:creator><![CDATA[Doğancan Ülgü]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 07:38:49 GMT</pubDate>
            <atom:updated>2025-12-31T07:38:48.769Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Abstract: Defining the Problem Space</h3><p>In the landscape of modern enterprise web applications — particularly data-intensive dashboards like Call Center Management Systems filters are the primary gateway to information. However, as an application scales, what begins as a simple dropdown menu often evolves into a fragmented ecosystem of date pickers, multi-select components, and dynamic search bars, each managed by disparate state logic.</p><p>In a typical large-scale project, developers often face “Filter Fatigue.” For instance, one page requires a multi-select for “Agent Lists,” while another needs a complex “Date Range + Call Type” combination. Using traditional methods (individual state management per page) leads to several critical bottlenecks:</p><ul><li><strong>Code Redundancy:</strong> Re-implementing “Select All,” “Clear All,” and “Search Debouncing” logic across dozens of views.</li><li><strong>Performance Degradation:</strong> Attempting to render 5,000+ items in a standard HTML select or unoptimized library component causes significant DOM bloat, leading to frame drops and browser lag.</li><li><strong>Contract Inconsistency:</strong> Backend APIs often receive varying data formats for essentially the same filtering intent, complicating the networking layer.</li></ul><p>This article explores how we moved from this chaotic fragmentation to a <strong>Unified Filter Architecture</strong>. We designed a polymorphic, virtualized, and state-aware filter component that handles thousands of data points with sub-millisecond responsiveness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MiCshDkVeFNmKiuiHco7Eg.png" /></figure><h3>2. Methodology: The “Single Component, Infinite Capabilities” Approach</h3><p>Our solution is built on two pillars: <strong>Data Standardization</strong> and <strong>Polymorphic UI</strong>. By decoupling the UI representation from the underlying data logic, we created a system where the component adapts its behavior based on a configuration object rather than hard-coded logic.</p><h3>2.1 The Unified Options Model (Universal Interface)</h3><p>The most critical decision was defining a strict interface for filter data. Regardless of whether the data source is a list of employees, a set of dates, or a category tree, the component consumes a standardized FilterOption array.</p><pre>interface FilterOption {<br>  id: string | number;         // Unique identifier for the backend<br>  label: string;               // Display text for the UI<br>  checked: boolean;            // Selection state<br>  disabled?: boolean;          // Interaction state<br>  inputValue?: string;         // For input-based conditional filters<br>  parent?: string | number;    // For hierarchical structures<br>}</pre><p><strong>Why this matters:</strong></p><ul><li><strong>Uniform Data Flow:</strong> The parent component no longer cares if it’s handling a DateRange or a MultiSelect. It always receives an array of objects following this contract.</li><li><strong>Transformation Layer:</strong> When a user selects a date, the internal logic transforms that date into an id (ISO string) and a label (formatted string), keeping the outward-facing API consistent.</li></ul><h3>2.2 Computational Performance via Virtualization</h3><p>Rendering 10,000 agents in a dropdown is a “death by a thousand cuts” for the DOM. Each node consumes memory and increases the cost of the recalculation tree.</p><p>We integrated <strong>List Virtualization</strong> using the react-window principle. Instead of rendering all items, we render only visible items plus a small buffer.</p><p><strong>The Math of Virtualization:</strong></p><ul><li><strong>Traditional:</strong> 5000 data = 5000 DOM Nodes = High memory overhead.</li><li><strong>Virtualized:</strong> 5000 data still result but only ~10 DOM elements (visible).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WmO2wIw6OUxQCx0n3MjYKw.png" /></figure><p>This ensures that the “Search” and “Filter” operations remain fluid. Even as a user types into a search bar, the filtering happens in the JavaScript memory (fast), and the virtualized list simply updates the <em>window</em> of visible items.</p><h3>2.3 Advanced State Management Strategies</h3><p>A common UX pitfall is choosing between “Instant Update” and “Batch Update.” Our architecture supports both via a configuration-driven approach:</p><ul><li><strong>Immediate Dispatch (</strong><strong>isUpdateEveryChange):</strong> Every change of selection triggers update function. Ideal for small datasets where instant feedback is required.</li><li><strong>Deferred Dispatch (</strong><strong>closeMenuEveryDataChange: false):</strong> Users can select multiple items, perform searches, and toggle &quot;Select All&quot; within the menu. The update only triggers when the menu is closed. This significantly reduces unnecessary network traffic (API debouncing).</li></ul><h3>3. Findings and Implementation: The “Build vs. Buy” Argument</h3><h3>Why Custom Architecture over Ready-made Libraries?</h3><p>While libraries like <em>Material UI (MUI)</em> or <em>Ant Design</em> offer robust components, they often lack the “Business Logic Layer” required for complex enterprise workflows.</p><ul><li><strong>Business Specific Logic:</strong> We needed specific features like “Hide Inactive Employees,” which is a toggle <em>inside</em> the filter menu that changes the data source dynamically. Implementing this in a third-party library often requires “hacking” the internal state.</li><li><strong>Algorithmic Control:</strong> We implemented a custom selectAllBySearch logic. In standard libraries, &quot;Select All&quot; usually selects every item in the dataset. In our architecture, if a user searches for &quot;John,&quot; the &quot;Select All&quot; button contextually changes to select only the filtered &quot;Johns,&quot; preventing accidental bulk selections.</li><li><strong>Integration with </strong><strong>getData:</strong> We built an asynchronous server side search mechanism. The component can trigger a getData prop, fetching remote results and merging them into the existing state seamlessly.</li></ul><h3>Quantifiable Gains</h3><p>After deploying this architecture across our platform:</p><ul><li><strong>Development Velocity:</strong> Creating a new report page with 5 complex filters dropped from 2 days of work to 30 minutes. Developers now only write JSON configurations.</li><li><strong>Bundle Optimization:</strong> By centralizing the logic, we reduced the redundant code previously spread across 100+ pages.</li><li><strong>UI Consistency:</strong> Every filter across the application now shares the same keyboard navigation patterns (Enter to select, Esc to close) and accessibility (ARIA) labels.</li></ul><h3>4. Visualizing the Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IqleWRmwYzMtKCUw33v8WQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AZHoxVqswstH3MFtPvef_Q.png" /><figcaption>Magic of FilterContainer</figcaption></figure><p>To illustrate the simplicity of the architecture, consider the implementation of an “Agent” filter within a reporting dashboard. Instead of manually managing state, search logic, and DOM optimization, a developer simply provides a configuration object:</p><pre>&lt;FilterContainer&gt;<br>  &lt;Filter<br>    multiSelect<br>    isUpdateEveryChange<br>    options={<br>      [<br>        { id: &quot;john_key&quot;, label: &quot;John Doe&quot;, checked: false },<br>        { id: &quot;jane_key&quot;, label: &quot;Jane Smith&quot;, checked: false, disabled: true },<br>        { id: &quot;michael_key&quot;, label: &quot;Michael Brown&quot;, checked: true },<br>      ]<br>    }<br>    update={updateAgentFunc}<br>    title={strings.agents}<br>    icon=&quot;agent&quot;<br>  /&gt;<br>  &lt;Filter ... /&gt;<br>  ...<br>&lt;/FilterContainer&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Of_wSaYnZNkrFBTtkI2gVQ.png" /></figure><p>The following visualization illustrates the diverse range of filter types — ranging from date pickers to search-driven single-selects — all powered by our unified polymorphic architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*6uVIE1iJJi1wUZFmqPRTrw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*qmNcbBnASMt79XkkYArzGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*-0v4Jav-4Wr4lgQPS0z9dg.png" /><figcaption>Single — Date — Input Select</figcaption></figure><h3>5. Conclusion: Industry Implications</h3><p>The transition from a standard web application to a high-density data platform is not merely a matter of scaling features, but a challenge of managing complexity. As we have seen, the “Unified Filtering Architecture” was not an accidental discovery but the result of a proactive engineering strategy. By pre-identifying the inevitable complexities of data volume, diverse user requirements, and UI consistency, we were able to architect a solution that addresses these needs at their root.</p><p>Building custom internal tooling is a calculated investment in software quality. While off-the-shelf libraries provide speed for initial MVPs, a tailor-made architecture ensures that performance bottlenecks and technical debt are mitigated before they can impact the development lifecycle. This deliberate approach allows us to maintain a high bar for both Developer Experience (DX) and User Experience (UX).</p><p>Ultimately, engineering excellence is found in the balance between flexibility and standardization. By establishing a unified language for how our application handles data filtering, we have created a predictable, high-performance environment that can evolve alongside our business needs. This architecture serves as a testament to the fact that when requirements are clearly defined and met with rigorous engineering solutions, the result is a sustainable and robust ecosystem for both developers and end-users alike.</p><p>Here is the article to learn detail of <a href="https://medium.com/@dogancanulgu/e270353e1501">FilterContainer</a>.</p><h3>6. References</h3><ul><li><strong>React Window Documentation:</strong> Virtualization for high-performance lists. <a href="https://react-window.vercel.app/">https://react-window.vercel.app/</a></li><li><strong>Debouncing and Throttling in JavaScript:</strong> CSS Tricks. <br><a href="https://css-tricks.com/debouncing-throttling-explained-examples/">https://css-tricks.com/debouncing-throttling-explained-examples/</a></li><li><strong>Component Composition Patterns:</strong> <em>Fowler, M. (2010). GUI Architectures.</em></li><li><strong>UI/UX for Big Data:</strong> <em>Nielsen Norman Group — Filtering and Sorting Best Practices.</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52e4b3d49dbd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/call-center-studio/from-chaos-to-order-engineering-a-unified-frontend-filtering-architecture-52e4b3d49dbd">From Chaos to Order: Engineering a Unified Frontend Filtering Architecture</a> was originally published in <a href="https://medium.com/call-center-studio">Call Center Studio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing User Management in SaaS and Call Center Platforms]]></title>
            <link>https://medium.com/call-center-studio/securing-user-management-in-saas-and-call-center-platforms-adb2abc9dac4?source=rss----60847e130fc5---4</link>
            <guid isPermaLink="false">https://medium.com/p/adb2abc9dac4</guid>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[maker-checker-concept]]></category>
            <category><![CDATA[call-center-services]]></category>
            <dc:creator><![CDATA[Anılcan Yurtbay]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 07:30:36 GMT</pubDate>
            <atom:updated>2025-12-31T07:30:29.082Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OpNWbTBiWKMZ1rp_t4-3HA.png" /></figure><h4>Implementing a Maker–Checker Approval Workflow for Critical User Operations</h4><h3>Abstract</h3><p>User management is a critical security domain in modern SaaS and call center platforms. Misconfigured permissions, unauthorized activations, or uncontrolled deletions can introduce serious security, compliance, and operational risks. This paper presents a production-grade Maker–Checker (Approval Request) system designed to secure critical user lifecycle operations through a two-step approval workflow. The proposed architecture enforces separation of duties, prevents unsafe state transitions, and provides full auditability while remaining compatible with real-time operational systems such as call center software.</p><h3>1. Introduction</h3><p>In SaaS and call center platforms, user-related operations directly affect security posture, compliance boundaries, and system stability. Activating a user may instantly grant access to sensitive customer data, dashboards, or live operational systems. Deactivating or deleting a user can disrupt active workflows, invalidate permissions, or impact historical reporting.</p><p>Unverified execution of critical user operations can result in:</p><ul><li>Privilege escalation attacks</li><li>Data leakage and unauthorized access</li><li>Regulatory violations (GDPR, SOX, HIPAA)</li><li>Operational disruptions affecting customer experience</li></ul><p>The Maker–Checker pattern, widely adopted in financial and mission-critical systems, introduces a two-step verification mechanism. By separating the role that <strong>requests</strong> an operation (Maker) from the role that <strong>approves and executes</strong> it (Checker), the system reduces risks associated with human error, insider threats, and automation misuse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-pkqAagi9aZG3b3odXhkIg.png" /></figure><h3>2. System Design and Architecture</h3><h3>2.1 Architectural Overview</h3><p>The Maker–Checker system is implemented as an <strong>approval-first execution layer</strong> embedded directly into the user management domain.</p><p>Key architectural principles:</p><ul><li><strong>Request-Based State Management</strong><br>No critical operation mutates user state immediately. Each action generates an immutable ApprovalRequest.</li><li><strong>Asynchronous Approval Workflow</strong><br>Makers submit requests; Checkers review and approve or reject them before execution.</li><li><strong>Configurable Enforcement</strong><br>Approval enforcement can be toggled per organization or tenant via a configuration flag (e.g. require_approval_for_user_operations).</li></ul><p>This design allows strict security enforcement without blocking operational flexibility.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tl8axeax7rqGFkjoiaMVtg.png" /></figure><h3>2.2 Core Components</h3><h4>Model</h4><ul><li><strong>TargetResource</strong>: The type of resource the action applies to (e.g., “User”)</li><li><strong>ResourceID</strong>: Unique identifier of the resource</li><li><strong>ActionType</strong>: Type of action (activate, deactivate, delete, permission_update)</li><li><strong>ChangeDetails</strong>: JSON snapshot of the requested changes</li><li><strong>PreviousState</strong>: Snapshot of the resource before the change</li><li><strong>CurrentStatus</strong>: Request status (pending, approved, rejected)</li><li><strong>Initiator</strong>: User who initiated the action</li><li><strong>SourceIP</strong>: Client IP address of the request</li><li><strong>SourceAgent</strong>: Client User-Agent information</li></ul><h4>Maker and Checker Roles</h4><ul><li><strong>Maker</strong><br>Initiates a request but cannot execute it.</li><li><strong>Checker</strong><br>Reviews pending requests and performs approval or rejection.<br>Checkers are selected via a default permission profile to ensure centralized control.</li></ul><p>A strict rule is enforced: <strong>a user cannot approve their own request</strong>.</p><h4>Notification and Audit Systems</h4><ul><li><strong>Notification Layer</strong><br>All active Checkers receive notifications (email or in-app) containing request metadata and timestamps.</li><li><strong>Audit Logging</strong><br>Every stage is logged to:</li><li>SIEM systems</li><li>Administrative activity feeds</li></ul><p>No approval or execution occurs without generating a corresponding audit event.</p><h3>3. Supported User Operations</h3><p>The approval workflow protects the following critical operations:</p><ul><li><strong>activate</strong><br>Grants system access and permissions.</li><li><strong>deactivate</strong><br>Revokes access and integrates with dependent services.</li><li><strong>delete</strong><br>Permanently removes a user (soft delete recommended); may require double approval.</li><li><strong>permission_change</strong><br>Modifies permission profiles and invalidates cached permissions immediately.</li></ul><p>Each operation is domain-aware and validated before execution.</p><h3>4. Technical Implementation Details</h3><h3>4.1 Preventing Concurrent Requests</h3><p>To avoid inconsistent state transitions, the system enforces a <strong>single pending request per user</strong>.</p><pre>def has_pending_request(user_id):<br>    return ApprovalRequest.exists(<br>        resource_type=&quot;User&quot;,<br>        resource_id=user_id,<br>        status=&quot;pending&quot;<br>    )</pre><p>The user entity is flagged with approval_pending = true until resolution.</p><h3>4.2 Creating an Approval Request</h3><pre>def request_user_operation(user_id, operation, changes, actor):<br>    if has_pending_request(user_id):<br>        raise ConflictError(&quot;Pending approval exists&quot;)<br>    approval = ApprovalRequest(<br>        resource_type=&quot;User&quot;,<br>        resource_id=user_id,<br>        operation=operation,<br>        requested_changes=changes,<br>        old_values=get_user_snapshot(user_id),<br>        status=&quot;pending&quot;,<br>        requested_by=actor.id,<br>        source_ip=actor.ip,<br>        source_user_agent=actor.user_agent<br>    )<br>    approval.save()<br>    mark_user_pending(user_id)<br>    notify_checkers(approval)</pre><p>No user state is mutated at this stage.</p><h3>4.3 Approval Execution with Distributed Locking</h3><p>Approval execution is serialized using Redis-based distributed locks.</p><pre>def approve_request(request_id, checker):<br>    with distributed_lock(f&quot;approval:{request_id}&quot;):<br>        request = ApprovalRequest.get(request_id)<br><br>        if request.status != &quot;pending&quot;:<br>            raise InvalidStateError()<br>        apply_operation(request)<br>        request.status = &quot;approved&quot;<br>        request.approved_by = checker.id<br>        request.save()<br>        clear_user_pending(request.resource_id)<br>        write_audit_event(request)</pre><p>This guarantees atomicity under concurrent administrative load.</p><h3>5. Domain-Specific Safeguards</h3><h3>5.1 Live Operation Protection (Call Center Example)</h3><p>Before deactivation, the system verifies that the agent is not handling an active call.</p><pre>def is_user_on_active_call(user_id):<br>    return CallSession.exists(<br>        agent_id=user_id,<br>        status=&quot;active&quot;<br>    )</pre><pre>def apply_deactivation(request):<br>    if is_user_on_active_call(request.resource_id):<br>        raise ConflictError(&quot;User is on an active call&quot;)<br>    remove_from_queues(request.resource_id)<br>    deactivate_user(request.resource_id)</pre><p>This prevents service disruption.</p><h3>5.2 Permission Change Consistency</h3><p>Permission updates invalidate all cached permission data immediately.</p><pre>def apply_permission_change(request):<br>    update_permissions(<br>        request.resource_id,<br>        request.requested_changes<br>    )<br>    invalidate_permission_cache(request.resource_id)</pre><h3>6. Security and Compliance Considerations</h3><p>The system enforces best practices through:</p><ul><li>IP and User-Agent tracking</li><li>Full before/after state snapshots</li><li>Immutable audit trails</li><li>Tenant isolation in multi-tenant deployments</li><li>Centralized Checker selection</li></ul><p>These mechanisms collectively satisfy regulatory requirements by answering:</p><p><strong>Who did what, when, where, and why?</strong></p><h3>7. Extensibility and Operational Fit</h3><p>Although implemented for user management, the same approval framework can secure:</p><ul><li>API key lifecycle operations</li><li>Configuration changes</li><li>Billing or subscription updates</li></ul><p>The architecture remains lightweight, asynchronous, and compatible with high-traffic SaaS and real-time platforms.</p><h3>8. Trade-offs and Design Considerations</h3><p>While the Maker–Checker pattern significantly improves security and auditability, it also introduces deliberate trade-offs that must be considered at design time. Approval-based workflows inherently add <strong>latency</strong> to critical operations, which may be undesirable in low-risk or highly automated environments. They also introduce <strong>operational overhead</strong>, requiring additional logic for request tracking, notifications, and state management. Furthermore, system availability becomes partially dependent on <strong>Checker responsiveness</strong>, which can delay execution during off-hours or incidents. For these reasons, Maker–Checker workflows are best applied selectively to high-impact operations where security, compliance, and traceability outweigh the cost of delayed execution.</p><h3>9. Conclusion</h3><p>Critical user operations represent one of the highest-risk surfaces in SaaS and call center platforms. By introducing a Maker–Checker approval workflow at the architectural level, organizations can enforce separation of duties, prevent unsafe state transitions, and maintain full auditability without sacrificing operational efficiency.</p><p>This work demonstrates that approval-driven user management is not merely a compliance requirement, but a foundational security pattern for modern production systems.</p><h3>References</h3><ul><li>Four-Eyes Principle (Maker–Checker Model)<br><a href="https://en.wikipedia.org/wiki/Four-eyes_principle">https://en.wikipedia.org/wiki/Four-eyes_principle</a></li><li>NIST SP 800–53 Rev. 5 — Security and Privacy Controls<br><a href="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r5.pdf">https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r5.pdf</a></li><li>OWASP Logging Cheat Sheet<br><a href="https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html">https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html</a></li><li>Redis Distributed Locks<br><a href="https://redis.io/docs/latest/develop/use/patterns/distributed-locks/">https://redis.io/docs/latest/develop/use/patterns/distributed-locks/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=adb2abc9dac4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/call-center-studio/securing-user-management-in-saas-and-call-center-platforms-adb2abc9dac4">Securing User Management in SaaS and Call Center Platforms</a> was originally published in <a href="https://medium.com/call-center-studio">Call Center Studio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Real-Time Virtual Background in the Browser (MediaPipe Selfie Segmentation + Canvas)]]></title>
            <link>https://medium.com/call-center-studio/real-time-virtual-background-in-the-browser-mediapipe-selfie-segmentation-canvas-c79f19fb7af4?source=rss----60847e130fc5---4</link>
            <guid isPermaLink="false">https://medium.com/p/c79f19fb7af4</guid>
            <dc:creator><![CDATA[Uğur Çağatay Tüzün]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 07:29:57 GMT</pubDate>
            <atom:updated>2025-12-31T07:29:56.173Z</atom:updated>
            <content:encoded><![CDATA[<p>In modern video applications, users expect it to be <strong>stable</strong>, <strong>low-latency</strong>, and <strong>local-only</strong>, without hurting performance.</p><p>In this article, we’ll walk through a <strong>clean and practical approach</strong> to building a real-time Virtual Background pipeline using browser APIs, canvas compositing, and background processing.<br> No server-side logic. No media track replacement. No SDP tricks.</p><h3>What we will do in this article</h3><ul><li>Capture camera video using the browser</li><li>Run real-time person segmentation on video frames</li><li>Composite foreground and background using Canvas</li><li>Produce a processed output stream with captureStream()</li><li>Keep the pipeline stable even when the tab loses focus</li></ul><p>That’s it.</p><h3>The core idea</h3><p>At its core, Virtual Background is a <strong>video stream processing problem</strong>.</p><p>You do not replace media tracks.<br> You do not touch SDP.<br> You do not need any server-side changes.</p><p>You take a video stream, process its pixels, and return a new stream.</p><p>Conceptually, the pipeline looks like this:</p><p>Camera Video<br> → HTMLVideoElement<br> → Canvas (segmentation + compositing)<br> → canvas.captureStream()<br> → Processed MediaStream</p><p>Once the browser sees a valid MediaStream, it behaves exactly like a real camera.</p><h4>Step 1: Capturing the camera video</h4><p>We start by accessing the camera using the standard browser API:</p><pre>const stream = await navigator.mediaDevices.getUserMedia({<br>  video: {<br>    width: 1280,<br>    height: 720,<br>    frameRate: 30<br>  },<br>  audio: false<br>});</pre><p>This stream is rendered into a hidden &lt;video&gt; element.<br> That video element becomes the <strong>single source of truth</strong> for all further processing.</p><pre>const video = document.createElement(&#39;video&#39;);<br>video.srcObject = stream;<br>video.muted = true;<br>video.playsInline = true;<br>await video.play();</pre><h3>Step 2: Running real-time person segmentation</h3><p>For each frame, we generate an <strong>alpha mask</strong> that separates the person from the background.</p><p>Important detail:<br> We do <strong>not</strong> manually build masks or read pixels frame-by-frame in JavaScript.</p><p>The segmentation engine gives us a ready-to-use mask that can be directly composited on canvas.</p><p>High-level flow:</p><ul><li>Draw video frame to canvas</li><li>Apply segmentation mask</li><li>Draw background (blur or image)</li><li>Draw foreground (person)</li></ul><h4>Step 3: Canvas compositing</h4><p>Canvas is the heart of the Virtual Background pipeline.</p><p>We keep three canvases:</p><ul><li><strong>Input canvas</strong> (camera frame)</li><li><strong>Mask canvas</strong> (segmentation output)</li><li><strong>Output canvas</strong> (final 720p frame)</li></ul><p>The compositing sequence looks like this:</p><pre>let lastFrame = null;<br><br>// fallback: if mask isn&#39;t ready yet, reuse last rendered frame (prevents flicker)<br>if (!maskCanvas || !maskCanvas.width) {<br>  if (lastFrame) {<br>    ctx.globalCompositeOperation = &quot;source-over&quot;;<br>    ctx.drawImage(lastFrame, 0, 0, width, height);<br>    return;<br>  }<br>}<br><br>// draw camera frame<br>ctx.drawImage(video, 0, 0, width, height);<br><br>// apply segmentation mask<br>ctx.globalCompositeOperation = &quot;destination-in&quot;;<br>ctx.drawImage(maskCanvas, 0, 0, width, height);<br><br>// draw background<br>ctx.globalCompositeOperation = &quot;destination-over&quot;;<br>ctx.drawImage(backgroundCanvas, 0, 0, width, height);<br><br>// reset state<br>ctx.globalCompositeOperation = &quot;source-over&quot;;<br><br>// cache last frame for the next tick (used when mask is missing)<br>if (!lastFrame) lastFrame = document.createElement(&quot;canvas&quot;);<br>lastFrame.width = width;<br>lastFrame.height = height;<br>lastFrame.getContext(&quot;2d&quot;).drawImage(ctx.canvas, 0, 0);</pre><pre>// optional runtime background switch<br>if (bgImage &amp;&amp; bgImage.complete) {<br>  backgroundCanvas.getContext(&quot;2d&quot;).drawImage(bgImage, 0, 0, width, height);<br>} else {<br>  bgCtx.filter = &quot;blur(12px)&quot;;<br>  bgCtx.drawImage(video, 0, 0, width, height);<br>  bgCtx.filter = &quot;none&quot;;<br>}</pre><pre>function renderVirtualBackgroundFrame({<br>  ctx,<br>  video,<br>  maskCanvas,<br>  backgroundCanvas,<br>  width,<br>  height<br>}) {<br>  // clear previous frame to avoid ghosting<br>  ctx.globalCompositeOperation = &quot;source-over&quot;;<br>  ctx.clearRect(0, 0, width, height);<br><br>  // if segmentation mask is not ready yet, fallback to raw camera<br>  if (!maskCanvas || !maskCanvas.width) {<br>    ctx.drawImage(video, 0, 0, width, height);<br>    return;<br>  }<br><br>  // draw camera frame as foreground source<br>  ctx.drawImage(video, 0, 0, width, height);<br><br>  // apply segmentation mask to keep only the person<br>  ctx.globalCompositeOperation = &quot;destination-in&quot;;<br>  ctx.filter = &quot;blur(1.5px)&quot;; // soften edges to reduce flicker<br>  ctx.drawImage(maskCanvas, 0, 0, width, height);<br>  ctx.filter = &quot;none&quot;;<br><br>  // render background behind the subject<br>  ctx.globalCompositeOperation = &quot;destination-over&quot;;<br>  ctx.drawImage(backgroundCanvas, 0, 0, width, height);<br><br>  // reset canvas state for the next frame<br>  ctx.globalCompositeOperation = &quot;source-over&quot;;<br>}</pre><p>This approach avoids pixel-level manipulation and keeps rendering fast and predictable.</p><h4>Step 4: Creating the output stream</h4><p>Once the final frame is drawn, we convert pixels back into a real media stream:</p><pre>const fps =<br>  video.srcObject<br>    .getVideoTracks()[0]<br>    .getSettings().frameRate || 30;<br><br>const outputStream = outputCanvas.captureStream(fps);</pre><p>This is a critical detail:</p><ul><li>We <strong>do not hardcode FPS</strong></li><li>We reuse the camera’s actual frame rate</li><li>This avoids unnecessary frame drops or jitter</li></ul><p>From this point on, the browser treats the output exactly like a physical camera.</p><h3>Why we avoid requestAnimationFrame</h3><p>At first glance, requestAnimationFrame looks like a good choice.</p><p>In practice, it causes problems:</p><ul><li>It pauses when the tab is backgrounded</li><li>It throttles aggressively on power-saving systems</li><li>It introduces visible freezes in real-time video pipelines</li></ul><p>Instead, the frame processing cadence is driven by a dedicated Web Worker, while all rendering and segmentation remain on the main thread.</p><p>Benefits:</p><ul><li>Keeps processing alive when the tab loses focus</li><li>Prevents UI thread starvation</li><li>Results in much more stable video output</li></ul><p>The main thread only handles drawing.<br> Heavy processing stays isolated.</p><h3>Performance considerations</h3><p>A few important decisions keep performance stable:</p><ul><li>Segmentation runs at <strong>lower resolution</strong> than output</li><li>Mask is reused between frames when possible</li><li>Temporal smoothing reduces flicker</li><li>Canvas compositing avoids expensive readbacks</li></ul><p>The result works reliably on average laptops without overheating or fan spikes.</p><h3>Why this approach works well</h3><p>This architecture has a few strong advantages:</p><ul><li>Fully client-side</li><li>No media renegotiation</li><li>No dependency on signaling or transport layers</li><li>Easy to integrate into any video pipeline</li><li>Predictable performance characteristics</li></ul><p>Most importantly, it respects how browsers actually schedule work.</p><h3>References</h3><ul><li>Selfie Segmentation overview and API<br> <a href="https://chuoling.github.io/mediapipe/solutions/selfie_segmentation.html?utm_source=chatgpt.com">https://chuoling.github.io/mediapipe/solutions/selfie_segmentation.html</a></li><li>MediaStream and Canvas capture<br> <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/captureStream">https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/captureStream</a></li><li><a href="https://www.npmjs.com/package/@mediapipe/selfie_segmentation">https://www.npmjs.com/package/@mediapipe/selfie_segmentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c79f19fb7af4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/call-center-studio/real-time-virtual-background-in-the-browser-mediapipe-selfie-segmentation-canvas-c79f19fb7af4">Real-Time Virtual Background in the Browser (MediaPipe Selfie Segmentation + Canvas)</a> was originally published in <a href="https://medium.com/call-center-studio">Call Center Studio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zero-Cost, Real-Time Noise Suppression: A Hybrid DSP/Deep Learning Approach in the Browser]]></title>
            <link>https://medium.com/call-center-studio/zero-cost-real-time-noise-suppression-a-hybrid-dsp-deep-learning-approach-in-the-browser-4e4d71be758d?source=rss----60847e130fc5---4</link>
            <guid isPermaLink="false">https://medium.com/p/4e4d71be758d</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[noise-suppression]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[audio-processing]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Ertuğrul Demir]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 07:04:16 GMT</pubDate>
            <atom:updated>2025-12-31T07:04:15.209Z</atom:updated>
            <content:encoded><![CDATA[<p>In distributed VoIP systems, background noise kills user experience. Server-side noise suppression? Expensive and laggy. This post walks through how we built a client-side noise suppression system using RNNoise that runs entirely in the browser with zero server cost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6LTtvLVBbAVb2xEQdylygw.png" /></figure><h3><strong>1. The Problem: Quality vs. Unit Economics</strong></h3><h4><strong>The Context</strong></h4><p>Our platform handles thousands of concurrent voice streams. Users call from everywhere: noisy offices, busy streets, home environments with barking dogs. The audio quality varies wildly.</p><h4><strong>The Constraints</strong></h4><p><strong>1. Zero Infrastructure Cost:</strong> Processing audio server-side using Cloud Speech APIs costs around $0.005/min. Scale that to 10,000 concurrent streams and the bill becomes a serious problem.</p><p><strong>2. Hard Real-Time Requirement:</strong> VoIP demands sub-200ms end-to-end latency. Sending audio to an external server, processing it, and sending it back adds too much delay and jitter.</p><p><strong>3. Client Environment:</strong> Whatever we build has to run in Chrome, Edge, or Firefox without requiring plugins or local software installation.</p><h3><strong>2. System Architecture</strong></h3><p>We moved noise suppression to the browser using RNNoise. The key insight: instead of trying to reconstruct clean audio from scratch (which requires massive compute), RNNoise predicts how much to turn down each frequency band.</p><h4><strong>The Hybrid Advantage</strong></h4><p>Standard deep learning models like WaveNet attempt to reconstruct raw audio waveforms (44.1k or 48k samples per second), requiring massive compute power. Some approaches need 10+ million weights just for 8kHz audio.</p><p>RNNoise takes a fundamentally different approach:</p><p><strong>1. DSP Phase (Feature Extraction):</strong> Audio is segmented into 20ms overlapping frames and transformed via FFT. The frequency spectrum is partitioned into 22 triangular bands approximating the Bark scale, which models human auditory perception.</p><p><strong>2. Deep Learning Phase:</strong> A compact RNN with only 215 units analyzes features from these bands and predicts an ideal gain (0.0 to 1.0) for each band.</p><p><strong>3. Pitch Filtering:</strong> A comb filter at the detected pitch period attenuates residual noise between speech harmonics. This handles fine spectral details that band-based approaches miss.</p><p><strong>4. Output:</strong> The predicted gains create a dynamic spectral mask that suppresses noise while preserving voice.</p><h4><strong>Architecture Visualization</strong></h4><p>The diagram below shows how the inference engine integrates into the WebRTC audio pipeline. AudioWorklet runs in a dedicated thread, isolating audio processing from UI rendering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZDy2hMqOby8XXH9aSn-L2A.png" /></figure><h3><strong>3. Implementation Phases</strong></h3><p>Building this system required a full pipeline from training to browser deployment.</p><h4><strong>Phase 1: Training the Model</strong></h4><p>We trained the model using Python and Keras/TensorFlow. The goal was to minimize the perceptual difference between clean speech and processed noisy speech.</p><h4><strong>Dataset Construction</strong></h4><p>Ground truth gains require both clean and noisy versions of the same audio, so training data is constructed artificially:</p><p>- <strong>Speech:</strong> Multi-language speech databases with various speakers<br>- <strong>Noise:</strong> Environmental recordings relevant to call center scenarios (office sounds, street ambience, crowd noise, machinery)<br>- <strong>Mixing:</strong> Various SNR levels including clean speech and noise-only segments<br>- <strong>Augmentation:</strong> Random IIR filtering to simulate different microphone frequency responses</p><h4><strong>The 42-Dimensional Feature Vector</strong></h4><p>The network doesn’t see raw audio samples. It receives a carefully designed feature set per frame:</p><pre>| Feature Type | Count  | Description                                                     |<br>|--------------|--------|-----------------------------------------------------------------|<br>| BFCCs        | 22     | Bark-frequency cepstral coefficients (DCT of log band energies) |<br>| BFCC Δ       | 8      | First temporal derivatives of BFCCs 0–7                         |<br>| BFCC ΔΔ      | 6      | Second temporal derivatives of BFCCs 0–5                        |<br>| Pitch DCT    | 6      | DCT of pitch correlation across frequency bands                 |<br>| Extras       | +2     | Pitch period and spectral non-stationarity metric               |<br>| **Total** | **42** | Input dimension per frame                                       |</pre><p>Unlike typical speech recognition features, these don’t use cepstral mean normalization and do include the first cepstral coefficient. We need to track absolute noise levels, not just relative patterns.</p><h4><strong>Model Topology</strong></h4><p>The network uses Gated Recurrent Units (GRUs) chosen over LSTMs for equivalent performance with fewer parameters. The architecture conceptually follows traditional noise suppression structure: VAD → Noise Estimation → Gain Computation.</p><pre># Simplified training topology (pseudo-code)<br>input_features = Input(shape=(None, 42))<br># Feature transformation<br>x = Dense(24, activation=&#39;tanh&#39;)(input_features)<br># Three GRU layers with increasing capacity<br># Each layer handles part of the estimation pipeline<br>x = GRU(24, return_sequences=True)(x) # VAD estimation<br>x = GRU(48, return_sequences=True)(x) # Noise tracking<br>x = GRU(96, return_sequences=True)(x) # Gain computation<br># Dual outputs<br>vad_output = Dense(1, activation=&#39;sigmoid&#39;, name=&#39;vad&#39;)(x)<br>gain_output = Dense(22, activation=&#39;sigmoid&#39;, name=&#39;gains&#39;)(x)<br>model = Model(inputs=input_features, outputs=[gain_output, vad_output])</pre><h4><strong>Loss Function</strong></h4><p>We use a perceptually-motivated loss rather than simple MSE:</p><pre>L(g, ĝ) = (g^γ - ĝ^γ)² where γ = 0.5</pre><p>This minimizes error on energy^(1/4), providing better balance between aggressive suppression and speech preservation. Standard MSE either over-suppresses or under-suppresses depending on the SNR. The VAD output uses cross-entropy loss.</p><h4><strong>Phase 2: Model Conversion and Compression</strong></h4><p>A raw Keras model can’t run efficiently in a browser’s real-time audio thread. The conversion pipeline:</p><p><strong>1. Weight Extraction:</strong> Export trained weights (87,503 total) from HDF5<br><strong>2. 8-bit Quantization:</strong> Quantize weights to 8 bits with no perceptible quality loss. The entire model fits in CPU L2 cache.<br><strong>3. C Implementation:</strong> Rewrite inference in C for low-level memory management and optimized matrix operations<br><strong>4. Wasm Compilation:</strong> Compile via Emscripten to WebAssembly for near-native browser execution</p><h4>Resulting Metrics:</h4><pre>| Property    | Value      | Notes                        |<br>|-------------|------------|------------------------------|<br>| Model Size  | ~85 kB     | Smaller than most images     |<br>| Complexity  | ~40 MFLOPS | Comparable to a speech codec |<br>| Weights     | 87,503     | Fits entirely in L2 cache    |</pre><h4><strong>Phase 3: Browser Integration with AudioWorklet</strong></h4><p>Early prototypes using `ScriptProcessorNode` suffered from audio glitches when the main thread was busy rendering UI. We migrated to `AudioWorklet`, which runs in a dedicated audio rendering thread.</p><h4><strong>Audio Worklet Processor</strong></h4><pre>// processor.js - Runs in Audio Worklet thread<br>class RNNoiseProcessor extends AudioWorkletProcessor {<br>  constructor() {<br>    super();<br>    this.model = new RNNoiseWasm();<br>    this.frameSize = 480; // 10ms at 48kHz<br>  }<br><br>  process(inputs, outputs) {<br>    const input = inputs[0];<br>    const output = outputs[0];<br>    <br>    if (input.length &gt; 0 &amp;&amp; input[0].length &gt; 0) {<br>      // Process frame through Wasm module<br>      const denoised = this.model.processFrame(input[0]);<br>      output[0].set(denoised);<br>    }<br>    return true;<br>  }<br>}<br><br>registerProcessor(&#39;rnnoise-processor&#39;, RNNoiseProcessor);</pre><h3>4. Results and Validation</h3><p>We validated the system using spectrogram analysis across three real-world noise scenarios, each with 20-second test recordings at 16kHz sample rate.</p><h4><strong>Test Methodology</strong></h4><p>- <strong>Signal Amplitude Reduction: </strong>Measures overall amplitude change after processing<br>- <strong>Noise Reduction (dB):</strong>Difference in noise floor before/after processing<br>- <strong>Spectrogram Analysis:</strong> Visual verification using librosa for frequency-domain representation</p><h4>Quantitative Results</h4><pre>| Test Scenario | Noise Reduction (dB) | Amplitude Reduction (%) | Observations                              |<br>|---------------|----------------------|-------------------------|-------------------------------------------|<br>| Car Engine    | 1.32                 | 14.12                   | Steady-state broadband noise reduced      |<br>| Crowd/Office  | 5.56                 | 47.28                   | Best performance on non-stationary babble |<br>| Power Drill   | 2.49                 | 24.92                   | High-frequency transients attenuated      |</pre><p>Crowd noise showed the strongest results, consistent with RNNoise research demonstrating effectiveness on non-stationary noise types.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*v1Yb-7Lg03gd0-uvMM-jSw.png" /></figure><p><em>*Figure 1: Noise reduction (dB) across test scenarios. Crowd noise shows highest reduction.*</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*hHyfPb2cqtKYFNbsV2ltog.png" /></figure><p><em>*Figure 2: Amplitude reduction percentage. Higher values indicate more noise removed.*</em></p><h4><strong>Spectrogram Analysis</strong></h4><h4><strong>Case 1: Car Engine Noise</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*u6_dO3qq10Z3TIA1EpcuyQ.png" /></figure><p><em>*Figure 3: Car noise spectrogram. Top: Input with broadband engine noise across all frequencies. Bottom: Output with noise floor significantly reduced, speech harmonics (horizontal bands) preserved.*</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*FhY6KaZNqhH_8UIOggir6A.png" /></figure><p><em>*Figure 4: Car noise waveform. The constant noise floor visible in the input disappears in the output. Speech amplitude peaks remain intact.*</em></p><h4><strong>Case 2: Crowd/Office Noise</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*e6OLuy8oHRtREf0oUOkgUA.png" /></figure><p><em>*Figure 5: Crowd noise spectrogram. Top: Scattered babble noise masking speech throughout. Bottom: Background “fog” removed while formant structure remains clear.*</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*gIbqOI3fjcMXeMtt1tNGAQ.png" /></figure><p><em>*Figure 6: Crowd noise waveform. Notice the clean silence periods in the output where only noise existed in the input.*</em></p><h4><strong>Case 3: Power Drill (Transient Noise)</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*tlQQIkwqHiIUkWCIK-DI5Q.png" /></figure><p><em>*Figure 7: Drill noise spectrogram. High-frequency drill harmonics visible in input are attenuated in output. Lower speech frequencies preserved.*</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*gIsVbAw2i7rpbW6Ls9AqbA.png" /></figure><p><em>*Figure 8: Drill noise waveform. Transient drill sounds significantly reduced without clipping speech dynamics.*</em></p><h4><strong>Performance Summary</strong></h4><pre>| Metric               | Value     | Context                       |<br>|----------------------|-----------|-------------------------------|<br>| Model Size           | 85 kB     | Fits in single HTTP request   |<br>| Complexity           | 40 MFLOPS | Comparable to speech codec    |<br>| Latency              | ~10ms     | Well within 200ms VoIP budget |<br>| CPU (Desktop i7)     | &lt;1.5%     | Single core usage             |<br>| CPU (ARM Cortex-A53) | ~14%      | Raspberry Pi 3 class          |</pre><h3><strong>5. Lessons Learned</strong></h3><h4><strong>The Robotic Voice Problem (Gain Floor)</strong></h4><p>When gains approach zero, frequencies get completely removed. On speech, this strips away resonance and produces a synthetic, “underwater” quality.</p><p><strong>Solution:</strong> We added a minimum gain floor (~0.1, roughly -20dB maximum attenuation). Bands are never fully silenced. A trace of natural room ambience is acceptable; robotic voice is not.</p><p>The original RNNoise uses temporal smoothing (`g̃ = max(0.6 * g̃_prev, ĝ)`) creating 135ms decay. Our floor approach is simpler but achieves similar perceptual results.</p><h4>Browser Compatibility</h4><pre>| Browser      | AudioWorklet Support | Notes          |<br>|--------------|----------------------|----------------|<br>| Chrome 66+   | ✅ Full               | Primary target |<br>| Edge 79+     | ✅ Full               | Chromium-based |<br>| Firefox 76+  | ✅ Full               | Good support   |<br>| Safari 14.1+ | ✅ Full               | Good support   |</pre><p>We kept a ScriptProcessorNode fallback for older browsers with a console warning about potential main-thread blocking.</p><h4><strong>Toggle Functionality</strong></h4><p>Agents wanted to disable suppression for specific situations: unusual microphones, acoustic environments where suppression caused artifacts, or debugging audio issues. A simple on/off toggle during calls proved essential.</p><h4><strong>6. Conclusion</strong></h4><p>Moving noise suppression to the browser solved our cost/latency problem:</p><p>- <strong>$0 incremental server cost</strong> regardless of concurrent streams<br>- <strong>&lt;1.5% CPU overhead</strong> on standard hardware<br>- <strong>~10ms latency</strong> added to audio pipeline<br>- <strong>Production-ready</strong> with toggle controls and lifecycle management</p><p>The hybrid approach (DSP for feature extraction, compact RNN for gain estimation) proves that sophisticated audio processing doesn’t require GPU-scale compute. The 85kB model in WebAssembly delivers quality comparable to far heavier solutions.</p><p>For engineers facing similar problems: sometimes the edge is the right place for your compute.</p><h3><strong>References</strong></h3><p>1. Valin, J.-M., “A Hybrid DSP/Deep Learning Approach to Real-Time Full-Band Speech Enhancement,” <em>*IEEE 20th Int. Workshop Multimedia Signal Processing (MMSP)*</em>, 2018<br>2. <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API">Web Audio API</a><br>3. <a href="https://developer.chrome.com/blog/audio-worklet/">AudioWorklet Guide </a><br>4. <a href="https://developer.chrome.com/blog/audio-worklet/">AudioWorklet</a><br>5. <a href="https://keras.io/api/">Keras</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e4d71be758d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/call-center-studio/zero-cost-real-time-noise-suppression-a-hybrid-dsp-deep-learning-approach-in-the-browser-4e4d71be758d">Zero-Cost, Real-Time Noise Suppression: A Hybrid DSP/Deep Learning Approach in the Browser</a> was originally published in <a href="https://medium.com/call-center-studio">Call Center Studio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSO with OIDC: A Secure Login Approach]]></title>
            <link>https://medium.com/call-center-studio/sso-with-oidc-a-secure-login-approach-cb7a558fce23?source=rss----60847e130fc5---4</link>
            <guid isPermaLink="false">https://medium.com/p/cb7a558fce23</guid>
            <category><![CDATA[sso]]></category>
            <category><![CDATA[oidc]]></category>
            <dc:creator><![CDATA[Yusuf Avcı]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 06:18:09 GMT</pubDate>
            <atom:updated>2025-12-31T06:18:07.830Z</atom:updated>
            <content:encoded><![CDATA[<p>In the early days of enterprise software, security often took a backseat to functionality. We’ve all heard the horror stories of major breaches caused by default admin:admin credentials or employees recycling passwords from compromised forums.</p><p>For modern enterprises, relying on standard password logins is a liability, especially in high-turnover environments like Call Center SaaS. Managing thousands of credentials inevitably leads to password fatigue. If an agent, overwhelmed by needing unique logins for ten different apps, decides to write their master password on a yellow sticky note attached to their monitor, the company’s entire security perimeter is effectively compromised<strong>.</strong> This fragmentation creates a massive attack surface.</p><p>The solution to this chaos is <strong>Single Sign-On (SSO)</strong>. By centralizing authentication, we remove the burden from the user, reduce the “sticky note” factor, and significantly harden the organization’s security posture.</p><h4>SSO Advantages</h4><ul><li>Improved Security</li><li>Logging in is simpler, with one click.</li><li>User privileges can be granted or revoked easily from a central place.</li></ul><h3>What is Single Sign-On (SSO)?</h3><p>Single Sign-On (SSO) is an authentication scheme that allows a user to log in with a single ID and password to any of several related, yet independent, software systems. It effectively bridges the gap between your <strong>Identity Provider (IdP)</strong> — like Google, Microsoft Azure, or Okta — and the service you are trying to access (the <strong>Service Provider — SP</strong>).</p><p>When a user logs in via SSO, they aren’t actually logging into your app directly. They are logging into the IdP, which then gives your app a “thumbs up” and says, “Yes, this is John Doe, and he is allowed to be here.” This requires a trust between the <strong>IdP</strong> and <strong>SP</strong>.<strong> SSO </strong>protocols help create that trust and communication.</p><p>There are two primary protocols that dominate the SSO landscape today: <strong>SAML</strong> and <strong>OIDC</strong>.</p><h3>1. SAML (Security Assertion Markup Language)</h3><p>SAML is the veteran of the industry. Developed in the early 2000s, it is an XML-based open standard for exchanging authentication and authorization data.</p><p>SAML is incredibly robust. It allows for rich data exchange and has been the gold standard for large enterprises and government entities for nearly two decades. It is highly secure and supports complex encryption requirements. However, it was built in an era before mobile apps and Single-Page Applications (SPAs) dominated the web.</p><p><strong>The Complexity of SAML</strong></p><p>While powerful, SAML is heavy. It relies on verbose XML documents and SOAP-based web services. Debugging a failed SAML handshake often involves parsing massive blocks of XML to check for signature mismatches, canonicalization errors, or certificate expiration. For modern developers used to lightweight JSON APIs, implementing SAML can feel like stepping back in time.</p><h3>2. OIDC (OpenID Connect)</h3><p>Enter <strong>OpenID Connect (OIDC)</strong>.</p><p>OIDC is a simple identity layer built on top of the OAuth 2.0 protocol. It allows clients to verify the identity of the end-user based on the authentication performed by an Authorization Server, as well as to obtain basic profile information about the end-user in an interoperable and REST-like manner.</p><blockquote>OIDC is not necessarily a full replacement for SAML — SAML is still excellent for legacy enterprise setups — but OIDC is the modern alternative. It is lighter, mobile-friendly, and uses <strong>JSON Web Tokens (JWTs)</strong> instead of XML.</blockquote><h4>Why Developers Prefer OIDC (JSON vs. XML)</h4><p>One of the biggest reasons for the rapid adoption of OIDC is the Developer Experience (<strong>DX</strong>).</p><p>If you are building a modern web application using React, Vue, or Angular, your frontend speaks JSON natively. SAML, being XML-based, requires heavy parsing logic that is cumbersome to perform in a browser environment.</p><ul><li><strong>SAML:</strong> Requires XML parsers, understanding of XML Digital Signatures, and handling XML namespaces. It is notoriously difficult to debug because a single whitespace character in the wrong place can break the cryptographic signature.</li><li><strong>OIDC:</strong> Uses JSON. You can parse a JWT with a simple JSON.parse() (though you should use a library to verify the signature). You can copy your token and paste it into tools like jwt.io to instantly see what data it contains.</li></ul><p>For the Call Center SaaS platform I work on, choosing OIDC meant our frontend team could implement authentication flows much faster, without needing to become experts in 20-year-old XML schemas.</p><h4>OIDC vs. OAuth 2.0: Clearing the Confusion</h4><p>A common misconception is that OIDC and OAuth are the same thing. They are different things but are very <strong>similar</strong> in concept.</p><ul><li><strong>OAuth 2.0</strong> is for <strong>Authorization</strong> (Access). It gives an application permission to do something on your behalf (e.g., “Allow this app to access my Google Drive”). This means an app can access your Google Drive — is authorized to do things— but is not logged in like a user.</li><li><strong>OIDC</strong> is for <strong>Authentication</strong> (Identity). It tells the application <em>who</em> you are (e.g., “Log in with Google”).</li></ul><p>OIDC is an extension of OAuth 2.0. Think of it this way: OAuth provides a key to the house, but it doesn’t tell you <em>who</em> is holding the key. OIDC adds the photo ID attached to that key.</p><h4>Example: The OAuth 2.0 Flow (Authorization Only)</h4><p>In a standard OAuth flow, the goal is to get an access_token to call an API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_1MKhHXScKzpK2V3VSilyA.png" /></figure><pre># Pseudo-code for a standard OAuth 2.0 Access Request<br>import requests<br><br># 1. User is redirected to provider to approve access<br># 2. Provider returns a &#39;code&#39; via the browser<br>code = &quot;received_auth_code_from_callback&quot;<br># 3. Exchange code for an Access Token<br>response = requests.post(&#39;https://provider.com/oauth/token&#39;, data={<br>    &#39;grant_type&#39;: &#39;authorization_code&#39;,<br>    &#39;code&#39;: code,<br>    &#39;client_id&#39;: &#39;your_client_id&#39;,<br>    &#39;client_secret&#39;: &#39;your_client_secret&#39;,<br>    &#39;redirect_uri&#39;: &#39;https://myapp.com/callback&#39;<br>})<br><br>tokens = response.json()<br>access_token = tokens[&#39;access_token&#39;]<br><br># 4. Use Access Token to fetch data (e.g., list files)<br># Note: We still don&#39;t necessarily know WHO the user is, just that we can access their files.<br>api_data = requests.get(&#39;https://provider.com/api/files&#39;, headers={<br>    &#39;Authorization&#39;: f&#39;Bearer {access_token}&#39;<br>})</pre><h3>Example: The OIDC Flow (Authentication)</h3><p>OIDC changes this flow slightly. When we ask for the openid scope, the provider returns an additional artifact: the <strong>ID Token</strong>.</p><p>Python</p><pre># Pseudo-code for an OIDC Login Flow<br>import requests<br>import jwt # Standard library for handling JSON Web Tokens<br><br># 1. Request includes &#39;openid&#39; scope<br># Redirect user to: https://provider.com/authorize?scope=openid email profile...<br><br># 2. Exchange code for Tokens (Same as OAuth)<br>response = requests.post(&#39;https://provider.com/oauth/token&#39;, data={<br>    &#39;grant_type&#39;: &#39;authorization_code&#39;,<br>    &#39;code&#39;: &quot;received_auth_code&quot;,<br>    # ... other client credentials ...<br>})<br><br>tokens = response.json()<br><br># HERE is the difference: We get an ID Token alongside the access token<br>id_token_jwt = tokens[&#39;id_token&#39;]<br><br># 3. Verify and Decode the ID Token to identify the user<br># In a real app, you MUST verify the signature against the provider&#39;s public keys<br>user_info = jwt.decode(id_token_jwt, options={&quot;verify_signature&quot;: False}) <br><br>print(f&quot;User Logged In: {user_info[&#39;email&#39;]}&quot;)<br>print(f&quot;User ID: {user_info[&#39;sub&#39;]}&quot;)</pre><p>By verifying the id_token, we aren&#39;t just guessing who the user is; we have a cryptographically signed guarantee from the Identity Provider.</p><h3>The Power of Scopes and Granularity</h3><p>Another advantage OIDC has over SAML is the concept of <strong>Scopes</strong>.</p><p>In many SAML implementations, the Identity Provider sends a massive “assertion” containing every piece of data it knows about the user (Department, Manager, Phone, Email, Address, etc.). While comprehensive, this often violates the principle of <strong>Data Minimization</strong>.</p><p>OIDC allows for granular requests using scopes. You ask only for what you need:</p><ul><li>scope=&quot;openid&quot;: &quot;I just want to know who this is.&quot;</li><li>scope=&quot;openid email&quot;: &quot;I want to know who this is and their email address.&quot;</li><li>scope=&quot;openid profile&quot;: &quot;I want their name and avatar.&quot;</li></ul><p>This granularity makes integrations cleaner and respects user privacy by limiting the data shared between systems to only what is strictly necessary for the application to function.</p><h3>Security Essentials: State and Nonce</h3><p>Implementing OIDC is easier than SAML, but it introduces its own set of security requirements. If you strictly copy-paste code without understanding the parameters, you leave your application open to attacks.</p><h3>The Importance of state</h3><p>The state parameter is your primary defense against <strong>Cross-Site Request Forgery (CSRF)</strong>.</p><p>Imagine an attacker starts an OIDC flow on their own machine, gets a valid authorization code for <em>their</em> malicious account, and then tricks a victim into clicking a link that feeds that code into the victim’s session. The victim logs in, thinking they are in their own account, but they are actually logged into the attacker’s account.</p><p>To prevent this, you generate a random string (state) before redirecting the user, save it in a secure cookie, and verify it when they return.</p><pre>// 1. Generate random state<br>const state = generateRandomString();<br>saveStateToCookie(state);<br><br>// 2. Send user to provider<br>window.location = `https://idp.com/authorize?state=${state}&amp;...`;<br><br>// 3. On callback, verify<br>const returnedState = getQueryParam(&#39;state&#39;);<br>const savedState = getStateFromCookie();<br><br>if (returnedState !== savedState) {<br>    throw new Error(&quot;Security Alert: State mismatch! Possible CSRF attack.&quot;);<br>}</pre><h3>Replay Attacks and Nonce</h3><p>A <strong>Replay Attack</strong> occurs if an attacker intercepts a valid ID Token and tries to use it again later to impersonate the user. The nonce (number used once) parameter mitigates this. You send a random nonce in the request, and the IdP includes that same nonce inside the signed ID Token. If the nonce in the token doesn&#39;t match the one you sent, the token is rejected.</p><h3>Real-World Implementation</h3><p>In my work developing a SaaS platform for Call Centers, we faced a challenge. We needed to onboard enterprise clients who had thousands of agents. Creating users manually was impossible, and password management was a nightmare.</p><p>We decided to double down on OIDC. Because the protocol is standardized and modern, we were able to build integrations for <strong>OneLogin</strong> and <strong>Azure AD (Microsoft Entra ID)</strong> with surprising ease.</p><p>The consistency of OIDC meant that the code we wrote to handle the handshake with OneLogin was 95% identical to the code needed for Azure. The only changes were the endpoints and the specific scopes required. This allowed us to roll out Enterprise SSO to our largest clients in weeks, not months.</p><p>For any SaaS company looking to move upmarket, OIDC isn’t just a technical specification; it’s a competitive advantage. It offers the security enterprises demand with the flexibility developers love.</p><h3>References &amp; Official Specifications</h3><p>For those interested in diving deeper into the protocols discussed, here are the official sources of truth:</p><ul><li><strong>OpenID Connect Core 1.0 Specification</strong> The definitive guide to how OIDC works, including the authentication flow and ID Token structure. <a href="https://openid.net/specs/openid-connect-core-1_0.html">https://openid.net/specs/openid-connect-core-1_0.html</a></li><li><strong>RFC 6749: The OAuth 2.0 Authorization Framework</strong> The Internet Engineering Task Force (IETF) standard defining OAuth 2.0. <a href="https://datatracker.ietf.org/doc/html/rfc6749">https://datatracker.ietf.org/doc/html/rfc6749</a></li><li><strong>RFC 7519: JSON Web Token (JWT)</strong> The standard defining the compact, URL-safe means of representing claims to be transferred between two parties, used heavily in OIDC ID Tokens. <a href="https://datatracker.ietf.org/doc/html/rfc7519">https://datatracker.ietf.org/doc/html/rfc7519</a></li><li><strong>OASIS SAML v2.0 Standard</strong> The official standards documents for Security Assertion Markup Language version 2.0. <a href="http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf">http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb7a558fce23" width="1" height="1" alt=""><hr><p><a href="https://medium.com/call-center-studio/sso-with-oidc-a-secure-login-approach-cb7a558fce23">SSO with OIDC: A Secure Login Approach</a> was originally published in <a href="https://medium.com/call-center-studio">Call Center Studio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Global Redundancy: Failover Architecture with Azure and Google Cloud]]></title>
            <link>https://medium.com/call-center-studio/global-redundancy-failover-architecture-with-azure-and-google-cloud-00c5900ccd39?source=rss----60847e130fc5---4</link>
            <guid isPermaLink="false">https://medium.com/p/00c5900ccd39</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[system-design-project]]></category>
            <category><![CDATA[multi-cloud-architecture]]></category>
            <category><![CDATA[high-availability]]></category>
            <dc:creator><![CDATA[Hasan Dalkılıç]]></dc:creator>
            <pubDate>Tue, 30 Dec 2025 11:32:02 GMT</pubDate>
            <atom:updated>2025-12-30T11:32:35.071Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cQnlwr3Dq9A4h8GCgIHQZw.png" /></figure><p>In this article, we examine the “multi-cloud failover/failback” structure we developed for our clients operating on a global scale, for whom even minimal downtime is critical. Inspired by the “Voltron” animated character of the 1990s — where separate parts combine to form a powerful whole — we have brought together two powerful actors of the cloud world: <a href="https://medium.com/u/be36e94a7e47">Google</a> <strong>Cloud</strong> and <strong>Azure</strong> Cloud.</p><h3>Abstract: Global Risks and the Availability Paradox</h3><p>The continuity of digital services is one of the most critical KPIs in the modern business world. However, recent global and regional outages experienced by giant infrastructure providers like Cloudflare have painfully demonstrated that even systems considered the most reliable can harbor a “<strong>Single Point of Failure” (SPOF)</strong>.</p><p>Specifically, the slowness of DNS-based load balancing systems in responding to sudden outages — due to caching and TTL (Time-to-Live) durations — poses an unacceptable risk for modern applications.</p><p>This study addresses the <strong>High Availability (HA)</strong> architecture we designed for our clients serving a global audience, gathering geographic boundaries and multiple cloud providers under a single roof. The study technically examines how traffic is transported over the Google Backbone network with<strong> Google Cloud Load Balancing (GCLB) </strong>and <strong>Anycast IP</strong> technology at the center, the management of hybrid resources via <strong>Internet NEG</strong> technology, and how a sustainable CI/CD cycle is established with<strong> Bitbucket Pipelines</strong>.</p><h3>Methodology: A Borderless and Hybrid Architecture Design</h3><p>The fundamental technical challenge of the project was as follows: <em>“Regardless of where the user is in the world, they should connect to a single IP address, and the traffic should automatically flow to the healthiest cloud provider (Google or Azure) in the background.”</em></p><p>To achieve this goal, the<strong> Google Cloud Global Load Balancer</strong> with Anycast technology was chosen over classic DNS routing. This architecture consists of three main pillars: <strong>Traffic Management, Hybrid Connectivity, and Automation</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*H5qy4zaVCoZG5GAn4o5eIA.png" /></figure><p><strong>1. Traffic Management and Anycast Backbone</strong></p><p>In traditional architectures, traffic reaches the server over the public internet, passing through multiple ISPs (Internet Service Providers) during this journey. This increases the risk of latency and packet loss. In our solution, however:</p><ul><li>Traffic is ingested at the nearest <strong>Google Edge</strong> location to the user, thanks to the <strong>Anycast IP</strong>.</li><li>The request is transported over Google’s private fiber optic network (Backbone) instead of the public internet.</li><li>Processed at Layer 7 (HTTP/S) and Layer 4 (TCP/UDP) levels, <strong>SSL Offloading</strong> is performed directly on the load balancer.</li></ul><p><strong>2. Multi-Cloud Integration: Network Endpoint Groups (NEG)</strong></p><p>The most critical R&amp;D component of the project is the management of resources outside of Google Cloud using a hybrid method. We achieved this through the <strong>Internet NEG (Network Endpoint Group)</strong> structure.</p><ul><li><strong>Internet NEG</strong>: Allows us to define container apps on Azure as specific “endpoints.”</li><li><strong>Serverless NEG</strong>: Incorporates serverless architectures, such as Google Cloud Run, into the backend pool without requiring IP management.</li></ul><p>Thanks to this structure, we can host both Google Cloud Run services and Azure container apps simultaneously under a single Backend Service.</p><p><strong>3. Sustainability and Automation: Multi-Cloud CI/CD Strategy</strong></p><p>Establishing a high-availability architecture is as critical as ensuring the application running on it remains up-to-date across all environments. The biggest risk in Multi-Cloud structures is “<strong>Version Drift</strong>”; meaning, if the failover system runs an outdated code version during an outage, it could lead to disaster.</p><p>To eliminate this risk, a centralized distribution pipeline was established on <strong>Bitbucket Pipelines</strong>:</p><ul><li><strong>Build Once, Deploy Everywhere</strong>: The Docker image created when the code is compiled is sent simultaneously to both the Google Artifact Registry and the Azure Container Registry.</li><li><strong>Atomic Deployments</strong>: The pipeline updates services in both cloud environments simultaneously using gcloud and az cli tools.</li></ul><blockquote><strong>Sample Pipeline Snippet</strong> (bitbucket-pipelines.yml):</blockquote><pre>step:<br>  name: Multi-Cloud Deployment Sync<br>  script:<br>    - pipe: atlassian/google-cloud-run-deploy:1.0.1<br>      variables:<br>        SERVICE: &#39;production-service&#39;<br>        IMAGE: &#39;gcr.io/company-repo/app:$BITBUCKET_COMMIT&#39;<br>    - pipe: atlassian/azure-web-apps-deploy:1.0.3<br>      variables:<br>        APP_NAME: &#39;failover-service-eu&#39;<br>        DOCKER_IMAGE: &#39;gcr.io/company-repo/app:$BITBUCKET_COMMIT&#39;</pre><h3>Findings and Implementation: Failover Scenarios</h3><p>The established architecture was tested in “Active-Active” and “Active-Passive” scenarios. The findings demonstrate the resilience of the system.</p><p><strong>1. Regional Outage and Automatic Recovery (Failover)</strong></p><p>The Health Check mechanism can be configured to check backend services every 5 seconds, or a manual switch can be performed.</p><ul><li><strong>Scenario</strong>: A cessation of response from the service in the Google Frankfurt (eu-central-1) region was simulated.</li><li><strong>Result</strong>: The Load Balancer detected the <strong>50x errors</strong> and redirected traffic to the backup on Azure (West Europe) within approximately<strong> 60–90 seconds</strong>. No DNS cache clearing was required on the user side.</li></ul><p><strong>2. Data Consistency and Synchronization</strong></p><p>Unlike stateless applications, failover is difficult in systems containing databases. In this project, <strong>CDC (Change Data Capture) </strong>methods were used for data layer synchronization.</p><ul><li><strong>Tools</strong>: Near real-time data replication was achieved between Google Cloud SQL (Master) and Azure SQL (Replica) using <strong>Azure DMS</strong>.</li></ul><p>Consequently, when application traffic turned to Azure, the data was ready, up-to-date, and consistent.</p><h3><strong>Conclusion and Sectoral Implications</strong></h3><p>The “<strong>Single IP, Multi-Cloud Redundancy</strong>” architecture realized in this study embodies our company’s technical vision and the solutions it brings to complex problems. The primary gains obtained are:</p><ul><li><strong>Independence</strong> <strong>(No Vendor Lock-in)</strong>: We possess the freedom to pull traffic to another cloud under our control in the face of global problems that may occur with giants like Cloudflare or Google.</li><li><strong>Operational</strong> <strong>Excellence</strong>: Thanks to IP reservation and a single gateway, background infrastructure changes (Migration, Scaling) do not affect clients or DNS records.</li><li><strong>Zero</strong> <strong>Downtime</strong>: Disaster recovery scenarios have ceased to be a process requiring “manual intervention” and have evolved into an “autonomous” structure.</li></ul><p><em>in Turkish version: </em><a href="https://siriusstar17.medium.com/global-yedeklilik-azure-ve-google-cloud-ile-failover-mimarisi-13d71122973d">https://siriusstar17.medium.com/global-yedeklilik-azure-ve-google-cloud-ile-failover-mimarisi-13d71122973d</a></p><h3>References</h3><ul><li><a href="https://docs.cloud.google.com/load-balancing/docs/load-balancing-overview">Cloud Load Balancing overview | Google Cloud Documentation</a></li><li><a href="https://docs.cloud.google.com/load-balancing/docs/negs/internet-neg-concepts">Internet network endpoint groups overview | Cloud Load Balancing | Google Cloud Documentation</a></li><li><a href="https://support.atlassian.com/bitbucket-cloud/docs/deploy-to-microsoft-azure/">Deploy to Microsoft Azure | Bitbucket Cloud | Atlassian Support</a></li></ul><p><a href="https://azure.microsoft.com/en-us/products/database-migration"><em>https://azure.microsoft.com/en-us/products/database-migratio</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00c5900ccd39" width="1" height="1" alt=""><hr><p><a href="https://medium.com/call-center-studio/global-redundancy-failover-architecture-with-azure-and-google-cloud-00c5900ccd39">Global Redundancy: Failover Architecture with Azure and Google Cloud</a> was originally published in <a href="https://medium.com/call-center-studio">Call Center Studio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>