<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Seyhun's Substack]]></title><description><![CDATA[My personal Substack]]></description><link>https://seyhunak.substack.com</link><image><url>https://substackcdn.com/image/fetch/$s_!9A3c!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0eba147-cc6d-4be8-9cdf-622331886ec2_1200x1200.png</url><title>Seyhun&apos;s Substack</title><link>https://seyhunak.substack.com</link></image><generator>Substack</generator><lastBuildDate>Tue, 30 Jun 2026 18:29:41 GMT</lastBuildDate><atom:link href="https://seyhunak.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Seyhun]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[seyhunak@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[seyhunak@substack.com]]></itunes:email><itunes:name><![CDATA[Seyhun Akyurek]]></itunes:name></itunes:owner><itunes:author><![CDATA[Seyhun Akyurek]]></itunes:author><googleplay:owner><![CDATA[seyhunak@substack.com]]></googleplay:owner><googleplay:email><![CDATA[seyhunak@substack.com]]></googleplay:email><googleplay:author><![CDATA[Seyhun Akyurek]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Building an AI Security Operations Center (AI-SOC)]]></title><description><![CDATA[Building a modern, AI-driven Security Operations Center (AI-SOC) means shifting from a reactive, human-led alert clearing house to a proactive, machine-speed defense engine.]]></description><link>https://seyhunak.substack.com/p/building-an-ai-security-operations</link><guid isPermaLink="false">https://seyhunak.substack.com/p/building-an-ai-security-operations</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Mon, 29 Jun 2026 10:49:09 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!hBt6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F083cba65-65a7-4f3d-860c-b41aa7fcd45e_1080x1350.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Building a modern, AI-driven Security Operations Center (AI-SOC) means shifting from a <strong>reactive, human-led alert clearing house</strong> to a <strong>proactive, machine-speed defense engine</strong>.</p><p>In a traditional SOC, Tier 1 analysts spend 80% of their time chasing false positives. An AI-SOC flips this paradigm: AI handles ingestion, context-enrichment, and initial triage, freeing your human experts to focus entirely on hunting complex, multi-stage threats and engineering better defensive playbooks.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hBt6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F083cba65-65a7-4f3d-860c-b41aa7fcd45e_1080x1350.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hBt6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F083cba65-65a7-4f3d-860c-b41aa7fcd45e_1080x1350.jpeg 424w, https://substackcdn.com/image/fetch/$s_!hBt6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F083cba65-65a7-4f3d-860c-b41aa7fcd45e_1080x1350.jpeg 848w, https://substackcdn.com/image/fetch/$s_!hBt6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F083cba65-65a7-4f3d-860c-b41aa7fcd45e_1080x1350.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!hBt6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F083cba65-65a7-4f3d-860c-b41aa7fcd45e_1080x1350.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hBt6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F083cba65-65a7-4f3d-860c-b41aa7fcd45e_1080x1350.jpeg" width="1080" height="1350" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/083cba65-65a7-4f3d-860c-b41aa7fcd45e_1080x1350.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1350,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:107924,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/204094894?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F083cba65-65a7-4f3d-860c-b41aa7fcd45e_1080x1350.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hBt6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F083cba65-65a7-4f3d-860c-b41aa7fcd45e_1080x1350.jpeg 424w, https://substackcdn.com/image/fetch/$s_!hBt6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F083cba65-65a7-4f3d-860c-b41aa7fcd45e_1080x1350.jpeg 848w, https://substackcdn.com/image/fetch/$s_!hBt6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F083cba65-65a7-4f3d-860c-b41aa7fcd45e_1080x1350.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!hBt6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F083cba65-65a7-4f3d-860c-b41aa7fcd45e_1080x1350.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>1. Core Architectural Pillars</h2><p>An AI-SOC sits on top of your existing telemetry but restructures how data flows, how decisions are made, and how mitigations are pushed.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!c-gQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa102fb44-8780-4244-a5b3-677f164c6831_2048x1009.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!c-gQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa102fb44-8780-4244-a5b3-677f164c6831_2048x1009.jpeg 424w, https://substackcdn.com/image/fetch/$s_!c-gQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa102fb44-8780-4244-a5b3-677f164c6831_2048x1009.jpeg 848w, https://substackcdn.com/image/fetch/$s_!c-gQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa102fb44-8780-4244-a5b3-677f164c6831_2048x1009.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!c-gQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa102fb44-8780-4244-a5b3-677f164c6831_2048x1009.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!c-gQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa102fb44-8780-4244-a5b3-677f164c6831_2048x1009.jpeg" width="1456" height="717" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a102fb44-8780-4244-a5b3-677f164c6831_2048x1009.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:717,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Conceptual Blueprint of an AI-SOC Architecture, AI generated&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Conceptual Blueprint of an AI-SOC Architecture, AI generated" title="Conceptual Blueprint of an AI-SOC Architecture, AI generated" srcset="https://substackcdn.com/image/fetch/$s_!c-gQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa102fb44-8780-4244-a5b3-677f164c6831_2048x1009.jpeg 424w, https://substackcdn.com/image/fetch/$s_!c-gQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa102fb44-8780-4244-a5b3-677f164c6831_2048x1009.jpeg 848w, https://substackcdn.com/image/fetch/$s_!c-gQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa102fb44-8780-4244-a5b3-677f164c6831_2048x1009.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!c-gQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa102fb44-8780-4244-a5b3-677f164c6831_2048x1009.jpeg 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p><strong>The Telemetry Layer (Data Ingestion):</strong> Feeds from SIEM, XDR, cloud providers (AWS CloudTrail, Azure Monitor), IAM systems, and network flows.</p></li><li><p><strong>The AI Data Lake (Enrichment Engine):</strong> Traditional SIEMs parse logs using static regex. The AI-SOC standardizes raw telemetry into a unified schema (like OCSF - Open Cybersecurity Schema Framework) and automatically appends real-time context (threat intel, asset criticality, user behavior history).</p></li><li><p><strong>The Cognitive Layer (Decision Making):</strong> This is where specialized machine learning models and Large Language Models (LLMs) work in tandem to evaluate threats.</p></li><li><p><strong>The Orchestration Layer (Autonomous Action):</strong> Deep integration with SOAR (Security Orchestration, Automation, and Response) platforms to execute code, isolate hosts, and rotate keys without human intervention.</p></li></ul><h2>2. Advanced AI Capabilities</h2><p>An enterprise AI-SOC relies on a &#8220;hybrid AI&#8221; approach, combining deterministic Machine Learning with generative LLMs.</p><h3>Specialized ML Models (Deterministic)</h3><ul><li><p><strong>Graph-Based Attack Path Modeling:</strong> Graphs map out your entire infrastructure. If an attacker compromises a low-level service account, a graph neural network (GNN) calculates the most probable paths the attacker will take to reach the crown jewels (Active Directory, database clusters).</p></li><li><p><strong>Hyper-Dimensional Behavioral Baselines:</strong> Instead of simple thresholds (e.g., &#8220;User downloaded &gt;5GB of data&#8221;), ML models track hundreds of dimensions per entity (time of day, API calling patterns, velocity of asset switching) to catch subtle data exfiltration.</p></li></ul><h3>Generative AI &amp; LLMs (Heuristic &amp; Interface)</h3><ul><li><p><strong>Automated Case Synthesizers:</strong> When a multi-stage alert fires, an LLM reviews the entire log history, raw packets, and timeline, translating it into a highly detailed incident narrative for Tier 2/3 analysts.</p></li><li><p><strong>Dynamic Playbook Generation:</strong> If a novel threat appears that your standard SOAR playbooks don&#8217;t cover, the LLM analyzes the threat mechanics and drafts a custom mitigation script on the fly for human approval.</p></li></ul><h2>3. The Incident Lifecycle Workflow</h2><p>This is how an incident moves through an AI-SOC entirely at machine-speed.</p><p><strong><span>1.Ingestion &amp; Normalization:</span></strong><span>Milliseconds.</span></p><p>Raw logs hit the pipeline. The streaming ingestion engine converts them to a common schema and checks them against an automated deduplication model to prevent alert storms.</p><p><strong><span>2.Contextual Enrichment:</span></strong><span>Under 2 Seconds.</span></p><p>The engine fetches external threat intelligence (e.g., active malicious IPs), cross-references internal CMDB (Configuration Management Database) registries to assess the asset&#8217;s vulnerability patch history, and assigns an automated &#8220;Blast Radius Score.&#8221;</p><p><strong><span>3.Autonomous Triage &amp; Risk Scoring:</span></strong><span>Under 5 Seconds.</span></p><p>The cognitive models analyze the enriched alert. If the confidence score hits a threshold of &gt;95% malicious probability, it escalates to the autonomous response engine. If it is ambiguous, it is grouped into an unified &#8220;Incident Story&#8221; and flagged for a human analyst.</p><p><strong><span>4.Automated Containment:</span></strong><span>Sub-minute Execution.</span></p><p>The SOAR framework fires API calls to lock down the threat. For example, it simultaneously revokes the compromised OAuth token via IAM, blocks the malicious IP at the edge firewall, and moves the infected EC2 instance into an isolated quarantine VPC.</p><h2>4. Operational Comparison</h2><p>Here is the operational breakdown comparing a legacy SOC to an AI-Native SOC:</p><ul><li><p><strong>False Positive Noise Reduction</strong></p><ul><li><p><strong>Legacy SOC:</strong> High volumes of alert noise create systemic analyst fatigue. Minor alerts must be manually grouped or filtered using rigid, static regex rules.</p></li><li><p><strong>AI-Native SOC:</strong> Achieves up to an <strong>85% reduction</strong> in noise. The triage agent uses semantic context to autonomously deduplicate and close out low-severity, benign-true positives before they ever hit a human queue.</p></li></ul></li><li><p><strong>Mean Time to Detect (MTTD)</strong></p><ul><li><p><strong>Legacy SOC:</strong> Typically <strong>15 to 30 minutes</strong>. Analysts must bounce across multiple security dashboards (EDR, firewall, identity logs) to assemble an attack timeline manually.</p></li><li><p><strong>AI-Native SOC:</strong> Reduced to <strong>under 30 seconds</strong>. A centralized RAG pipeline automatically pulls and cross-correlates multi-silo signals into a unified data structure the millisecond a telemetry threshold is crossed.</p></li></ul></li><li><p><strong>Mean Time to Respond (MTTR)</strong></p><ul><li><p><strong>Legacy SOC:</strong> Averages <strong>1 to 4 hours</strong>. Mitigating a threat usually requires human escalation, script drafting, or manual coordination with separate network and infrastructure teams.</p></li><li><p><strong>AI-Native SOC:</strong> Executed in <strong>under 5 minutes</strong>. The mitigation agent generates target-specific containment scripts or API calls, executing low-risk playbooks completely autonomously and routing high-risk actions to an interactive approval window.</p></li></ul></li><li><p><strong>Analyst Leverage Ratio</strong></p><ul><li><p><strong>Legacy SOC:</strong> Scales linearly, requiring roughly <strong>1 analyst per 500 endpoints</strong> to maintain proper coverage. This traps Tier 1 personnel in a continuous cycle of copy-pasting data.</p></li><li><p><strong>AI-Native SOC:</strong> Scales exponentially, allowing <strong>1 analyst to protect over 5,000 endpoints</strong>. The machine manages repetitive tier-1 tasks, freeing up human engineering talent to focus entirely on advanced threat hunting and defense architecture.</p></li></ul></li></ul><h2>5. Deployment Checklist &amp; Milestones</h2><p>Building an AI-SOC is an iterative process. Avoid turning on autonomous blocking on day one; instead, follow a structured maturity model.</p><h3>Phase 1: Foundation &amp; Visibility (Months 1&#8211;3)</h3><ul><li><p>Deploy an open schema data lake (e.g., Apache Iceberg, Snowflake) to house security logs cleanly.</p></li><li><p>Implement behavioral anomaly models for high-risk vectors (Identity/IAM, Endpoint EDR).</p></li><li><p>Run AI in <strong>Shadow Mode</strong>: let the models score alerts and draft playbooks silently in the background, comparing their accuracy against human decisions.</p></li></ul><h3>Phase 2: Directed Automation (Months 4&#8211;6)</h3><ul><li><p>Connect GenAI engines to your ticketing and SIEM system to auto-summarize incidents.</p></li><li><p>Deploy human-in-the-loop automation: the AI creates the mitigation plan, but a human must click &#8220;Approve&#8221; to execute the firewall block or account suspension.</p></li></ul><h3>Phase 3: Fully Autonomous SOC (Months 7+)</h3><ul><li><p>Unleash low-risk autonomous containment playbooks (e.g., auto-isolating a known malware-infected workstation outside business hours).</p></li><li><p>Establish continuous automated testing via breach and attack simulation (BAS) tools to train and fine-tune your AI models against changing threat landscapes.</p></li></ul><blockquote><p><strong>A Note on Guardrails:</strong> Never let an LLM directly generate or execute system code without a deterministic parser or policy engine (like Open Policy Agent) validating the payload structure first. This prevents the AI from being manipulated via prompt injection or making catastrophic errors on critical infrastructure.</p></blockquote><p></p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Seyhun's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/building-an-ai-security-operations?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Thanks for reading Seyhun's Substack! This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/building-an-ai-security-operations?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://seyhunak.substack.com/p/building-an-ai-security-operations?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><p></p>]]></content:encoded></item><item><title><![CDATA[Building an AI Security Pipeline: Autonomous DevSecOps ]]></title><description><![CDATA[The concept of an AI Security Pipeline Agent represents the next major paradigm shift in DevSecOps.]]></description><link>https://seyhunak.substack.com/p/building-an-ai-security-pipeline</link><guid isPermaLink="false">https://seyhunak.substack.com/p/building-an-ai-security-pipeline</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Sat, 27 Jun 2026 16:34:10 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lwVl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd59ca8d8-fb1c-4b5a-9623-d776388b2a4f_1080x1350.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The concept of an <strong>AI Security Pipeline Agent</strong> represents the next major paradigm shift in DevSecOps. We are moving away from <em>automated</em> security (which relies on static rules, pre-configured thresholds, and massive piles of noisy alerts) and moving toward <em>autonomous</em> security (where an LLM-driven agent understands context, reasons about threat vectors, and actively patches vulnerabilities).</p><p>If you are building an agentic security pipeline today, you are essentially moving up the evolutionary ladder from a linear CI/CD plugin to a loop-based <strong>Reasoning Engine</strong>.</p><p>Here is a breakdown of the architectural blueprint, the core engineering challenges, and how to structure an autonomous DevSecOps agent.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lwVl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd59ca8d8-fb1c-4b5a-9623-d776388b2a4f_1080x1350.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lwVl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd59ca8d8-fb1c-4b5a-9623-d776388b2a4f_1080x1350.jpeg 424w, https://substackcdn.com/image/fetch/$s_!lwVl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd59ca8d8-fb1c-4b5a-9623-d776388b2a4f_1080x1350.jpeg 848w, https://substackcdn.com/image/fetch/$s_!lwVl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd59ca8d8-fb1c-4b5a-9623-d776388b2a4f_1080x1350.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!lwVl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd59ca8d8-fb1c-4b5a-9623-d776388b2a4f_1080x1350.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lwVl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd59ca8d8-fb1c-4b5a-9623-d776388b2a4f_1080x1350.jpeg" width="1080" height="1350" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d59ca8d8-fb1c-4b5a-9623-d776388b2a4f_1080x1350.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1350,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:114104,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/203855596?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd59ca8d8-fb1c-4b5a-9623-d776388b2a4f_1080x1350.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lwVl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd59ca8d8-fb1c-4b5a-9623-d776388b2a4f_1080x1350.jpeg 424w, https://substackcdn.com/image/fetch/$s_!lwVl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd59ca8d8-fb1c-4b5a-9623-d776388b2a4f_1080x1350.jpeg 848w, https://substackcdn.com/image/fetch/$s_!lwVl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd59ca8d8-fb1c-4b5a-9623-d776388b2a4f_1080x1350.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!lwVl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd59ca8d8-fb1c-4b5a-9623-d776388b2a4f_1080x1350.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2><strong>1. From Linear CI/CD to the Agentic Loop</strong></h2><p>Traditional DevSecOps inserts static scanning tools (SAST, DAST, SCA) into a linear pipeline. If a tool finds a high-severity vulnerability, it breaks the build, throwing a generic alert over the fence to developers.</p><p>An <strong>AI Security Agent</strong> operates on a dynamic <strong>Perceive-Reason-Act</strong> loop. It treats the repository, pipeline logs, and runtime environment as its state space, using tools to actively investigate and remediate issues.</p><p><strong>AI Security Pipeline Agent &#8212; Key Capabilities</strong></p><ul><li><p>Perceive &#8594; Reason &#8594; Act loop replaces traditional linear DevSecOps pipelines</p></li><li><p>Ingests signals from SAST, DAST, SCA, runtime telemetry, and infrastructure logs</p></li><li><p>Builds ASTs, dependency graphs, and attack-path models for full context understanding</p></li><li><p>Prioritizes vulnerabilities based on real exploitability and reachability, not just CVSS scores</p></li><li><p>Reduces false positives through contextual and runtime-aware analysis</p></li><li><p>Generates secure code patches automatically using LLM-based remediation</p></li><li><p>Validates fixes using unit, integration, regression, and security test suites</p></li><li><p>Produces ready-to-merge pull requests with full impact analysis</p></li><li><p>Runs all execution inside isolated sandbox environments for safety</p></li><li><p>Defends against prompt injection and untrusted inputs in the pipeline</p></li><li><p>Applies human approval gates for high-risk changes</p></li><li><p>Continuously learns from developer feedback and past remediation outcomes</p></li><li><p>Significantly reduces MTTR (Mean Time to Remediate) from weeks to minutes</p></li><li><p>Shifts DevSecOps from static scanning to autonomous security engineering</p></li></ul><h2><strong>2. Core Architecture Blueprint</strong></h2><p>To build a reliable security agent, a single monolithic prompt will not suffice. You need a multi-agent or a tightly scoped single-agent system with a deterministic execution wrapper. Using frameworks like <strong>LangGraph</strong> or <strong>CrewAI</strong> allows you to orchestrate specialized nodes.</p><h2><strong>The Component Stack</strong></h2><ul><li><p><strong>The Router / Triage Agent:</strong> Consumes raw alerts from traditional scanners (e.g., Trivy, Semgrep, SonarQube). It filters out the noise by analyzing the runtime context &#8212; asking, <em>&#8220;Is this vulnerable function actually reachable in our production execution path?&#8221;</em></p></li><li><p><strong>The Analyst / Exploitation Agent:</strong> Simulates a localized penetration tester. It writes short test scripts or uses LLM-generated payloads in an isolated sandbox to verify if a vulnerability is truly exploitable before interrupting a developer.</p></li><li><p><strong>The Patching Agent:</strong> Utilizing specialized code models, it generates a precise code fix, ensuring it adheres to the repository&#8217;s specific code style and dependency constraints.</p></li><li><p><strong>The Verifier Agent:</strong> Runs the existing test suite against the patched code and generates regression tests to ensure the security fix didn&#8217;t break core business logic.</p></li></ul><h2><strong>3. The Technical Execution Workflow</strong></h2><p>Here is how a high-functioning autonomous DevSecOps agent handles a critical vulnerability (e.g., an unauthenticated remote code execution or a critical dependency flaw) without human intervention:</p><p><strong>1.Context Ingestion &amp; Graph Mapping:</strong></p><p>The agent detects a vulnerability alert. Instead of just reading the flagged line of code, it parses the <strong>Abstract Syntax Tree (AST)</strong> and builds a dependency call graph to trace user input from the API gateway down to the vulnerable sink.</p><p><strong>2. Exploitability &amp; Reachability Analysis</strong></p><p>The agent determines if the vulnerable code path is exposed. If it&#8217;s a vulnerable library that is imported but never called, the agent downgrades the priority, drastically reducing false-positive fatigue.</p><p><strong>3. Sandbox Patch Generation</strong></p><p>If exploitable, the agent spins up a secure fork. It generates a localized patch (e.g., rewriting an unsafe SQL query into a parameterized query or safely upgrading a breaking semantic version package).</p><p><strong>4. Automated Verification &amp; PR Compilation</strong></p><p>The agent runs unit tests, integration tests, and reruns the security scanners against the patch. If tests pass and the scanner goes green, it auto-compiles a Pull Request complete with an impact analysis report for the engineering team.</p><h2><strong>4. Crucial Engineering Guardrails</strong></h2><p>Building autonomous agents with write-access to codebases and infrastructure introduces obvious security risks. Implementing strict guardrails is non-negotiable:</p><h2><strong>Deterministic Sandboxing</strong></h2><p>Never let your patching or exploitation agents run commands directly on your primary runner or production infrastructure. Use ephemeral, isolated containers (like AWS Lambda, Docker inside gVisor, or MicroVMs) with completely restricted network access to execute LLM-generated code or tests.</p><h2><strong>Prompt Injection &amp; Tainted Input Defense</strong></h2><p>Security agents handle malicious inputs (like parsing untrusted code, exploit payloads, or dirty issue logs). Treat all data ingested by the pipeline as untrusted. Utilize an independent LLM guardrail layer or hardcoded regex verifiers to intercept potential indirect prompt injections designed to make your agent exfiltrate environment secrets.</p><h2><strong>Human-in-the-Loop (HITL) for High-Impact Actions</strong></h2><p>While the goal is autonomy, implement a tiered trust system.</p><ul><li><p><strong>Low Risk:</strong> (e.g., Upgrading an isolated non-breaking dependency) -&gt; Auto-merge to dev branch.</p></li><li><p><strong>Medium/High Risk:</strong> (e.g., Structural code rewrites or updating public API signatures) -&gt; Require a single-click human approval via a Slack webhook or GitHub PR review before merge.</p></li></ul><h2><strong>The Ultimate Value Metric</strong></h2><p>The success of an AI Security Pipeline Agent isn&#8217;t measured by how many bugs it finds, but by the collapse of your <strong>Mean Time to Remediate (MTTR)</strong>. By offloading triage, reachability analysis, and initial patch drafting to an autonomous agent, organizations can shrink their vulnerability window from weeks to minutes &#8212; finally allowing security to move at the true speed of continuous deployment.</p>]]></content:encoded></item><item><title><![CDATA[Architecting the Future: Inside the 6-Layer Zero-Trust AI Architecture]]></title><description><![CDATA[The AI gold rush is officially here, and organizations are deploying Large Language Models (LLMs), AI agents, and generative pipelines at breakneck speed.]]></description><link>https://seyhunak.substack.com/p/architecting-the-future-inside-the</link><guid isPermaLink="false">https://seyhunak.substack.com/p/architecting-the-future-inside-the</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Thu, 25 Jun 2026 14:59:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6vNh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d69533a-b7b4-4255-9d48-6ea82683065c_1080x1350.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The AI gold rush is officially here, and organizations are deploying Large Language Models (LLMs), AI agents, and generative pipelines at breakneck speed. But here&#8217;s the harsh reality: <strong>traditional security models are completely unequipped for the era of AI.</strong> When you introduce AI into your enterprise tech stack, you aren&#8217;t just adding another software application; you&#8217;re introducing a non-deterministic, highly dynamic system that ingests, processes, and potentially exposes massive amounts of sensitive data.</p><p>Traditional perimeter defenses rely on static code boundaries, structured databases, and predictable data paths. AI architectures, however, rely on unstructured prompts, complex neural weights, and autonomous orchestration layers. To safely leverage AI without handing over the keys to your enterprise kingdom, you need a comprehensive <strong>Zero-Trust AI Architecture</strong>. Built on the core philosophy of <em>&#8220;never trust, always verify,&#8221;</em> this framework assumes that every user, prompt, model artifact, training dataset, and API call is a potential vector for compromise.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6vNh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d69533a-b7b4-4255-9d48-6ea82683065c_1080x1350.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6vNh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d69533a-b7b4-4255-9d48-6ea82683065c_1080x1350.jpeg 424w, https://substackcdn.com/image/fetch/$s_!6vNh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d69533a-b7b4-4255-9d48-6ea82683065c_1080x1350.jpeg 848w, https://substackcdn.com/image/fetch/$s_!6vNh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d69533a-b7b4-4255-9d48-6ea82683065c_1080x1350.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!6vNh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d69533a-b7b4-4255-9d48-6ea82683065c_1080x1350.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6vNh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d69533a-b7b4-4255-9d48-6ea82683065c_1080x1350.jpeg" width="1080" height="1350" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3d69533a-b7b4-4255-9d48-6ea82683065c_1080x1350.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1350,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:122932,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/203530373?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d69533a-b7b4-4255-9d48-6ea82683065c_1080x1350.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6vNh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d69533a-b7b4-4255-9d48-6ea82683065c_1080x1350.jpeg 424w, https://substackcdn.com/image/fetch/$s_!6vNh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d69533a-b7b4-4255-9d48-6ea82683065c_1080x1350.jpeg 848w, https://substackcdn.com/image/fetch/$s_!6vNh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d69533a-b7b4-4255-9d48-6ea82683065c_1080x1350.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!6vNh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d69533a-b7b4-4255-9d48-6ea82683065c_1080x1350.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Here is an architectural, deep-dive breakdown of how to build and implement a hardened six-layer security pipeline for enterprise AI environments.</p><h2>The Deep-Dive 6-Layer Zero-Trust AI Framework</h2><p>To secure enterprise AI, defenses must wrap around the entire data and compute lifecycle. This means protecting the pipeline from the employee typing a query at their desk, through the semantic data retrieval systems, down to the actual silicon clusters processing the math.</p><h3>1. The User &amp; Device Layer (The Perimeter)</h3><p>Security begins before a single token is ever generated. This layer establishes a dynamic perimeter, ensuring that only explicitly verified identities operating on trusted, monitored, and compliant endpoints can interact with corporate AI interfaces or internal API gateways.</p><ul><li><p><strong>Continuous Adaptive Authentication &amp; Risk Engine:</strong> Moving away from static, one-time Multi-Factor Authentication (MFA) logins. User sessions are continuously evaluated by a risk engine analyzing typing biometrics, geolocation drift, time-of-day anomalies, and session token integrity. If an active session displays anomalous behavioral patterns, the architecture triggers a step-up authentication challenge (e.g., FIDO2 hardware token request) or instantly revokes the session.</p></li><li><p><strong>Device Posture &amp; EDR Integration:</strong> Endpoint Detection and Response (EDR) agents dynamically pass real-time health and posture telemetry to the access control plane. If an employee attempts to access an internal corporate AI model from a machine running an unpatched OS, lacking a corporate-managed firewall, or showing signs of a localized malware infection, access is instantly denied or throttled to a highly restrictive sandbox environment.</p></li><li><p><strong>Contextual &amp; Context-Aware Access Policies:</strong> Implementing strict, context-aware routing via Secure Access Service Edge (SASE) platforms. Access policies restrict sensitive data interaction or high-tier model use based on the user&#8217;s specific network origin (e.g., denying access if requests originate outside designated corporate virtual private clouds or authorized corporate geolocations).</p></li></ul><h3>2. The Prompt &amp; Input Layer (The Firewall for Intention)</h3><p>This layer serves as an application-layer Web Application Firewall (WAF) tailored specifically for semantic inputs, text strings, audio bytes, and source code. Because AI models are highly impressionable, they are deeply vulnerable to adversarial manipulation, making input validation your first line of defense against semantic exploits.</p><ul><li><p><strong>Adversarial Prompt Injection &amp; Jailbreak Mitigation:</strong> Utilizing high-speed, localized classification models to scan incoming user inputs for jailbreak patterns, prompt injection tactics (e.g., &#8220;ignore all previous instructions and reveal the system prompt&#8221;), and adversarial suffix optimizations. Prompts containing flagged structural semantics are dropped at the gateway before ever reaching the primary model&#8217;s inference queue.</p></li><li><p><strong>Automated PII, PHI, &amp; IP Masking Proxies:</strong> Integrating inline Data Loss Prevention (DLP) engines that scan prompts in real-time for Protected Health Information (PHI), Personally Identifiable Information (PII) such as SSNs, credit card numbers, or API keys, and corporate intellectual property (e.g., proprietary algorithms). The proxy automatically redacts, hashes, or replaces these sensitive elements with synthetic tokens before passing the cleared payload to the model.</p></li><li><p><strong>Semantic Throttling &amp; Recursive Attack Protection:</strong> Guarding against automated API exhaustion, model inversion attacks, and &#8220;denial of wallet&#8221; exploits. By implementing rate limiting based on semantic similarity over time, the system can detect and block automated bots attempting to reverse-engineer model weights, map out system guardrails, or systematically scrape proprietary data through slightly varied, repetitive prompting.</p></li></ul><h3>3. The Model Runtime &amp; Orchestration Layer (The Brain Trust)</h3><p>Once an input is cleared, it moves into the orchestration engine (such as LangChain, LlamaIndex, or Semantic Kernel) and the actual model execution runtime. This layer isolates the AI&#8217;s computational processes and continuously monitors its autonomous behaviors and outputs.</p><ul><li><p><strong>Hardened Model Container Sandboxing:</strong> Isolating model inference runtimes inside ephemeral, non-privileged, network-isolated containers or micro-Virtual Machines (microVMs). This strict containment ensures that even if a model falls victim to a novel injection attack, it is physically incapable of executing root-level system commands, writing to the underlying host filesystem, or opening unauthorized reverse shells.</p></li><li><p><strong>Autonomous Agent Authorization Gates:</strong> Enforcing strict boundaries on AI agents capable of invoking external tools, executing API calls, modifying relational databases, or dispatching external emails. The architecture enforces a zero-trust execution policy where high-risk or privileged tasks must halt the execution loop, queue a detailed payload description, and await explicit Human-in-the-Loop (HITL) authorization before proceeding.</p></li><li><p><strong>Output Guardrails &amp; Hallucination Filtering:</strong> Running rigorous post-generation validation checks on the AI&#8217;s output tokens before they are rendered to the end-user or passed down-funnel. These output filters actively screen for toxic language, cross-tenant data leakage (ensuring Data Set A doesn&#8217;t bleed into User B&#8217;s output), intellectual property or copyright violations, and blatant hallucinations that could create operational, financial, or legal liabilities.</p></li></ul><h3>4. The Data &amp; Vector Database Layer (The Memory Palace)</h3><p>Modern enterprise AI scales its utility through Retrieval-Augmented Generation (RAG)&#8212;a technique that allows models to pull fresh context from internal company databases, knowledge bases, and vector stores. Without strict zero-trust data mapping, an AI system can inadvertently become an uninhibited tool for massive internal privilege escalation.</p><ul><li><p><strong>Data-Centric Zero-Trust &amp; Metadata-Level RBAC:</strong> Ensuring that the AI retrieval engine explicitly respects and enforces the source document&#8217;s original Access Control Lists (ACLs). When a user issues a prompt, the RAG pipeline must automatically append user-identity metadata filters to the vector search query. If an entry-level employee queries the system, the vector database returns <em>only</em> embeddings derived from documents that the specific user has explicit read permissions to see, hiding sensitive executive files or financial spreadsheets by design.</p></li><li><p><strong>Semantic Vector Security &amp; Reconstruction Protections:</strong> Hardening the underlying vector infrastructure (such as Pinecone, Milvus, Chroma, or Qdrant). Because multi-dimensional vector embeddings can sometimes be reverse-engineered back into highly legible plain text via mathematical inversion, the vector databases must be isolated, encrypted at rest and in transit, and strictly subjected to the same identity management frameworks as traditional SQL/NoSQL systems.</p></li><li><p><strong>Immutable Data Lineage &amp; Lifecycle Auditing:</strong> Maintaining absolute tracking of which corporate datasets train, fine-tune, or supplement specific vector indices and model variants. This explicit data lineage allows security teams to cleanly isolate and systematically purge contaminated or legally disputed data blocks if a consumer files a GDPR &#8220;right to be forgotten&#8221; request, or if a data source faces copyright challenges.</p></li></ul><h3>5. The Infrastructure &amp; Compute Layer (The Metal)</h3><p>AI workloads are heavily reliant on high-performance compute arrays, including clusters of GPUs, TPUs, or NPUs. Securing the underlying physical and virtual compute fabrics prevents sophisticated, low-level exploits targeting raw memory and inter-node communications.</p><ul><li><p><strong>Hardware-Enforced Confidential Computing:</strong> Deploying models inside hardware-isolated Trusted Execution Environments (TEEs) or secure enclaves embedded within modern enterprise accelerators (e.g., NVIDIA H100/B200 Confidential Computing architectures). This ensures that sensitive prompt data, vector context, and proprietary model weights remain fully encrypted in memory even while actively being crunched by the processor cores, completely neutralizing cold-boot or memory-snooping attacks.</p></li><li><p><strong>Network Micro-segmentation &amp; Mandatory mTLS:</strong> Segregating the enterprise infrastructure into tightly bounded network segments. Inference nodes, training pipelines, vector databases, and application middleware are blocked from open horizontal communication. All data exchange across these segments requires explicit, mutually authenticated TLS (mTLS) handshakes using short-lived, cryptographically verified certificates issued by an internal corporate Certificate Authority (CA).</p></li><li><p><strong>Model Supply Chain Hardening &amp; Provenance:</strong> Mitigating risks associated with model supply chains. Every base model weight, container image, or open-source software dependency sourced from external repositories (such as Hugging Face or GitHub) must undergo rigid static analysis, CVE vulnerability scanning, and signature verification. Models are cryptographically signed upon entry into the internal environment to ensure that no tampering, malicious backdoors, or unvetted weights are introduced to production compute clusters.</p></li></ul><h3>6. The Governance, Audit, &amp; Monitoring Layer (The Watchtower)</h3><p>The final layer serves as the central nervous system for security observability, wrapping the prior five layers in an unbroken fabric of continuous logging, real-time tracking, and regulatory compliance alignment.</p><ul><li><p><strong>Shadow AI Discovery &amp; CASB Enforcement:</strong> Leveraging Cloud Access Security Brokers (CASBs) alongside deep packet inspection (DPI) at the secure web gateway to continuously discover, catalog, and monitor employee data flows. This system blocks unauthorized outreach to unapproved, public AI applications (Shadow AI), safely routing employees toward secure, corporate-vetted internal instances instead.</p></li><li><p><strong>Immutable AI Ledger &amp; SIEM Integration:</strong> Funneling every transaction&#8212;including user identity metadata, sanitization logs, exact raw prompts, precise vector retrieval documents, model responses, and execution costs&#8212;into a tamper-proof, immutable centralized log management platform. This telemetry stream integrates directly with corporate Security Information and Event Management (SIEM) systems to trigger alerts on anomalous behavior, provide comprehensive forensic trails during post-incident investigations, and satisfy strict regulatory compliance audits.</p></li><li><p><strong>Model Drift, Bias, &amp; Alignment Observability:</strong> Deploying specialized monitoring dashboards to track model behavior over prolonged operational lifecycles. This system detects mathematical model drift (the deterioration of output accuracy over time), unintended bias propagation, or subtle alignment shifts caused by data updates or underlying software changes, keeping the ecosystem closely aligned with corporate risk parameters and international AI governance frameworks.</p></li></ul><h2>Layer-by-Layer Threat &amp; Countermeasure Matrix</h2><h3>User &amp; Device Layer</h3><ul><li><p><strong>Primary Threat Vector:</strong> Stolen user credentials, session cookie hijacking, unauthorized device access, or advanced endpoint malware infection.</p></li><li><p><strong>Zero-Trust Countermeasure:</strong> Continuous identity risk evaluations, biometric behavior monitoring, device posture integration, and hardware-bound MFA constraints.</p></li></ul><h3>Prompt &amp; Input Layer</h3><ul><li><p><strong>Primary Threat Vector:</strong> Jailbreaks, adversarial prompt optimizations, payload splitting, and unintended entry of corporate secrets, PII, or PHI.</p></li><li><p><strong>Zero-Trust Countermeasure:</strong> External semantic input classification engines, inline pattern-matching/ML DLP proxies, and semantic token-rate limits.</p></li></ul><h3>Model Runtime Layer</h3><ul><li><p><strong>Primary Threat Vector:</strong> Unauthorized execution of backend system commands, rogue API usage by autonomous agents, and output generation of toxic or copyrighted material.</p></li><li><p><strong>Zero-Trust Countermeasure:</strong> Network-isolated, non-privileged microVM sandboxes, strict tool-execution authorization gates, and programmatic output validation guardrails.</p></li></ul><h3>Data &amp; Vector Layer</h3><ul><li><p><strong>Primary Threat Vector:</strong> Internal data exposure and horizontal privilege escalation via unrestricted RAG queries; vector-to-text inversion exploits.</p></li><li><p><strong>Zero-Trust Countermeasure:</strong> Identity-linked metadata filtering applied directly to vector queries, localized database encryption, and clean data lineage isolation.</p></li></ul><h3>Infrastructure Layer</h3><ul><li><p><strong>Primary Threat Vector:</strong> Lateral data center movement, malicious weight tampering via compromised repositories, and multi-tenant GPU memory snooping.</p></li><li><p><strong>Zero-Trust Countermeasure:</strong> TEE-enforced Confidential Computing architectures, cryptographically signed model verification pipelines, and mandatory micro-segmented mTLS routing.</p></li></ul><h3>Governance Layer</h3><ul><li><p><strong>Primary Threat Vector:</strong> Compliance violations with global AI safety regulations, unmonitored data output to public AI consumer tools, and silent model drift.</p></li><li><p><strong>Zero-Trust Countermeasure:</strong> Centralized AI proxy gateways, immutable log infrastructure, integrated SIEM alerts, and CASB-driven shadow AI discovery.</p></li></ul><h2>Moving Forward: Secure Acceleration</h2><p>Adopting a 6-layer Zero-Trust architecture isn&#8217;t about erecting roadblocks or slowing down your organization&#8217;s AI adoption&#8212;it&#8217;s about <strong>engineering the high-performance brakes that allow your business to safely drive faster</strong>. </p><p>By weaving continuous, layered verification around your identity planes, text inputs, computational runtimes, memory databases, hardware layers, and observability systems, you give your enterprise the robust, structural confidence to innovate aggressively without ever becoming tomorrow&#8217;s data breach headline.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Seyhun's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/architecting-the-future-inside-the?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Thanks for reading Seyhun's Substack! This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/architecting-the-future-inside-the?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://seyhunak.substack.com/p/architecting-the-future-inside-the?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><p></p>]]></content:encoded></item><item><title><![CDATA[Engineering Trust: A Blueprint for Deploying Generative AI in Regulated Banking]]></title><description><![CDATA[The race to integrate Generative AI into enterprise workflows is no longer about proving the technology works; it is about proving the technology is safe, compliant, and production-ready. This challenge multiplies exponentially in highly regulated sectors like banking, where data residency laws, strict financial compliance guidelines, and zero-tolerance policies for hallucinations govern every line of code.]]></description><link>https://seyhunak.substack.com/p/engineering-trust-a-blueprint-for</link><guid isPermaLink="false">https://seyhunak.substack.com/p/engineering-trust-a-blueprint-for</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Thu, 25 Jun 2026 08:29:34 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!dh4j!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd39112-010a-49ae-a966-45c3a794a002_1080x1350.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The race to integrate Generative AI into enterprise workflows is no longer about proving the technology works; it is about proving the technology is <strong>safe, compliant, and production-ready</strong>. This challenge multiplies exponentially in highly regulated sectors like banking, where data residency laws, strict financial compliance guidelines, and zero-tolerance policies for hallucinations govern every line of code.</p><p>For an <strong>AI Delivery perspective</strong>, transitioning a GenAI concept from an experimental blueprint to a secure banking environment requires more than traditional software engineering. It demands an enterprise-grade delivery framework that weaves governance, zero-trust architecture, and strict operational readiness together.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dh4j!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd39112-010a-49ae-a966-45c3a794a002_1080x1350.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dh4j!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd39112-010a-49ae-a966-45c3a794a002_1080x1350.jpeg 424w, https://substackcdn.com/image/fetch/$s_!dh4j!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd39112-010a-49ae-a966-45c3a794a002_1080x1350.jpeg 848w, https://substackcdn.com/image/fetch/$s_!dh4j!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd39112-010a-49ae-a966-45c3a794a002_1080x1350.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!dh4j!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd39112-010a-49ae-a966-45c3a794a002_1080x1350.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dh4j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd39112-010a-49ae-a966-45c3a794a002_1080x1350.jpeg" width="1080" height="1350" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ebd39112-010a-49ae-a966-45c3a794a002_1080x1350.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1350,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:141757,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/203483738?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd39112-010a-49ae-a966-45c3a794a002_1080x1350.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dh4j!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd39112-010a-49ae-a966-45c3a794a002_1080x1350.jpeg 424w, https://substackcdn.com/image/fetch/$s_!dh4j!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd39112-010a-49ae-a966-45c3a794a002_1080x1350.jpeg 848w, https://substackcdn.com/image/fetch/$s_!dh4j!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd39112-010a-49ae-a966-45c3a794a002_1080x1350.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!dh4j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febd39112-010a-49ae-a966-45c3a794a002_1080x1350.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This blueprint outlines a strategic roadmap and technical architecture designed to deploy production-ready AI platforms under rigorous regulatory standards, such as the <strong>Central Bank of the UAE (CBUAE)</strong> and the <strong>UAE Personal Data Protection Law (PDPL)</strong>.</p><h2>1. Governance First: The Delivery Decision Framework</h2><p>Too many enterprise AI initiatives fail because they treat risk as an afterthought. A successful deployment pipeline begins with a structured governance gate&#8212;a <strong>Delivery Decision Framework</strong>&#8212;that screens use cases before a single cloud resource is provisioned.</p><p>Before any AI capability moves forward, it must pass through three mandatory evaluation layers:</p><ul><li><p><strong>Regulatory &amp; Data Classification:</strong> Explicitly mapping data flows to identify whether the use case handles Personally Identifiable Information (PII), customer financial records, or restricted account-level data.</p></li><li><p><strong>Autonomy Limits:</strong> Restricting applications to assistive roles (e.g., customer support copilots or agent assistants) while keeping humans firmly in the loop (<span>$HITL$</span>) for any transaction-related executions.</p></li><li><p><strong>Auditability &amp; Explainability:</strong> Mandating full, write-once-read-many (WORM) immutable logging of system prompts, variables, retrieval sources, and final model responses to guarantee complete transparency for internal risk committees and external regulators.</p></li></ul><h2>2. The Technical Core: 6-Layer Zero-Trust AI Architecture</h2><p>When building an AI platform for a financial institution, the underlying infrastructure must operate on a fundamental principle: <strong>&#8220;Never trust, always verify.&#8221;</strong> This enterprise architecture achieves absolute isolation by separating the platform into six interconnected layers that entirely eliminate public internet exposure.</p><pre><code><code>[ Banking Channels ] 
       &#9474;
       &#9660;
&#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
&#9474; 1. API &amp; Ingress Layer (APIM / WAF)                    &#9474;
&#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
                           &#9474;
                           &#9660;
&#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
&#9474; 2. Orchestration Layer (FastAPI / Docker Containers)   &#9474;
&#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
                           &#9474;
       &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
       &#9660;                   &#9660;                   &#9660;
&#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;    &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;    &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
&#9474; 3. Knowledge &#9474;    &#9474; 4. Model     &#9474;    &#9474; 5. Security  &#9474;
&#9474;    Layer     &#9474;    &#9474;    Layer     &#9474;    &#9474;    Layer     &#9474;
&#9474; (AI Search / &#9474;    &#9474; (Azure OpenAI&#9474;    &#9474; (Key Vault / &#9474;
&#9474;  Secure RAG) &#9474;    &#9474;  PrivateLink)&#9474;    &#9474;  Managed ID) &#9474;
&#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;    &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;    &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
       &#9474;                   &#9474;                   &#9474;
       &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
                           &#9474;
                           &#9660;
&#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
&#9474; 6. Observability Layer (Cosmos DB / Log Analytics WORM)&#9474;
&#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
</code></code></pre><h3>Architectural Layer-by-Layer Breakdown</h3><p><strong>1. API &amp; Ingress Layer</strong></p><p>   Primary Components:</p><p>   &#8226; Azure API Management (APIM)</p><p>   &#8226; Web Application Firewall (WAF)</p><p>   Core Security &amp; Operational Function:</p><p>   Acts as the platform perimeter, enforcing SSL/TLS termination, validating JSON Web Tokens (JWT), rejecting unauthorized requests (401/403), and applying token-bucket rate limiting to protect downstream AI services from abuse, denial-of-service events, and uncontrolled consumption costs.</p><p><strong>2. Orchestration Layer</strong></p><p>   Primary Components:</p><p>   &#8226; FastAPI</p><p>   &#8226; Docker Containers</p><p>   Core Security &amp; Operational Function:</p><p>   Serves as the application control plane, managing user sessions, prompt orchestration, context assembly, Retrieval-Augmented Generation (RAG) workflows, guardrail enforcement, business-rule validation, and integration with downstream AI and enterprise systems.</p><p><strong>3. Knowledge Layer</strong></p><p>   Primary Components:</p><p>   &#8226; Azure AI Search</p><p>   &#8226; Vector Database</p><p>   &#8226; RAG Services</p><p>   Core Security &amp; Operational Function:</p><p>   Provides trusted enterprise context by securely ingesting, chunking, embedding, and indexing documents within a network-isolated environment. Uses hybrid retrieval, semantic ranking, and vector search to deliver grounded information to AI applications while minimizing hallucinations.</p><p><strong>4. Model Layer</strong></p><p>   Primary Components:</p><p>   &#8226; Azure OpenAI Service</p><p>   &#8226; Provisioned Throughput Units (PTU)</p><p>   &#8226; Azure AI Content Safety</p><p>   Core Security &amp; Operational Function:</p><p>   Hosts enterprise-grade Large Language Models (LLMs) accessed exclusively through Azure Private Links within a Virtual Network (VNet). Delivers predictable performance through PTUs while applying real-time content safety controls to detect and block prompt injections, jailbreak attempts, and harmful outputs.</p><p><strong>5. Security &amp; Identity Layer</strong></p><p>   Primary Components:</p><p>   &#8226; Microsoft Entra ID</p><p>   &#8226; Azure Key Vault</p><p>   &#8226; Managed Identities</p><p>   Core Security &amp; Operational Function:</p><p>   Establishes a zero-trust security posture by eliminating static credentials, enforcing identity-based authentication, automating certificate and key rotation, and applying PII detection and redaction controls before sensitive information reaches AI models or vector stores.</p><p><strong>6. Observability Layer</strong></p><p>   Primary Components:</p><p>   &#8226; Azure Cosmos DB</p><p>   &#8226; Azure Log Analytics</p><p>   &#8226; WORM Storage</p><p>   Core Security &amp; Operational Function:</p><p>Provides end-to-end auditability and compliance by capturing prompt templates, retrieval sources, model requests and responses, user interactions, and operational telemetry. Stores records in immutable storage with mandatory long-term retention to satisfy regulatory and forensic requirements.</p><h2>3. The 12-Week Execution Roadmap</h2><p>Moving a highly secure AI platform from zero to production requires an aggressive, highly synchronized timeline across cross-functional squads (Platform, AI, Engineering, Security, and Risk).</p><pre><code><code> Weeks 1&#8211;3                 Weeks 4&#8211;8                 Weeks 9&#8211;12
&#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;         &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;         &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
&#9474;  Phase 1:     &#9474;  &#9472;&#9472;&#9472;&#9472;&#9472;&#10132; &#9474;  Phase 2:     &#9474;  &#9472;&#9472;&#9472;&#9472;&#9472;&#10132; &#9474;  Phase 3:     &#9474;
&#9474;  Discovery    &#9474;         &#9474;  Delivery     &#9474;         &#9474;  Deployment   &#9474;
&#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;         &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;         &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
</code></code></pre><h3>Phase 1: Discovery (Weeks 1&#8211;3)</h3><ul><li><p><strong>Focus:</strong> Alignment, baseline construction, and compliance scoping.</p></li><li><p><strong>Key Deliverables:</strong> Stakeholder interviews, data source identification, PII data classification reviews with legal/compliance, and final Solution Architecture Design (SAD) approval from the Enterprise Architecture Board.</p></li></ul><h3>Phase 2: Delivery (Weeks 4&#8211;8)</h3><ul><li><p><strong>Focus:</strong> Intensive engineering block and pipeline construction.</p></li><li><p><strong>Key Deliverables:</strong> Infrastructure provisioning via Infrastructure as Code (IaC/Terraform), secure RAG pipeline implementation (chunking/embedding optimization), frontend/CRM integration, end-to-end QA, independent security penetration testing, and AI response quality alignment reviews.</p></li></ul><h3>Phase 3: Deployment (Weeks 9&#8211;12)</h3><ul><li><p><strong>Focus:</strong> Operationalization and go-live preparation.</p></li><li><p><strong>Key Deliverables:</strong> SRE continuous monitoring setup, alerting configurations, operational disaster recovery (DR) and rollback playbook validation tests, final executive risk sign-off, and staged production roll-out.</p></li></ul><h2>4. Driving Tangible Value: Flagship Use Case</h2><p>A rigorous technical framework is only as good as the business value it unlocks. As example consider the application of this framework follows to build a <strong>Relationship Manager (RM) Assistant within Private Banking</strong>:</p><blockquote><h3>Impact Case Study: Private Banking RM Assistant</h3><p>By securely connecting an enterprise RAG engine to internal knowledge bases, global market research PDFs, and read-only CRM endpoints, relationship managers can access real-time contextual summaries of customer histories and complex portfolios in <strong>under 2.5 seconds</strong>.</p><ul><li><p><strong>Time Savings:</strong> Decreases meeting preparation time by <strong>40%</strong>.</p></li><li><p><strong>Efficiency Gain:</strong> Streamlines drafting follow-up emails, cross-referencing client risk profiles against product prospectuses, and generating meeting briefs.</p></li><li><p><strong>Security Stance:</strong> Empowers RMs with high-context data search without exposing the core banking infrastructure to unnecessary risk.</p></li></ul></blockquote><h2>5. The Path to Production Readiness</h2><p>Before any application goes live, it must face a comprehensive operational checklist. In this framework, an <strong>86-point production readiness review</strong> aggregates control domains across security, operational stability, and AI performance metrics.</p><p><strong>A Go-Live decision is heavily gated by key target Service Level Agreements (SLAs):</strong></p><p>&#8226; Availability SLA - &#8805;99.9% across dual-region active-passive deployments</p><p>&#8226; AI Response Latency - P95 latency maintained below 2.5 seconds</p><p>&#8226; System Error Rate - API error rates constrained to &lt;0.5%</p><p>&#8226; Hallucination Threshold - Actively monitored and verified to remain below 2%</p><p>These operational thresholds form the minimum acceptance criteria for production deployment and are continuously monitored post go-live to ensure platform reliability, regulatory compliance, and service quality.</p><p>Deploying Generative AI in banking isn&#8217;t just an infrastructure configuration challenge&#8212;it&#8217;s a multi-disciplinary effort. By enforcing a strict delivery framework, building on top of a 6-layer zero-trust architecture, and tracking precise platform KPIs, organizations can confidently unlock the revolutionary potential of GenAI while keeping their data, customers, and regulatory compliance completely secure.</p><p><em>For more comprehensive guides regarding AI Delivery Management, you can access the open-source repository at <a href="https://www.google.com/search?q=https://github.com/seyhunak/AI_Delivery_Playbook">Github &#8211; AI Delivery Playbook</a>.</em></p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Seyhun's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/engineering-trust-a-blueprint-for?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Thanks for reading Seyhun's Substack! This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/engineering-trust-a-blueprint-for?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://seyhunak.substack.com/p/engineering-trust-a-blueprint-for?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><p></p>]]></content:encoded></item><item><title><![CDATA[Engineering Agentic Guardrails: A Blueprint for Secure Autonomous AI Architecture]]></title><description><![CDATA[Most corporate AI safety frameworks are built for static Large Language Models (LLMs) &#8212; systems whose risk profile ends when a text generation finishes.]]></description><link>https://seyhunak.substack.com/p/engineering-agentic-guardrails-a</link><guid isPermaLink="false">https://seyhunak.substack.com/p/engineering-agentic-guardrails-a</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Wed, 24 Jun 2026 23:54:32 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!cUKQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4150b3db-8188-4e1c-88cd-56f1804704bc_1080x1350.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h4>Most corporate AI safety frameworks are built for static Large Language Models (LLMs)&#8202;&#8212;&#8202;systems whose risk profile ends when a text generation finishes. However, as organizations transition to <strong>autonomous agents</strong> that orchestrate multi-step loops, call APIs, and read/write to production environments, static input/output filtering becomes insufficient.</h4><p>Below is an engineering blueprint for establishing runtime guardrails, strict authorization boundaries, and deterministic policy layers around autonomous agent architectures.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cUKQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4150b3db-8188-4e1c-88cd-56f1804704bc_1080x1350.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cUKQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4150b3db-8188-4e1c-88cd-56f1804704bc_1080x1350.jpeg 424w, https://substackcdn.com/image/fetch/$s_!cUKQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4150b3db-8188-4e1c-88cd-56f1804704bc_1080x1350.jpeg 848w, https://substackcdn.com/image/fetch/$s_!cUKQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4150b3db-8188-4e1c-88cd-56f1804704bc_1080x1350.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!cUKQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4150b3db-8188-4e1c-88cd-56f1804704bc_1080x1350.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cUKQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4150b3db-8188-4e1c-88cd-56f1804704bc_1080x1350.jpeg" width="1080" height="1350" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4150b3db-8188-4e1c-88cd-56f1804704bc_1080x1350.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1350,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:146908,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/203482678?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4150b3db-8188-4e1c-88cd-56f1804704bc_1080x1350.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cUKQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4150b3db-8188-4e1c-88cd-56f1804704bc_1080x1350.jpeg 424w, https://substackcdn.com/image/fetch/$s_!cUKQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4150b3db-8188-4e1c-88cd-56f1804704bc_1080x1350.jpeg 848w, https://substackcdn.com/image/fetch/$s_!cUKQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4150b3db-8188-4e1c-88cd-56f1804704bc_1080x1350.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!cUKQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4150b3db-8188-4e1c-88cd-56f1804704bc_1080x1350.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>The Core Risk Profile: Why Agents Break Standard Security</h3><p>In a standard LLM deployment, the architecture is linear: <code>User Prompt -&gt; LLM -&gt; Response</code>. The security perimeter is focused on input sanitization (prompt injection defense) and output classification (moderation filtering).</p><p>In an agentic architecture, the model operates inside an <strong>unpredictable loop</strong>: <code>Reasoning -&gt; Action (Tool Call) -&gt; Observation (Environment Response) -&gt; Next Reasoning</code>. This introduce three primary vulnerabilities:</p><ul><li><p><strong>Indirect Prompt Injection (IPI):</strong> An agent reads an untrusted external payload (such as an incoming email or scraped webpage) containing hidden instructions. The agent parses this content, interprets it as a command, and executes a malicious tool call using its system privileges.</p></li><li><p><strong>Orthogonal Goal Alignment Failure:</strong> The model misunderstands its operational boundaries while solving an optimization problem, leading it to exhaust API rate limits, trigger runaway loops, or execute disruptive system actions to fulfill its primary goal.</p></li><li><p><strong>State Space Explosion:</strong> Unlike deterministic software, an agent&#8217;s operational path cannot be fully mapped via traditional integration testing. The combinatorics of tools, variable inputs, and environmental changes make runtime intervention necessary.</p></li></ul><h3>Component Architecture for Agentic Governance</h3><p>To mitigate these risks without completely destroying the efficiency of autonomous systems, organizations must implement an independent <strong>Runtime Governance Proxy</strong> that sits between the agent&#8217;s core reasoning engine and the execution environment.</p><pre><code>                  &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
                  &#9474; Agent Engine (LLM)   &#9474;
                  &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
                             &#9474;
            [Raw Tool Call]  &#9474;  [Filtered Response]
                             &#9660;
                  &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
                  &#9474; Runtime Governance   &#9474;&#9668;&#9472;&#9472;&#9472; Enterprise Policy Engine
                  &#9474; Proxy (Guardrails)   &#9474;     (OPA / Rego)
                  &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
                             &#9474;
       [Authorized Call]     &#9474;  [Observation Payload]
                             &#9660;
                  &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
                  &#9474; Isolated Environment &#9474;
                  &#9474; (Micro-Sandboxes)    &#9474;
                  &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;</code></pre><h3>Deep-Dive: Implementing Technical Guardrails</h3><h3>1. Zero-Trust Access Boundaries &amp; Ephemeral Sandboxing</h3><p>Agents must never inherit the broad network access of the server hosting them. They should run in completely isolated compute environments with highly restricted network ingress/egress.</p><ul><li><p><strong>Micro-containerization:</strong> Spin up single-tenant micro-sandboxes (using lightweight microVMs like Firecracker or highly isolated gVisor runtimes) for each agent session.</p></li><li><p><strong>Principle of Least Privilege (PoLP) for Tools:</strong> If a marketing agent needs to interface with a Customer Relationship Management (CRM) tool, its API token must be restricted via Role-Based Access Control (RBAC) to specific scopes (e.g., <code>contacts:write</code>). The token must have zero write permissions for backend databases or authentication management systems.</p></li></ul><h3>2. The Policy Enforcement Layer (Open Policy Agent)</h3><p>Do not hardcode security rules into your python/typescript agent code. Decouple your business logic from your safety rules by using a dedicated policy engine like <strong>Open Policy Agent (OPA)</strong> or <strong>Cedar</strong>.</p><p>Before any tool execution occurs, the Runtime Governance Proxy intercepts the raw payload, serializes it, and runs it against a declarative policy language (like Rego).</p><p>Code snippet</p><pre><code># Example Rego Policy for a Financial Agent Tool Interceptor
package agent.security</code></pre><pre><code>default allow = false</code></pre><pre><code># Allow tool execution only if all conditions match
allow {
    input.tool_name == &#8220;send_invoice&#8221;
    input.parameters.amount &lt;= 5000
    input.metadata.user_role == &#8220;finance_operator&#8221;
}</code></pre><pre><code># Explicitly flag anomalous high-frequency calls
allow = false {
    input.metrics.rolling_10m_call_count &gt; 50
}</code></pre><h3>3. Dynamic Financial and Operational Thresholds</h3><p>Runaway agents can quickly generate massive cloud compute costs or external API charges. Implement hard determinism at the infrastructure proxy layer:</p><ul><li><p><strong>Token-Budget Monitored Wrappers:</strong> Wrap the LLM client call in a controller that calculates the cumulative token count of the current loop. If the session exceeds a set threshold (e.g., 500,000 tokens), the proxy forces a context termination.</p></li><li><p><strong>Circuit Breakers:</strong> Implement rate-limiting proxies for all outgoing agent actions. If an agent triggers more than <code>N</code> API updates within a rolling 60-second window, the circuit breaker trips, putting the agent into a paused state until an administrator reviews the loop.</p></li></ul><h3>4. Immutable Execution Logging and Forensics</h3><p>Traditional logs track standard metrics like application errors and HTTP status codes. Agentic logging must capture the entire cognitive context to allow for post-incident debugging and root-cause analysis.</p><p>Every state transition must be written to an append-only, immutable data store (e.g., AWS S3 with Object Lock or a secure distributed ledger). Each log entry must contain:</p><ul><li><p><strong>The System Prompt State:</strong> The precise core instructions given to the agent.</p></li><li><p><strong>The &#8220;Chain-of-Thought&#8221; (CoT) Payload:</strong> The raw internal reasoning generated by the model before selecting a tool.</p></li><li><p><strong>The Argument Arguments:</strong> The specific parameters the model passed to the tool.</p></li><li><p><strong>The Environment Feedback:</strong> The exact payload returned by the executed tool or infrastructure API.</p></li></ul><h3>Blueprint for Engineering Leaders</h3><p>Building a production-ready autonomous agent platform requires shifting your architectural focus. Instead of concentrating solely on optimizing the agent&#8217;s core prompt logic, prioritize designing a robust environment to contain it.</p><p>The long-term value of your agentic deployments will be determined by your runtime guardrails. By decoupling governance policies from model logic, restricting operations to ephemeral sandboxes, and establishing strict circuit breakers, you ensure your autonomous systems remain safe and reliable scaling assets rather than unpredictable operational risks.</p><h4>#AIGuardrails #AgenticArchitecture #AISecurity #ResponsibleAI #EngineeringBlueprint</h4>]]></content:encoded></item><item><title><![CDATA[Local-first AI memory layer. Plain markdown. Obsidian-native. Zero infrastructure.]]></title><description><![CDATA[Mnemosyne gives AI applications persistent memory across sessions.]]></description><link>https://seyhunak.substack.com/p/local-first-ai-memory-layer-plain</link><guid isPermaLink="false">https://seyhunak.substack.com/p/local-first-ai-memory-layer-plain</guid><pubDate>Wed, 17 Jun 2026 11:44:05 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/202419689/4f799a38cf166dc4b83a0a2542321606.mp3" length="0" type="audio/mpeg"/><content:encoded><![CDATA[<p>Mnemosyne gives AI applications persistent memory across sessions. Notes live as <code>.md</code> files on disk &#8212; readable by agents, editable in Obsidian, owned by you.</p><p>Every week, we see new agent frameworks, orchestration layers, and reasoning models. Models are getting smarter. Context windows are getting larger.</p><p>Yet AI still forgets.</p><p>Not because the models are incapable&#8212;but because most AI systems remain fundamentally stateless.</p><p>A conversation ends. Context disappears. Valuable insights vanish into vector databases few humans can inspect. Memory becomes infrastructure rather than knowledge.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pCOj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e30ba18-b123-4188-a793-56e64323ae04_1794x1316.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pCOj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e30ba18-b123-4188-a793-56e64323ae04_1794x1316.png 424w, https://substackcdn.com/image/fetch/$s_!pCOj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e30ba18-b123-4188-a793-56e64323ae04_1794x1316.png 848w, https://substackcdn.com/image/fetch/$s_!pCOj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e30ba18-b123-4188-a793-56e64323ae04_1794x1316.png 1272w, https://substackcdn.com/image/fetch/$s_!pCOj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e30ba18-b123-4188-a793-56e64323ae04_1794x1316.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pCOj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e30ba18-b123-4188-a793-56e64323ae04_1794x1316.png" width="1456" height="1068" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7e30ba18-b123-4188-a793-56e64323ae04_1794x1316.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1068,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:86095,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/202419689?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e30ba18-b123-4188-a793-56e64323ae04_1794x1316.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pCOj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e30ba18-b123-4188-a793-56e64323ae04_1794x1316.png 424w, https://substackcdn.com/image/fetch/$s_!pCOj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e30ba18-b123-4188-a793-56e64323ae04_1794x1316.png 848w, https://substackcdn.com/image/fetch/$s_!pCOj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e30ba18-b123-4188-a793-56e64323ae04_1794x1316.png 1272w, https://substackcdn.com/image/fetch/$s_!pCOj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e30ba18-b123-4188-a793-56e64323ae04_1794x1316.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>I built <strong>Mnemosyne</strong> because I believe AI memory should be:</p><ul><li><p>Local-first</p></li><li><p>Human-readable</p></li><li><p>Agent-accessible</p></li><li><p>Owned by the user</p></li></ul><p>Instead of hiding memory inside proprietary systems, Mnemosyne stores knowledge as plain Markdown files on disk.</p><p>Your notes remain:</p><ul><li><p>Editable in Obsidian</p></li><li><p>Readable by humans</p></li><li><p>Searchable by agents</p></li><li><p>Portable across frameworks</p></li></ul><p>No cloud service.</p><p>No external database.</p><p>No infrastructure to manage.</p><p>Just files.</p><p><strong>Install as AI skill</strong></p><p><a href="http://npx skills add seyhunak/mnemosyne">npx skills add seyhunak/mnemosyne</a></p><h2>Why Markdown?</h2><p>Markdown survived decades because it is simple, portable, and future-proof.</p><p>If an AI system stores memory in a format humans cannot read, can we truly call it memory?</p><p>With Mnemosyne, memories are simply <code>.md</code> files:</p><pre><code><code>research/vector-dbs.md
meetings/customer-a.md
architecture/rag-design.md
</code></code></pre><p>Agents ingest them, build indexes, extract wiki-links, and retrieve relevant context when needed.</p><p>Humans can open the same files in any editor.</p><p>The memory belongs to you.</p><h2>AI Memory Should Outlive Models</h2><p>Models change.</p><p>Frameworks come and go.</p><p>Today&#8217;s state-of-the-art becomes tomorrow&#8217;s legacy.</p><p>Memory should outlive all of them.</p><p>That&#8217;s why Mnemosyne integrates with LangChain, CrewAI, OpenAI SDK, Anthropic, Gemini, Ollama, LM Studio, and many others&#8212;without locking users into a specific ecosystem.</p><p>The goal isn&#8217;t to create another framework.</p><p>The goal is to create durable memory.</p><h2>The Future of AI Is Persistent</h2><p>We often talk about reasoning, agents, and autonomy.</p><p>But long-term intelligence requires continuity.</p><p>An assistant that remembers past research.</p><p>An agent that recalls deployment history.</p><p>A system that learns over months instead of minutes.</p><p>Persistent memory is not a feature.</p><p>It&#8217;s infrastructure for intelligence.</p><p>And perhaps, memory&#8212;not larger models&#8212;is the next frontier of AI.</p><div><hr></div><p>Mnemosyne is open source and MIT licensed.</p><p>Built for developers who believe AI should remember&#8212;and that memory should remain theirs.</p>]]></content:encoded></item><item><title><![CDATA[Spreadsheets Are Quietly Breaking Small Business Finance]]></title><description><![CDATA[Most small businesses are still running their finances on something that was never designed for scale.]]></description><link>https://seyhunak.substack.com/p/spreadsheets-are-quietly-breaking</link><guid isPermaLink="false">https://seyhunak.substack.com/p/spreadsheets-are-quietly-breaking</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Tue, 09 Jun 2026 09:41:23 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!R1jr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75885978-60d2-487e-bdc5-1d8bfe538553_460x997.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Most small businesses are still running their finances on something that was never designed for scale.</p><p>Spreadsheets.</p><p>They started as a clever workaround. Now they&#8217;re a bottleneck.</p><p>And honestly, they&#8217;re starting to break under modern expectations.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!R1jr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75885978-60d2-487e-bdc5-1d8bfe538553_460x997.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!R1jr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75885978-60d2-487e-bdc5-1d8bfe538553_460x997.jpeg 424w, https://substackcdn.com/image/fetch/$s_!R1jr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75885978-60d2-487e-bdc5-1d8bfe538553_460x997.jpeg 848w, https://substackcdn.com/image/fetch/$s_!R1jr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75885978-60d2-487e-bdc5-1d8bfe538553_460x997.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!R1jr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75885978-60d2-487e-bdc5-1d8bfe538553_460x997.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!R1jr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75885978-60d2-487e-bdc5-1d8bfe538553_460x997.jpeg" width="460" height="997" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/75885978-60d2-487e-bdc5-1d8bfe538553_460x997.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:997,&quot;width&quot;:460,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:57747,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/201272587?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75885978-60d2-487e-bdc5-1d8bfe538553_460x997.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!R1jr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75885978-60d2-487e-bdc5-1d8bfe538553_460x997.jpeg 424w, https://substackcdn.com/image/fetch/$s_!R1jr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75885978-60d2-487e-bdc5-1d8bfe538553_460x997.jpeg 848w, https://substackcdn.com/image/fetch/$s_!R1jr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75885978-60d2-487e-bdc5-1d8bfe538553_460x997.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!R1jr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75885978-60d2-487e-bdc5-1d8bfe538553_460x997.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2>The problem nobody talks about</h2><p>Bookkeeping looks simple on the surface:</p><ul><li><p>Track expenses</p></li><li><p>Categorize transactions</p></li><li><p>Generate reports</p></li><li><p>Understand cash flow</p></li></ul><p>But in reality, it becomes:</p><ul><li><p>Manual receipt handling</p></li><li><p>Inconsistent categorization</p></li><li><p>Delayed reporting</p></li><li><p>Confusing financial visibility</p></li></ul><p>And the worst part?</p><p>By the time you understand your numbers, the decision window is already gone.</p><h2>So I built something different</h2><p>LedgerIQ is an AI system designed to replace the spreadsheet layer of small business bookkeeping.</p><p>Not by making spreadsheets &#8220;better&#8221;.</p><p>But by removing them entirely from the workflow.</p><h2>What it does</h2><p>LedgerIQ handles the financial workflow end-to-end:</p><ul><li><p>Reads receipts automatically</p></li><li><p>Categorizes expenses using AI</p></li><li><p>Generates profit &amp; loss statements instantly</p></li><li><p>Answers financial questions in plain English</p></li></ul><p>Instead of digging through rows and columns, you just ask:</p><blockquote><p>&#8220;Where did my money go this month?&#8221;</p></blockquote><p>And you get a direct answer.</p><h2>Why this matters</h2><p>Small businesses don&#8217;t fail because of lack of effort.</p><p>They fail because of lack of clarity.</p><p>And spreadsheets don&#8217;t give clarity &#8212; they delay it.</p><p>They turn finance into a retrospective activity instead of a real-time system.</p><h2>The shift happening underneath</h2><p>We&#8217;re moving from:</p><p><strong>manual accounting tools &#8594; AI-native financial systems</strong></p><p>Where:</p><ul><li><p>Data is captured automatically</p></li><li><p>Categorization is probabilistic, not rigid</p></li><li><p>Reports are generated instantly</p></li><li><p>Finance becomes conversational</p></li></ul><p>This is not just optimization.</p><p>It&#8217;s a structural shift in how business understanding works.</p><h2>Who this is for</h2><ul><li><p>Small business owners who hate bookkeeping</p></li><li><p>Freelancers trying to understand cash flow</p></li><li><p>Founders who want real-time financial visibility</p></li><li><p>Anyone tired of &#8220;end of month accounting panic&#8221;</p></li></ul><h2>The core idea</h2><p>Finance shouldn&#8217;t feel like a monthly ritual.</p><p>It should feel like a live system.</p><p>Always updated. Always accessible. Always understandable.</p><h2>Try it</h2><p>LedgerIQ is available now on the App Store.</p><p>&#128073; <a href="https://apps.apple.com/us/app/ledgeriq/id6760840224">https://apps.apple.com/us/app/ledgeriq/id6760840224</a></p><div><hr></div><h2>Closing thought</h2><p>Spreadsheets didn&#8217;t fail because they were bad.</p><p>They failed because the world became too fast for them.</p><p>And now we&#8217;re building systems that actually keep up.</p>]]></content:encoded></item><item><title><![CDATA[Turning Your Mac into a Distraction-Free Focus Clock]]></title><description><![CDATA[We all hit that point where the desktop becomes noise.]]></description><link>https://seyhunak.substack.com/p/turning-your-mac-into-a-distraction</link><guid isPermaLink="false">https://seyhunak.substack.com/p/turning-your-mac-into-a-distraction</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Tue, 09 Jun 2026 09:37:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!PRaE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bade4b3-8891-43f9-824b-90fd4c057f4f_704x440.avif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>We all hit that point where the desktop becomes noise. Notifications, tabs, Slack pings, emails&#8230; even when you <em>intend</em> to focus, your Mac rarely feels like a calm environment.</p><p>So we built something intentionally simple.</p><h3>Meet StillTimer</h3><p>StillTimer is a full-screen minimalist clock experience for macOS designed to remove everything except time and presence.</p><p>No widgets. No clutter. No friction.</p><p>Just a smooth, calm interface that turns your Mac into a focus-first environment.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PRaE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bade4b3-8891-43f9-824b-90fd4c057f4f_704x440.avif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PRaE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bade4b3-8891-43f9-824b-90fd4c057f4f_704x440.avif 424w, https://substackcdn.com/image/fetch/$s_!PRaE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bade4b3-8891-43f9-824b-90fd4c057f4f_704x440.avif 848w, https://substackcdn.com/image/fetch/$s_!PRaE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bade4b3-8891-43f9-824b-90fd4c057f4f_704x440.avif 1272w, https://substackcdn.com/image/fetch/$s_!PRaE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bade4b3-8891-43f9-824b-90fd4c057f4f_704x440.avif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PRaE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bade4b3-8891-43f9-824b-90fd4c057f4f_704x440.avif" width="728" height="455" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6bade4b3-8891-43f9-824b-90fd4c057f4f_704x440.avif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:440,&quot;width&quot;:704,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:9569,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/avif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/201272178?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bade4b3-8891-43f9-824b-90fd4c057f4f_704x440.avif&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PRaE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bade4b3-8891-43f9-824b-90fd4c057f4f_704x440.avif 424w, https://substackcdn.com/image/fetch/$s_!PRaE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bade4b3-8891-43f9-824b-90fd4c057f4f_704x440.avif 848w, https://substackcdn.com/image/fetch/$s_!PRaE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bade4b3-8891-43f9-824b-90fd4c057f4f_704x440.avif 1272w, https://substackcdn.com/image/fetch/$s_!PRaE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bade4b3-8891-43f9-824b-90fd4c057f4f_704x440.avif 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Why this matters</h3><p>Most productivity tools try to <em>add</em> more:</p><ul><li><p>More tracking</p></li><li><p>More analytics</p></li><li><p>More reminders</p></li><li><p>More dashboards</p></li></ul><p>But focus doesn&#8217;t usually need more.</p><p>It needs less.</p><p>StillTimer was built around that idea: reduce cognitive load until only one thing remains&#8202;&#8212;&#8202;time awareness.</p><h3>What it does differently</h3><p>StillTimer isn&#8217;t just a digital clock.</p><p>It behaves more like a modern screensaver:</p><ul><li><p>Full-screen immersive mode</p></li><li><p>Smooth flip-style animations</p></li><li><p>Multiple visual styles</p></li><li><p>Minimal UI interaction</p></li><li><p>Designed for passive focus, not control</p></li></ul><p>You don&#8217;t &#8220;use&#8221; it in the traditional sense. You just let it sit there and change the environment you work in.</p><h3>Who it&#8217;s for</h3><ul><li><p>Developers who want a calm coding environment</p></li><li><p>Founders working deep on ideas</p></li><li><p>Remote workers drowning in multitasking</p></li><li><p>Anyone trying to rebuild focus habits</p></li></ul><p>If your Mac feels like a battlefield of attention, this flips the context entirely.</p><h3>Design philosophy</h3><p>The core idea was simple:</p><blockquote><p><em>If your attention is valuable, your screen should protect it&#8202;&#8212;&#8202;not steal it.</em></p></blockquote><p>That influenced every decision:</p><ul><li><p>No feature bloat</p></li><li><p>No learning curve</p></li><li><p>No productivity gamification</p></li><li><p>Just presence + time</p></li></ul><h3>Availability</h3><p>StillTimer is available on the Mac App Store.</p><p><strong><a href="https://apps.apple.com/us/app/stilltimer/id6761326199?mt=12">StillTimer App - App Store</a></strong><a href="https://apps.apple.com/us/app/stilltimer/id6761326199?mt=12"><br></a><em><a href="https://apps.apple.com/us/app/stilltimer/id6761326199?mt=12">Download StillTimer by Seyhun Akyurek on the App Store. See screenshots, ratings and reviews, user tips, and more apps&#8230;</a></em><a href="https://apps.apple.com/us/app/stilltimer/id6761326199?mt=12">apps.apple.com</a></p><p>You can check it out here:<br>&#128073; <a href="https://apps.apple.com/us/app/stilltimer/id6761326199?mt=12">https://apps.apple.com/us/app/stilltimer/id6761326199?mt=12</a></p><div><hr></div><h3>Final thought</h3><p>Productivity tools usually try to help you do more.</p><p>Sometimes the better question is:</p><p>What happens if your device simply helps you do <em>less</em>, but better?</p><p>That&#8217;s what StillTimer is experimenting with.</p>]]></content:encoded></item><item><title><![CDATA[Building an Autonomous Company Operating System with Crafted AI Platform MCP, Hermes and Obsidian ]]></title><description><![CDATA[In this post we will learn how to build Autonomous Company Operating System with Crafted AI Platform]]></description><link>https://seyhunak.substack.com/p/building-an-autonomous-company-operating</link><guid isPermaLink="false">https://seyhunak.substack.com/p/building-an-autonomous-company-operating</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Sun, 26 Apr 2026 11:45:21 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Kyux!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbf342-0dab-4d61-9066-c39237d9b2ec_1400x831.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>There is a shift happening in how we think about AI systems.</p><p>Most tools today are reactive. They wait for input, generate output, and stop there. Useful, but limited.</p><p>What if an AI system could actually operate like a living organization? One that makes decisions, executes work, learns from outcomes, and continuously improves itself over time?</p><p><strong>That is the idea behind this architecture.</strong></p><p>This article explores a system designed not just to assist, but to operate: a closed-loop intelligence framework powered by Crafted AI Platform Hermes, MCP agents, and Obsidian.</p><p><strong>At the core are three components you may use,</strong></p><ul><li><p><strong>Crafted MCP Server</strong> &#8212; the execution layer of specialized AI agents</p></li><li><p><strong>Hermes</strong> &#8212; the decision engine &#8212; AI agent</p></li><li><p><strong>Obsidian</strong> &#8212; the memory and learning system</p></li></ul><p>Together, they form a closed-loop intelligence system that can continuously plan, execute, and improve.</p><h2><strong>The Core Idea: AI as a Company Operating System</strong></h2><p>Instead of building isolated AI tools, we treat the system like a company:</p><ul><li><p>Decisions must be made</p></li><li><p>Work must be executed</p></li><li><p>Results must be measured</p></li><li><p>Knowledge must accumulate</p></li><li><p>Strategy must evolve</p></li></ul><p>This creates a feedback loop:</p><blockquote><p><em>input &#8594; decision &#8594; execution &#8594; learning &#8594; improved decision</em></p></blockquote><p>Most systems stop at execution. This system does not.</p><p>Let&#8217;s breakdown how it works.</p><h2><strong>Hermes: The Decision Layer</strong></h2><p>Hermes is the orchestration brain, it is an amazing self-improving AI agent built by <a href="https://nousresearch.com/">Nous Research</a>.</p><p>It&#8217;s the only agent with a built-in learning loop &#8212; it creates skills from experience, improves them during use, nudges itself to persist knowledge, searches its own past conversations, and builds a deepening model of who you are across sessions.</p><p><strong>It does not execute tasks directly.</strong></p><p>Instead, it:</p><ul><li><p>Interprets user input or system triggers</p></li><li><p>Reads historical memory from Obsidian</p></li><li><p>Determines intent (build, validate, grow, optimize)</p></li><li><p>Creates strategy</p></li><li><p>Breaks work into tasks</p></li><li><p>Chooses which AI agent should execute each task</p></li></ul><p>It behaves more like a assistant operating under strict constraints. Every decision must lead to execution and learning.</p><p>In this example my Hermes Agent will ask me do setup once I installed SKILL.md</p><p><strong>Here is the location of SKILL.md</strong></p><p>Ask hermes to install <a href="https://we-crafted.com/skills/SKILL.md">https://we-crafted.com/skills/SKILL.md</a>. Thats it.<br>Then you will have Crafted Company <strong>craftedcompany</strong> skill ready to use with your choice of model configured with it. Hermes will use skill and get it started.</p><p><strong>PS. Make sure get your own CRAFTED API Key. Contact with us and have it and while installing skill Hermes Agent will ask to you.</strong></p><p><strong>Example after setting up Obsidian and Hermes Agent with installed skill, I have asked a question about the company data:</strong></p><blockquote><p><em><strong>How do we acquire first 100 SME users?</strong></em></p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7pB7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7c37528-9f68-4eea-beed-4f1ce93e1a00_2000x1195.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7pB7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7c37528-9f68-4eea-beed-4f1ce93e1a00_2000x1195.png 424w, https://substackcdn.com/image/fetch/$s_!7pB7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7c37528-9f68-4eea-beed-4f1ce93e1a00_2000x1195.png 848w, https://substackcdn.com/image/fetch/$s_!7pB7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7c37528-9f68-4eea-beed-4f1ce93e1a00_2000x1195.png 1272w, https://substackcdn.com/image/fetch/$s_!7pB7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7c37528-9f68-4eea-beed-4f1ce93e1a00_2000x1195.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7pB7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7c37528-9f68-4eea-beed-4f1ce93e1a00_2000x1195.png" width="1456" height="870" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c7c37528-9f68-4eea-beed-4f1ce93e1a00_2000x1195.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:870,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!7pB7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7c37528-9f68-4eea-beed-4f1ce93e1a00_2000x1195.png 424w, https://substackcdn.com/image/fetch/$s_!7pB7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7c37528-9f68-4eea-beed-4f1ce93e1a00_2000x1195.png 848w, https://substackcdn.com/image/fetch/$s_!7pB7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7c37528-9f68-4eea-beed-4f1ce93e1a00_2000x1195.png 1272w, https://substackcdn.com/image/fetch/$s_!7pB7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7c37528-9f68-4eea-beed-4f1ce93e1a00_2000x1195.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Crafted MCP Server: The Execution</strong></h2><p>Execution steps is handled by the MCP layer (Model Context Protocol-based agents) by Crafted</p><p><strong>The MCP server acts as a workforce of specialized agents:</strong></p><ul><li><p>research agents</p></li><li><p>builder agents</p></li><li><p>growth agents</p></li><li><p>analytics agents</p></li></ul><p><strong>Our Crafted built enterprise grade AI Agent platform exposes all of it is agents via MCP server, just call it and use with your API Key.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QjQk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb880b80b-0492-4f87-b06e-2390c9524525_1254x1254.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QjQk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb880b80b-0492-4f87-b06e-2390c9524525_1254x1254.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QjQk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb880b80b-0492-4f87-b06e-2390c9524525_1254x1254.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QjQk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb880b80b-0492-4f87-b06e-2390c9524525_1254x1254.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QjQk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb880b80b-0492-4f87-b06e-2390c9524525_1254x1254.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QjQk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb880b80b-0492-4f87-b06e-2390c9524525_1254x1254.jpeg" width="1254" height="1254" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b880b80b-0492-4f87-b06e-2390c9524525_1254x1254.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1254,&quot;width&quot;:1254,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!QjQk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb880b80b-0492-4f87-b06e-2390c9524525_1254x1254.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QjQk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb880b80b-0492-4f87-b06e-2390c9524525_1254x1254.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QjQk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb880b80b-0492-4f87-b06e-2390c9524525_1254x1254.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QjQk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb880b80b-0492-4f87-b06e-2390c9524525_1254x1254.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Each agent is stateless in terms of strategy.</strong></p><p>They only:</p><ul><li><p>receive a task</p></li><li><p>execute it by running our MCP server.</p></li><li><p>return structured output</p></li><li><p>simple and secure via platform access</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-1z-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb270191c-a7b6-42a4-972a-e4b219f6435e_3680x2152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-1z-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb270191c-a7b6-42a4-972a-e4b219f6435e_3680x2152.png 424w, https://substackcdn.com/image/fetch/$s_!-1z-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb270191c-a7b6-42a4-972a-e4b219f6435e_3680x2152.png 848w, https://substackcdn.com/image/fetch/$s_!-1z-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb270191c-a7b6-42a4-972a-e4b219f6435e_3680x2152.png 1272w, https://substackcdn.com/image/fetch/$s_!-1z-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb270191c-a7b6-42a4-972a-e4b219f6435e_3680x2152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-1z-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb270191c-a7b6-42a4-972a-e4b219f6435e_3680x2152.png" width="1456" height="851" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b270191c-a7b6-42a4-972a-e4b219f6435e_3680x2152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:851,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:710252,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/195508647?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb270191c-a7b6-42a4-972a-e4b219f6435e_3680x2152.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-1z-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb270191c-a7b6-42a4-972a-e4b219f6435e_3680x2152.png 424w, https://substackcdn.com/image/fetch/$s_!-1z-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb270191c-a7b6-42a4-972a-e4b219f6435e_3680x2152.png 848w, https://substackcdn.com/image/fetch/$s_!-1z-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb270191c-a7b6-42a4-972a-e4b219f6435e_3680x2152.png 1272w, https://substackcdn.com/image/fetch/$s_!-1z-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb270191c-a7b6-42a4-972a-e4b219f6435e_3680x2152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>The MCP server becomes the scalable execution engine of the system.</p><p><strong>Here is the sample user logged in Crafted AI Platform Dashboard and able to see all the 100+ specialized AI agents.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Kyux!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbf342-0dab-4d61-9066-c39237d9b2ec_1400x831.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Kyux!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbf342-0dab-4d61-9066-c39237d9b2ec_1400x831.png 424w, https://substackcdn.com/image/fetch/$s_!Kyux!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbf342-0dab-4d61-9066-c39237d9b2ec_1400x831.png 848w, https://substackcdn.com/image/fetch/$s_!Kyux!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbf342-0dab-4d61-9066-c39237d9b2ec_1400x831.png 1272w, https://substackcdn.com/image/fetch/$s_!Kyux!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbf342-0dab-4d61-9066-c39237d9b2ec_1400x831.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Kyux!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbf342-0dab-4d61-9066-c39237d9b2ec_1400x831.png" width="1400" height="831" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/07fbf342-0dab-4d61-9066-c39237d9b2ec_1400x831.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:831,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Kyux!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbf342-0dab-4d61-9066-c39237d9b2ec_1400x831.png 424w, https://substackcdn.com/image/fetch/$s_!Kyux!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbf342-0dab-4d61-9066-c39237d9b2ec_1400x831.png 848w, https://substackcdn.com/image/fetch/$s_!Kyux!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbf342-0dab-4d61-9066-c39237d9b2ec_1400x831.png 1272w, https://substackcdn.com/image/fetch/$s_!Kyux!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbf342-0dab-4d61-9066-c39237d9b2ec_1400x831.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Optionally you may embed anywhere, website etc you like.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DPpt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa02cb593-7985-4b01-bd3f-43c0046c0f77_1400x852.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DPpt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa02cb593-7985-4b01-bd3f-43c0046c0f77_1400x852.png 424w, https://substackcdn.com/image/fetch/$s_!DPpt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa02cb593-7985-4b01-bd3f-43c0046c0f77_1400x852.png 848w, https://substackcdn.com/image/fetch/$s_!DPpt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa02cb593-7985-4b01-bd3f-43c0046c0f77_1400x852.png 1272w, https://substackcdn.com/image/fetch/$s_!DPpt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa02cb593-7985-4b01-bd3f-43c0046c0f77_1400x852.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DPpt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa02cb593-7985-4b01-bd3f-43c0046c0f77_1400x852.png" width="1400" height="852" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a02cb593-7985-4b01-bd3f-43c0046c0f77_1400x852.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:852,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!DPpt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa02cb593-7985-4b01-bd3f-43c0046c0f77_1400x852.png 424w, https://substackcdn.com/image/fetch/$s_!DPpt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa02cb593-7985-4b01-bd3f-43c0046c0f77_1400x852.png 848w, https://substackcdn.com/image/fetch/$s_!DPpt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa02cb593-7985-4b01-bd3f-43c0046c0f77_1400x852.png 1272w, https://substackcdn.com/image/fetch/$s_!DPpt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa02cb593-7985-4b01-bd3f-43c0046c0f77_1400x852.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><p><em>To learn more visit: </em></p><p>https://we-crafted.com</p></blockquote><h2><strong>Obsidian: The Memory That Learns</strong></h2><p>The most critical part of the system is not execution &#8212; it is memory. All outcomes are stored in Obsidian as structured knowledge:</p><ul><li><p>experiments</p></li><li><p>results</p></li><li><p>insights</p></li><li><p>patterns</p></li><li><p>hypotheses</p></li><li><p>strategy updates</p></li></ul><p>Over time, system evolves and creates a compounding knowledge graph, I tested with sample company as you may see, all the information classified in <strong>CraftedCompany skill </strong>then used by skill.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ABka!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f43e43-bd40-43e4-ab99-a680942db32c_2000x1276.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ABka!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f43e43-bd40-43e4-ab99-a680942db32c_2000x1276.png 424w, https://substackcdn.com/image/fetch/$s_!ABka!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f43e43-bd40-43e4-ab99-a680942db32c_2000x1276.png 848w, https://substackcdn.com/image/fetch/$s_!ABka!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f43e43-bd40-43e4-ab99-a680942db32c_2000x1276.png 1272w, https://substackcdn.com/image/fetch/$s_!ABka!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f43e43-bd40-43e4-ab99-a680942db32c_2000x1276.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ABka!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f43e43-bd40-43e4-ab99-a680942db32c_2000x1276.png" width="1456" height="929" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/13f43e43-bd40-43e4-ab99-a680942db32c_2000x1276.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:929,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!ABka!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f43e43-bd40-43e4-ab99-a680942db32c_2000x1276.png 424w, https://substackcdn.com/image/fetch/$s_!ABka!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f43e43-bd40-43e4-ab99-a680942db32c_2000x1276.png 848w, https://substackcdn.com/image/fetch/$s_!ABka!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f43e43-bd40-43e4-ab99-a680942db32c_2000x1276.png 1272w, https://substackcdn.com/image/fetch/$s_!ABka!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f43e43-bd40-43e4-ab99-a680942db32c_2000x1276.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Unlike traditional systems <em>every execution becomes future intelligence </em>This is what allows the system to improve instead of repeat.</p><h2><strong>The Closed-Loop System</strong></h2><p><strong>The full system operates as a continuous loop:</strong></p><ol><li><p>Input arrives (user, cron, or event) using Hermes</p></li><li><p>Hermes retrieves relevant memory from Obsidian</p></li><li><p>Hermes defines intent and strategy</p></li><li><p>Work is broken into tasks</p></li><li><p>Tasks are sent to MCP agents</p></li><li><p>Agents execute and return results</p></li><li><p>Hermes captures outcomes</p></li><li><p>Insights are extracted</p></li><li><p>Memory is updated in Obsidian</p></li><li><p>Strategy is refined</p></li><li><p>System repeats</p></li></ol><p><strong>This loop never ends. </strong>Each cycle improves the next and you will be tightly integrated system that is evolves over time and helps operate your company, work, projects no matter context is it.</p><h2><strong>Why This Architecture Matters</strong></h2><p>Most AI systems are stateless.</p><p>They forget.</p><p>This system is different because it:</p><ul><li><p>remembers everything that matters</p></li><li><p>learns from every execution</p></li><li><p>updates its own strategy over time</p></li><li><p>improves decision-making quality continuously</p></li></ul><p>It behaves less like a tool and more like a growing organization.</p><h2><strong>The Key Design Shift &#8212; Crafted</strong></h2><p>The real breakthrough is separation of concerns:</p><ul><li><p>Hermes &#8594; decides</p></li><li><p>Crafted MCP &#8594; executes</p></li><li><p>Obsidian &#8594; remembers</p></li></ul><p>This separation makes the system:</p><ul><li><p>scalable (execution can expand via agents)</p></li><li><p>adaptive (memory evolves over time)</p></li><li><p>controllable (Hermes enforces strategy rules)</p></li></ul><p>It turns AI from a tool into an operating system for work.</p><h2><strong>Final Thought</strong></h2><p>We are moving from:</p><blockquote><p><em>&#8220;AI that responds&#8221;</em></p></blockquote><p>to</p><blockquote><p><em>&#8220;AI that operates systems&#8221;</em></p></blockquote><p><strong>This architecture is an early step toward autonomous organizations where:</strong></p><ul><li><p>decisions are automated</p></li><li><p>execution is distributed</p></li><li><p>learning is persistent</p></li><li><p>intelligence compounds over time</p></li></ul><p>The result is not just automation.</p><p>It is <strong>continuous organizational evolution powered by AI</strong>. With the Crafted AI Framework, you may integrate Hermes, Obsidian as tool they are so powerful that improve your workflow.</p><p>If you want to explore this architecture in practice contact with us, you can use the same components described in this article.</p><h2><strong>Get Access</strong></h2><p>If you want to experiment with the full Crafted ecosystem or integrate MCP-based agents into your own system:</p><p>&#128073; <a href="https://we-crafted.com/contact">https://we-crafted.com/contact</a></p><p>Built by love with Crafted</p>]]></content:encoded></item><item><title><![CDATA[Announcing ActiveGuard for Parental Control]]></title><description><![CDATA[We&#8217;re excited to introduce ActiveGuard &#8212; a powerful parental control app designed to help parents manage their kids&#8217; screen time and build healthier digital habits using Apple Family Controls.]]></description><link>https://seyhunak.substack.com/p/announcing-activeguard-for-parental</link><guid isPermaLink="false">https://seyhunak.substack.com/p/announcing-activeguard-for-parental</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Tue, 21 Apr 2026 08:50:32 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lMtU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4daad976-b7d1-473f-8b2e-6de7aa77390e_1320x2868.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2><strong>We&#8217;re excited to introduce ActiveGuard &#8212; a powerful parental control app designed to help parents manage their kids&#8217; screen time and build healthier digital habits using Apple Family Controls.</strong></h2><p>With ActiveGuard, you can take full control of how and when your child uses their iPhone or iPad &#8212; in a way that&#8217;s simple, secure, and flexible.</p><p>&#10024; <strong>Key Features:</strong></p><ul><li><p>Secure parental access with Face ID</p></li><li><p>Flexible restriction modes (app categories or all apps)</p></li><li><p>Smart screen time timer with temporary unlock windows</p></li><li><p>Automatic re-lock when time expires</p></li></ul><p>Give your child the freedom to explore &#8212; with the right boundaries in place.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lMtU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4daad976-b7d1-473f-8b2e-6de7aa77390e_1320x2868.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lMtU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4daad976-b7d1-473f-8b2e-6de7aa77390e_1320x2868.png 424w, https://substackcdn.com/image/fetch/$s_!lMtU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4daad976-b7d1-473f-8b2e-6de7aa77390e_1320x2868.png 848w, https://substackcdn.com/image/fetch/$s_!lMtU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4daad976-b7d1-473f-8b2e-6de7aa77390e_1320x2868.png 1272w, https://substackcdn.com/image/fetch/$s_!lMtU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4daad976-b7d1-473f-8b2e-6de7aa77390e_1320x2868.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lMtU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4daad976-b7d1-473f-8b2e-6de7aa77390e_1320x2868.png" width="1320" height="2868" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4daad976-b7d1-473f-8b2e-6de7aa77390e_1320x2868.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2868,&quot;width&quot;:1320,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!lMtU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4daad976-b7d1-473f-8b2e-6de7aa77390e_1320x2868.png 424w, https://substackcdn.com/image/fetch/$s_!lMtU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4daad976-b7d1-473f-8b2e-6de7aa77390e_1320x2868.png 848w, https://substackcdn.com/image/fetch/$s_!lMtU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4daad976-b7d1-473f-8b2e-6de7aa77390e_1320x2868.png 1272w, https://substackcdn.com/image/fetch/$s_!lMtU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4daad976-b7d1-473f-8b2e-6de7aa77390e_1320x2868.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0MnT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88597c31-ac06-4fcf-af0f-730ea3cd028b_1320x2868.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0MnT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88597c31-ac06-4fcf-af0f-730ea3cd028b_1320x2868.png 424w, https://substackcdn.com/image/fetch/$s_!0MnT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88597c31-ac06-4fcf-af0f-730ea3cd028b_1320x2868.png 848w, https://substackcdn.com/image/fetch/$s_!0MnT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88597c31-ac06-4fcf-af0f-730ea3cd028b_1320x2868.png 1272w, https://substackcdn.com/image/fetch/$s_!0MnT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88597c31-ac06-4fcf-af0f-730ea3cd028b_1320x2868.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0MnT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88597c31-ac06-4fcf-af0f-730ea3cd028b_1320x2868.png" width="1320" height="2868" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/88597c31-ac06-4fcf-af0f-730ea3cd028b_1320x2868.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2868,&quot;width&quot;:1320,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!0MnT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88597c31-ac06-4fcf-af0f-730ea3cd028b_1320x2868.png 424w, https://substackcdn.com/image/fetch/$s_!0MnT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88597c31-ac06-4fcf-af0f-730ea3cd028b_1320x2868.png 848w, https://substackcdn.com/image/fetch/$s_!0MnT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88597c31-ac06-4fcf-af0f-730ea3cd028b_1320x2868.png 1272w, https://substackcdn.com/image/fetch/$s_!0MnT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88597c31-ac06-4fcf-af0f-730ea3cd028b_1320x2868.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tZdq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc126fa2f-3888-4e46-a861-21966e8b62e5_1320x2868.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tZdq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc126fa2f-3888-4e46-a861-21966e8b62e5_1320x2868.png 424w, https://substackcdn.com/image/fetch/$s_!tZdq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc126fa2f-3888-4e46-a861-21966e8b62e5_1320x2868.png 848w, https://substackcdn.com/image/fetch/$s_!tZdq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc126fa2f-3888-4e46-a861-21966e8b62e5_1320x2868.png 1272w, https://substackcdn.com/image/fetch/$s_!tZdq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc126fa2f-3888-4e46-a861-21966e8b62e5_1320x2868.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tZdq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc126fa2f-3888-4e46-a861-21966e8b62e5_1320x2868.png" width="1320" height="2868" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c126fa2f-3888-4e46-a861-21966e8b62e5_1320x2868.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2868,&quot;width&quot;:1320,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!tZdq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc126fa2f-3888-4e46-a861-21966e8b62e5_1320x2868.png 424w, https://substackcdn.com/image/fetch/$s_!tZdq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc126fa2f-3888-4e46-a861-21966e8b62e5_1320x2868.png 848w, https://substackcdn.com/image/fetch/$s_!tZdq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc126fa2f-3888-4e46-a861-21966e8b62e5_1320x2868.png 1272w, https://substackcdn.com/image/fetch/$s_!tZdq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc126fa2f-3888-4e46-a861-21966e8b62e5_1320x2868.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>How it works:<br>- Unlock parental controls securely with Face ID<br>- Choose restriction modes: block specific app categories or all apps<br>- Set a screen time timer and temporary unlock window<br>- Automatically re-lock apps when the time expires</p><p><strong>Download from Apple Store today</strong></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://apps.apple.com/us/app/activeguard/id6760195729&quot;,&quot;text&quot;:&quot;Download from Appstore&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://apps.apple.com/us/app/activeguard/id6760195729"><span>Download from Appstore</span></a></p>]]></content:encoded></item><item><title><![CDATA[Deal Processing Agent: Evolving from Prototype to Scalable, Auditable Production AI Platform]]></title><description><![CDATA[Introduction &#8211; Energy Trading and Advisory Context]]></description><link>https://seyhunak.substack.com/p/deal-processing-agent-evolving-from</link><guid isPermaLink="false">https://seyhunak.substack.com/p/deal-processing-agent-evolving-from</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Sat, 28 Mar 2026 07:11:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!kGwk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F572e0117-bef7-4172-b5d5-a7ad1b4aa7a7_792x812.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h4>Introduction &#8211; Energy Trading and Advisory Context</h4><p>In the business context of <strong>energy trading and advisory</strong>, firms act as intermediaries, advisors, and risk managers for participants in physical and financial energy markets &#8212; including natural gas, power, oil, and renewables. Traders execute bilateral OTC deals or exchange-traded transactions involving complex confirmations that detail reference numbers, counterparties (seller/buyer), commodity specifications, volumes (often in MMBtu), delivery windows, pricing (USD per MMBtu), payment terms, governing law, and other commercial terms.</p><p>A single confirmation serves as the legally binding record of the transaction. Accurate and timely processing of these documents is critical: errors in extraction or validation can lead to mismatched books, failed settlements, disputes, credit exposure breaches, or regulatory reporting issues (e.g., under REMIT or EMIR frameworks). Manual processing is error-prone, slow, and costly &#8212; especially as trade volumes grow and confirmations arrive in varied formats (email, PDF, text).</p><p><strong>Energy trading and advisory firms</strong> rely on robust post-trade processes to:</p><ul><li><p>Capture deal details quickly after execution</p></li><li><p>Enforce business rules (date consistency, value calculations, required fields)</p></li><li><p>Perform real-time credit risk checks (volume thresholds, restricted counterparties)</p></li><li><p>Maintain immutable audit trails for compliance and dispute resolution</p></li></ul><p><strong>Goal</strong><br>Build a production-grade Deal Processing Agent that extracts, validates, and credit-checks energy deal confirmations with &lt;8s p95 latency, &gt;99.9% success rate, full auditability, and cost &lt; $0.01 per deal, while preserving the existing high-quality validation and credit logic.</p><p><strong>Constraints</strong></p><ul><li><p>Small team (1&#8211;3 engineers), aggressive timeline (production in &lt; 6 weeks)</p></li><li><p>Must support future growth to hundreds/thousands of deals per day</p></li><li><p>Regulatory needs: immutable audit trail, potential SOC2/GDPR readiness</p></li><li><p>Prefer cloud-managed services to minimize ops overhead</p></li><li><p>Retain existing Pydantic models, business rules, and test coverage</p></li></ul><p><strong>Non-Goals</strong></p><ul><li><p>Real-time streaming ingestion (batch + queue is sufficient)</p></li><li><p>Advanced ML-based anomaly detection or counterparty risk scoring (future phase)</p></li><li><p>Full UI/dashboard (focus on backend + API first)</p></li></ul><p>The recommended design keeps your current high-cohesion modules (extraction, validation, credit, audit) while introducing loose coupling via a message queue and persistent storage. This allows independent scaling, safe retries, and enterprise-grade observability without rewriting business logic.</p><p>Below is the complete architecture evolution following the same rigorous structure used in the previous review.</p><h4>Assumptions</h4><ul><li><p>Input volume is low-to-medium today (batch of a few deals, not thousands per minute) but expected to grow.</p></li><li><p>Deal confirmations are semi-structured English PDFs/emails/text with moderate variability in format.</p></li><li><p>Credit rules are simple threshold-based today (volume + restricted list) but may become more complex (exposure netting, ratings, etc.).</p></li><li><p>Team size and timeline are small (1&#8211;3 engineers, short-term delivery); production rollout is planned within weeks.</p></li><li><p>Local Ollama is for development only; production must use a hosted provider with SLAs.</p></li><li><p>Data must remain auditable and compliant (audit trail, immutable logs, potential GDPR/SOC2 later).</p></li></ul><h4>Important Metrics &amp; Constraints</h4><ul><li><p>End-to-end latency per deal: target &lt; 8 seconds p95 (extraction + validation + credit check).</p></li><li><p>Accuracy: &lt; 1% critical extraction errors on test set; validation flags must catch 100% of business rule violations.</p></li><li><p>Cost: &lt; $0.01 per deal at production scale.</p></li><li><p>Reliability: 99.9% successful processing (with retry + dead-letter).</p></li><li><p>Observability: full trace per deal + token/cost tracking.</p></li></ul><h4>Domain Storytelling</h4><p>A trader receives a deal confirmation (email/PDF/text) for an energy swap or physical delivery. The confirmation contains reference number, counterparties, volume in MMBtu, price, delivery window, and terms. The Deal Processing Agent must read the text, extract the facts into a clean structured record, enforce business rules (dates make sense, totals match, required fields present), perform a credit risk check on the counterparty and volume, and output a validated JSON with credit decision (approved / flagged / rejected) plus an audit trail. Failures must be flagged early and routed for manual review.</p><h4>Event Storming (Key Domain Events)</h4><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!o-8-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48df5270-4f95-4e81-a2aa-d2a8fbf214ba_5330x348.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!o-8-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48df5270-4f95-4e81-a2aa-d2a8fbf214ba_5330x348.png 424w, https://substackcdn.com/image/fetch/$s_!o-8-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48df5270-4f95-4e81-a2aa-d2a8fbf214ba_5330x348.png 848w, https://substackcdn.com/image/fetch/$s_!o-8-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48df5270-4f95-4e81-a2aa-d2a8fbf214ba_5330x348.png 1272w, https://substackcdn.com/image/fetch/$s_!o-8-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48df5270-4f95-4e81-a2aa-d2a8fbf214ba_5330x348.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!o-8-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48df5270-4f95-4e81-a2aa-d2a8fbf214ba_5330x348.png" width="1456" height="95" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/48df5270-4f95-4e81-a2aa-d2a8fbf214ba_5330x348.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:95,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:146800,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/192385329?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48df5270-4f95-4e81-a2aa-d2a8fbf214ba_5330x348.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!o-8-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48df5270-4f95-4e81-a2aa-d2a8fbf214ba_5330x348.png 424w, https://substackcdn.com/image/fetch/$s_!o-8-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48df5270-4f95-4e81-a2aa-d2a8fbf214ba_5330x348.png 848w, https://substackcdn.com/image/fetch/$s_!o-8-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48df5270-4f95-4e81-a2aa-d2a8fbf214ba_5330x348.png 1272w, https://substackcdn.com/image/fetch/$s_!o-8-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48df5270-4f95-4e81-a2aa-d2a8fbf214ba_5330x348.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h4>DDD &#8211; Bounded Contexts &amp; Context Map</h4><ul><li><p><strong>Extraction Context</strong>: Natural-language &#8594; structured data (LLM-heavy). Aggregate: RawDeal.</p></li><li><p><strong>Validation Context</strong>: Business rule enforcement (Pydantic + custom rules). Aggregate: ValidatedDeal.</p></li><li><p><strong>Credit Context</strong>: Risk decisioning. Aggregate: CreditAssessment.</p></li><li><p><strong>Audit Context</strong>: Immutable logging and compliance.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kGwk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F572e0117-bef7-4172-b5d5-a7ad1b4aa7a7_792x812.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kGwk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F572e0117-bef7-4172-b5d5-a7ad1b4aa7a7_792x812.png 424w, https://substackcdn.com/image/fetch/$s_!kGwk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F572e0117-bef7-4172-b5d5-a7ad1b4aa7a7_792x812.png 848w, https://substackcdn.com/image/fetch/$s_!kGwk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F572e0117-bef7-4172-b5d5-a7ad1b4aa7a7_792x812.png 1272w, https://substackcdn.com/image/fetch/$s_!kGwk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F572e0117-bef7-4172-b5d5-a7ad1b4aa7a7_792x812.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kGwk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F572e0117-bef7-4172-b5d5-a7ad1b4aa7a7_792x812.png" width="792" height="812" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/572e0117-bef7-4172-b5d5-a7ad1b4aa7a7_792x812.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:812,&quot;width&quot;:792,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:50746,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/192385329?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F572e0117-bef7-4172-b5d5-a7ad1b4aa7a7_792x812.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kGwk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F572e0117-bef7-4172-b5d5-a7ad1b4aa7a7_792x812.png 424w, https://substackcdn.com/image/fetch/$s_!kGwk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F572e0117-bef7-4172-b5d5-a7ad1b4aa7a7_792x812.png 848w, https://substackcdn.com/image/fetch/$s_!kGwk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F572e0117-bef7-4172-b5d5-a7ad1b4aa7a7_792x812.png 1272w, https://substackcdn.com/image/fetch/$s_!kGwk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F572e0117-bef7-4172-b5d5-a7ad1b4aa7a7_792x812.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/UwZHF/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b3d8dfd5-283b-43fe-a53e-4aab9ef35245_1220x1132.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8d59fc08-5061-44b5-aba0-870b214aa7e6_1220x1202.png&quot;,&quot;height&quot;:603,&quot;title&quot;:&quot;Functional Requirements&quot;,&quot;description&quot;:&quot;&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/UwZHF/1/" width="730" height="603" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/VSqIb/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5efc1b12-5560-4cf4-8207-9fcdb7689b8e_1220x1004.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/71ada12a-a0d0-45dd-9778-052cc3a1cc6f_1220x1074.png&quot;,&quot;height&quot;:537,&quot;title&quot;:&quot;Non-Functional Requirements (NFRs)&quot;,&quot;description&quot;:&quot;&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/VSqIb/1/" width="730" height="537" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><h4>Traceability Matrix</h4><ul><li><p>F1 &#8594; Extraction Context + LLM call (agent.py + llm.py)</p></li><li><p>F2 &#8594; Validation Context (Pydantic + validation.py)</p></li><li><p>F3 &#8594; Credit Context (credit.py + tool calling)</p></li><li><p>F4 &#8594; Audit Context + output layer</p></li><li><p>N1 &#8594; Async workers + caching of credit decisions</p></li><li><p>N3 &#8594; Retry + Circuit Breaker + Dead Letter Queue</p></li><li><p>N4 &#8594; Hosted model (GPT-4o/Claude) + token monitoring</p></li><li><p>N6 &#8594; Immutable logs + encryption</p></li></ul><h4>Architectural Design Options</h4><p><strong>Option A &#8211; Current Monolithic Script (Minimal Change)</strong></p><ul><li><p>Single agent.py orchestrating everything synchronously.</p></li><li><p>Local Ollama or direct OpenAI/Anthropic calls.</p></li><li><p>In-memory or simple file logging.</p></li><li><p>Scalability: Vertical only; batch via loop.</p></li><li><p>Latency &amp; consistency: Good for low volume.</p></li><li><p>Cost: Low dev, high at scale (no optimization).</p></li><li><p>Operational complexity: Very low.</p></li><li><p>Failure modes: One failure stops batch; no DLQ.</p></li></ul><p><strong>Option B &#8211; Modular Services with Async Queue (Recommended)</strong></p><ul><li><p>Separate bounded contexts as independent modules/services:</p><ul><li><p>Extraction Worker (LLM + guardrails)</p></li><li><p>Validation Worker</p></li><li><p>Credit Worker (can be synchronous tool or separate service)</p></li><li><p>Audit Service</p></li></ul></li><li><p>Message queue (RabbitMQ, SQS, or Redis Streams) for decoupling.</p></li><li><p>Polyglot persistence: PostgreSQL for deals + audit log, Redis for fast credit cache (if rules allow).</p></li><li><p>Production LLM: Azure OpenAI GPT-4o or Anthropic Claude 3.5/Opus with proper tool calling.</p></li><li><p>Observability: OpenTelemetry tracing + structured JSON logs + Prometheus metrics.</p></li></ul><p><strong>Option C &#8211; Fully Serverless (Fastest to Production Scale)</strong></p><ul><li><p>Ingestion &#8594; SQS/SNS &#8594; Lambda (or Azure Functions) for extraction/validation.</p></li><li><p>Step Functions for orchestration + retry.</p></li><li><p>DynamoDB or PostgreSQL (Aurora Serverless) for storage.</p></li><li><p>Credit check as Lambda or direct tool call.</p></li><li><p>Pros: Excellent scaling &amp; pay-per-use.</p></li><li><p>Cons: Cold starts may hurt p95 latency; tracing slightly harder.</p></li></ul><h4>Recommended Option &amp; Reasoning Chain</h4><p><strong>Recommendation: Option B &#8211; Modular Services with Async Queue</strong></p><p>Reasoning steps:</p><ol><li><p>Current script meets functional needs for small scale but fails N1/N3/N5 at growth (no retry, no DLQ, monolithic failure surface).</p></li><li><p>DDD bounded contexts (Extraction, Validation, Credit, Audit) already exist in the code &#8212; we should make them explicit modules/services to preserve high cohesion and low coupling.</p></li><li><p>Credit check can stay as LLM tool call (fast) or move to a dedicated cached service for cost &amp; latency wins.</p></li><li><p>Async queue gives horizontal scaling, dead-letter handling, and easy insertion of monitoring without changing core logic.</p></li><li><p>Production LLM switch (GPT-4o/Claude) directly addresses reliability, tool calling quality, and cost control while keeping the same prompt structure.</p></li><li><p>Team size &amp; timeline favor incremental evolution: keep existing code structure, extract workers, add queue + DB in 2&#8211;3 sprints.</p></li></ol><p>This gives the best balance of maintainability, reliability, and future scalability without over-engineering.</p><h4>System Design Diagram</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wxfb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fb7a33e-5d4f-42bb-82c0-ad5c5c078ecd_922x2164.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wxfb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fb7a33e-5d4f-42bb-82c0-ad5c5c078ecd_922x2164.png 424w, https://substackcdn.com/image/fetch/$s_!wxfb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fb7a33e-5d4f-42bb-82c0-ad5c5c078ecd_922x2164.png 848w, https://substackcdn.com/image/fetch/$s_!wxfb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fb7a33e-5d4f-42bb-82c0-ad5c5c078ecd_922x2164.png 1272w, https://substackcdn.com/image/fetch/$s_!wxfb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fb7a33e-5d4f-42bb-82c0-ad5c5c078ecd_922x2164.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wxfb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fb7a33e-5d4f-42bb-82c0-ad5c5c078ecd_922x2164.png" width="922" height="2164" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3fb7a33e-5d4f-42bb-82c0-ad5c5c078ecd_922x2164.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2164,&quot;width&quot;:922,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:152129,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/192385329?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fb7a33e-5d4f-42bb-82c0-ad5c5c078ecd_922x2164.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wxfb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fb7a33e-5d4f-42bb-82c0-ad5c5c078ecd_922x2164.png 424w, https://substackcdn.com/image/fetch/$s_!wxfb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fb7a33e-5d4f-42bb-82c0-ad5c5c078ecd_922x2164.png 848w, https://substackcdn.com/image/fetch/$s_!wxfb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fb7a33e-5d4f-42bb-82c0-ad5c5c078ecd_922x2164.png 1272w, https://substackcdn.com/image/fetch/$s_!wxfb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fb7a33e-5d4f-42bb-82c0-ad5c5c078ecd_922x2164.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h4>Sequence Diagram (Core Flow &#8211; Process One Deal)</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_ena!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45e764e-cdea-467f-b78b-97ea4609f353_3566x1682.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_ena!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45e764e-cdea-467f-b78b-97ea4609f353_3566x1682.png 424w, https://substackcdn.com/image/fetch/$s_!_ena!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45e764e-cdea-467f-b78b-97ea4609f353_3566x1682.png 848w, https://substackcdn.com/image/fetch/$s_!_ena!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45e764e-cdea-467f-b78b-97ea4609f353_3566x1682.png 1272w, https://substackcdn.com/image/fetch/$s_!_ena!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45e764e-cdea-467f-b78b-97ea4609f353_3566x1682.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_ena!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45e764e-cdea-467f-b78b-97ea4609f353_3566x1682.png" width="1456" height="687" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d45e764e-cdea-467f-b78b-97ea4609f353_3566x1682.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:687,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:281859,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/192385329?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45e764e-cdea-467f-b78b-97ea4609f353_3566x1682.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_ena!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45e764e-cdea-467f-b78b-97ea4609f353_3566x1682.png 424w, https://substackcdn.com/image/fetch/$s_!_ena!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45e764e-cdea-467f-b78b-97ea4609f353_3566x1682.png 848w, https://substackcdn.com/image/fetch/$s_!_ena!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45e764e-cdea-467f-b78b-97ea4609f353_3566x1682.png 1272w, https://substackcdn.com/image/fetch/$s_!_ena!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45e764e-cdea-467f-b78b-97ea4609f353_3566x1682.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h4>Data Management</h4><ul><li><p><strong>Primary Store</strong>: PostgreSQL &#8211; one deals table with JSONB for extracted data + normalized columns for search/reporting. Immutable audit_log table with append-only events.</p></li><li><p><strong>Sharding/Partitioning</strong>: By deal_date or reference prefix if volume grows &gt;10k/day.</p></li><li><p><strong>Caching</strong>: Redis for credit decisions on known counterparties (TTL 24h) to reduce LLM/tool calls.</p></li><li><p><strong>Transactional Model</strong>: Saga pattern across workers (orchestrated by Step Functions or custom with outbox + CDC).</p></li><li><p><strong>Backup &amp; Restore</strong>: Automated daily + PITR; cross-region replica for DR.</p></li><li><p><strong>Data Residency</strong>: Keep counterparty PII in approved regions per compliance needs.</p></li></ul><h4>Security &amp; Compliance</h4><ul><li><p>API keys / LLM credentials in secrets manager (AWS Secrets Manager or HashiCorp Vault).</p></li><li><p>TLS everywhere; AES-256 at rest for DB.</p></li><li><p>Immutable audit log with cryptographic signing if SOC2 required.</p></li><li><p>Anonymization of sensitive fields in non-production logs.</p></li><li><p>Rate limiting and input sanitization on ingestion.</p></li></ul><h4>Observability &amp; SLOs</h4><ul><li><p><strong>Metrics</strong>: latency_per_stage, success_rate, token_usage, cost_usd, validation_failure_rate, credit_reject_rate.</p></li><li><p><strong>Tracing</strong>: OpenTelemetry across workers (correlation ID = deal_reference).</p></li><li><p><strong>Logs</strong>: Structured JSON + console (INFO for normal, WARN/ERROR for failures).</p></li><li><p><strong>SLOs</strong>:</p><ul><li><p>p95 latency &lt; 8s</p></li><li><p>Success rate &gt; 99.9%</p></li><li><p>Cost alert &gt; $50/day</p></li><li><p>MTTR &lt; 15 min for pipeline issues</p></li></ul></li><li><p>Tools: Prometheus + Grafana, Datadog/New Relic (as planned), ELK or Loki for logs.</p></li></ul><h4>Closing Words:</h4><p>This architecture evolves the current reliable but monolithic script into a modular, observable, and horizontally scalable platform that maintains high extraction accuracy while meeting production requirements for cost control, reliability, and compliance. By explicitly applying DDD bounded contexts and introducing async processing with proper failure handling, the system will support growing deal volumes without sacrificing auditability or increasing operational burden. Implementation can begin immediately with low risk and deliver production readiness within 4&#8211;5 short sprints.</p>]]></content:encoded></item><item><title><![CDATA[Building an Enterprise AI-Powered IT Automation Platform on Azure Cloud and OpenAI]]></title><description><![CDATA[A complete journey from architecture design to production deployment]]></description><link>https://seyhunak.substack.com/p/building-an-enterprise-ai-powered</link><guid isPermaLink="false">https://seyhunak.substack.com/p/building-an-enterprise-ai-powered</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Fri, 13 Mar 2026 11:05:34 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9A3c!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0eba147-cc6d-4be8-9cdf-622331886ec2_1200x1200.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2><strong>Introduction</strong></h2><p>In today&#8217;s enterprise environments, IT service desks are overwhelmed with repetitive tickets&#8212;password resets, VPN issues, printer problems. What if we could automate 80% of these using AI? Not just simple chatbots, but a sophisticated system that understands context, searches knowledge bases, and generates accurate resolutions.</p><p>In this post, I&#8217;ll walk you through building exactly that: an <strong>Azure AI IT Automation Platform</strong> that uses GPT-4, RAG (Retrieval-Augmented Generation), and enterprise-grade architecture to automatically classify and resolve IT tickets.</p><div><hr></div><h2><strong>The Challenge</strong></h2><p>Our enterprise client faced these challenges:</p><ul><li><p><strong>500+ IT tickets/day</strong> with 70% being repetitive</p></li><li><p><strong>Average resolution time of 4 hours</strong> for simple issues</p></li><li><p><strong>Knowledge base scattered</strong> across Confluence, SharePoint, and PDFs</p></li><li><p><strong>Need for 99.9% uptime</strong> and enterprise security</p></li><li><p><strong>Compliance requirements</strong> for audit trails and data residency</p></li></ul><h3><strong>Requirements</strong></h3><ul><li><p>Automated ticket classification with confidence scoring</p></li><li><p>AI-generated resolutions based on internal knowledge</p></li><li><p>Human-in-the-loop for low-confidence tickets</p></li><li><p>Enterprise security (Private Endpoints, Managed Identity)</p></li><li><p>Multi-region disaster recovery</p></li><li><p>Real-time monitoring and alerting</p></li></ul><div><hr></div><h2><strong>Architecture Design</strong></h2><h3><strong>The Hub-and-Spoke Pattern</strong></h3><p>We designed a hub-and-spoke network topology with centralized AI services:</p><pre><code><code>&#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
&#9474;                    AZURE CLOUD (UAE)                         &#9474;
&#9474;                                                              &#9474;
&#9474;  &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;      &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;      &#9474;
&#9474;  &#9474;  Front Door &#9474;&#9472;&#9472;&#9472;&#9472;&#9472;&#9654;&#9474;      Container Apps          &#9474;      &#9474;
&#9474;  &#9474;    + WAF    &#9474;      &#9474;      (FastAPI)               &#9474;      &#9474;
&#9474;  &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;      &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;      &#9474;
&#9474;                                  &#9474;                          &#9474;
&#9474;         &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;       &#9474;
&#9474;         &#9474;                        &#9474;                  &#9474;       &#9474;
&#9474;         &#9660;                        &#9660;                  &#9660;       &#9474;
&#9474;  &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;    &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;  &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;  &#9474;
&#9474;  &#9474; Azure OpenAI &#9474;    &#9474; Cognitive Search &#9474;  &#9474;    Redis    &#9474;  &#9474;
&#9474;  &#9474;   (GPT-4)    &#9474;    &#9474;  (Knowledge Base)&#9474;  &#9474;   (Cache)   &#9474;  &#9474;
&#9474;  &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;    &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;  &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;  &#9474;
&#9474;                                                              &#9474;
&#9474;  &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;    &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;  &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;  &#9474;
&#9474;  &#9474; Service Bus  &#9474;    &#9474;  Key Vault       &#9474;  &#9474;  App Insights&#9474;  &#9474;
&#9474;  &#9474; (Events)     &#9474;    &#9474;  (Secrets)       &#9474;  &#9474;  (Monitoring)&#9474;  &#9474;
&#9474;  &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;    &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;  &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;  &#9474;
&#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
</code></code></pre><h3><strong>Key Architectural Decisions</strong></h3><p><strong>1. Why RAG (Retrieval-Augmented Generation)?</strong></p><ul><li><p>Prevents hallucinations by grounding responses in company KB</p></li><li><p>Updates in real-time as KB documents change</p></li><li><p>Reduces token costs by providing context</p></li></ul><p><strong>2. Why Azure Container Apps?</strong></p><ul><li><p>Serverless with KEDA auto-scaling (2-10 replicas)</p></li><li><p>VNet integration for private endpoints</p></li><li><p>Cost-effective compared to AKS for this workload</p></li></ul><p><strong>3. Why Service Bus Premium?</strong></p><ul><li><p>Event-driven architecture decouples components</p></li><li><p>Geo-disaster recovery built-in</p></li><li><p>Handles burst traffic (500+ tickets/minute)</p></li></ul><div><hr></div><h2><strong>The RAG Pipeline</strong></h2><p>Here&#8217;s how a ticket flows through our system:</p><pre><code><code>Ticket Submitted
     &#9474;
     &#9660;
&#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
&#9474;  Azure AI Language  &#9474;&#9472;&#9472;&#9654; Classification (Network/Access/Hardware)
&#9474;   (Classification)  &#9474;&#9472;&#9472;&#9654; Confidence Score (0.0-1.0)
&#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
     &#9474;
     &#9660;
&#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
&#9474;  Cognitive Search   &#9474;&#9472;&#9472;&#9654; Vector Search Top-K Documents
&#9474;   (Knowledge Base)  &#9474;&#9472;&#9472;&#9654; Semantic Relevance Scoring
&#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
     &#9474;
     &#9660;
&#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
&#9474;   Azure OpenAI      &#9474;&#9472;&#9472;&#9654; Context-Aware Resolution Generation
&#9474;     (GPT-4)         &#9474;&#9472;&#9472;&#9654; Step-by-Step Instructions
&#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
     &#9474;
     &#9660;
Response Delivered (JSON with confidence &amp; resolution)
</code></code></pre><h3><strong>Code Implementation</strong></h3><p><strong>The Core RAG Function:</strong></p><pre><code>def generate_resolution_rag(ticket_text: str) -&gt; dict:
    # Step 1: Retrieve relevant KB documents
    kb_context = query_kb(ticket_text, top_k=3)
    
    # Step 2: Build prompt with context
    prompt = f&#8221;&#8220;&#8221;
    Context from Knowledge Base:
    {format_kb_context(kb_context)}
    
    Ticket: {ticket_text}
    
    Generate step-by-step resolution:
    &#8220;&#8221;&#8220;
    
    # Step 3: Generate with GPT-4
    response = client.chat.completions.create(
        model=OPENAI_DEPLOYMENT,
        messages=[{&#8221;role&#8221;: &#8220;user&#8221;, &#8220;content&#8221;: prompt}],
        temperature=0.3  # Lower for factual accuracy
    )
    
    return {
        &#8220;resolution&#8221;: response.choices[0].message.content,
        &#8220;kb_docs_used&#8221;: kb_context,
        &#8220;validated&#8221;: True,
        &#8220;prompt_version&#8221;: &#8220;v1&#8221;
    }</code></pre><div><hr></div><h2><strong>Building the API</strong></h2><h3><strong>FastAPI with API Versioning</strong></h3><p>We implemented semantic versioning from day one:</p><pre><code># API Versioning
app.include_router(v1_router, prefix=&#8221;/api&#8221;)  # Stable
app.include_router(v2_router, prefix=&#8221;/api&#8221;)  # Enterprise features

# V1: Basic ticket processing
@router.post(&#8221;/v1/process-ticket&#8221;)
def process_ticket_v1(ticket: TicketRequest):
    category, confidence = classify_ticket(ticket.description)
    resolution = generate_resolution_rag(ticket.description)
    return TicketResponse(
        category=category,
        confidence=confidence,
        resolution=resolution
    )

# V2: Async with caching
@router.post(&#8221;/v2/process-ticket&#8221;)
async def process_ticket_v2(ticket: TicketRequestV2):
    # Check cache first
    cached = await get_cached_response(cache_key)
    if cached:
        return cached
    
    # Process with background tasks
    result = await process_with_rag(ticket)
    background_tasks.add_task(cache_response, cache_key, result)
    background_tasks.add_task(publish_event, result)
    
    return result</code></pre><h3><strong>Request/Response Models</strong></h3><pre><code>class TicketRequestV2(BaseModel):
    title: str
    description: str
    priority: Priority = Priority.MEDIUM
    department: Optional[str]
    tags: Optional[List[str]]
    use_cache: bool = True

class TicketResponseV2(BaseModel):
    ticket_id: str
    category: str
    confidence: float
    resolution: str
    processing_time_ms: int
    kb_documents_used: List[Dict]
    estimated_resolution_time: str
    follow_up_actions: List[str]</code></pre><div><hr></div><h2><strong>Testing Strategy</strong></h2><h3><strong>The Mock Challenge</strong></h3><p>Testing Azure-dependent code is tricky. We built comprehensive mocks:</p><pre><code># tests/conftest.py - Module-level mocking
sys.modules[&#8221;app.services.search_client&#8221;] = MagicMock(
    query_kb=lambda text, top_k=3: [
        {&#8221;id&#8221;: &#8220;kb-001&#8221;, &#8220;title&#8221;: &#8220;VPN Guide&#8221;, &#8220;content&#8221;: &#8220;...&#8221;}
    ]
)

sys.modules[&#8221;app.services.classifier&#8221;] = MagicMock(
    classify_ticket=lambda text: (
        &#8220;Network Issue&#8221;, 0.9
    ) if &#8220;vpn&#8221; in text.lower() else (&#8221;General&#8221;, 0.7)
)</code></pre><h3><strong>Test Results</strong></h3><p>After fixing async mock issues:</p><pre><code><code>=================== 29 passed, 18 warnings ===================

Test Breakdown:
- API Endpoints: 17 tests &#9989;
  - Health check
  - V1/V2 API routes
  - Validation
  - Batch processing
  
- Service Layer: 12 tests &#9989;
  - Classification logic
  - KB search
  - Resolution generation
  - Caching
  - Event publishing
</code></code></pre><h3><strong>Running Tests</strong></h3><pre><code># All tests
pytest tests/ -v

# With coverage
pytest tests/ --cov=app --cov-report=html

# Specific module
pytest tests/test_api_endpoints.py::TestAPIV2 -v</code></pre><div><hr></div><h2><strong>Infrastructure as Code</strong></h2><h3><strong>Modular Bicep Architecture</strong></h3><p>We organized infrastructure into reusable modules:</p><pre><code><code>infra/
&#9500;&#9472;&#9472; main.bicep              # Orchestration
&#9500;&#9472;&#9472; modules/
&#9474;   &#9500;&#9472;&#9472; network.bicep       # VNet, NSG, Subnets
&#9474;   &#9500;&#9472;&#9472; aiServices.bicep    # OpenAI, Language, Search
&#9474;   &#9500;&#9472;&#9472; cache.bicep         # Redis Premium
&#9474;   &#9500;&#9472;&#9472; messaging.bicep     # Service Bus
&#9474;   &#9500;&#9472;&#9472; containerApp.bicep  # Container Apps
&#9474;   &#9492;&#9472;&#9472; monitoring.bicep    # App Insights, Alerts
</code></code></pre><h3><strong>Key Bicep Features</strong></h3><p><strong>1. Conditional Deployment:</strong></p><pre><code>param enablePrivateEndpoints bool = true

resource openai &#8216;Microsoft.CognitiveServices/accounts@2023-05-01&#8217; = {
  name: &#8216;${prefix}-openai-${environment}&#8217;
  properties: {
    publicNetworkAccess: enablePrivateEndpoints ? &#8216;Disabled&#8217; : &#8216;Enabled&#8217;
  }
}</code></pre><p><strong>2. Key Vault Integration:</strong></p><pre><code>resource openaiKeySecret &#8216;Microsoft.KeyVault/vaults/secrets@2023-02-01&#8217; = {
  parent: keyVault
  name: &#8216;openai-key&#8217;
  properties: {
    value: aiServices.outputs.openaiKey
  }
}</code></pre><p><strong>3. Auto-scaling Rules:</strong></p><pre><code>scale: {
  minReplicas: 2
  maxReplicas: 10
  rules: [
    {
      name: &#8216;http-rule&#8217;
      http: {
        metadata: {
          concurrentRequests: &#8216;50&#8217;
        }
      }
    }
    {
      name: &#8216;cpu-rule&#8217;
      custom: {
        type: &#8216;cpu&#8217;
        metadata: {
          value: &#8216;70&#8217;
        }
      }
    }
  ]
}</code></pre><h3><strong>Multi-Region Deployment</strong></h3><p>For production, we added a multi-region template:</p><pre><code># Deploy to UAE North (Primary) and UAE Central (DR)
az deployment sub create \
  --template-file infra/multi-region.bicep \
  --location uaenorth \
  --parameters environment=prod</code></pre><p><strong>Front Door Configuration:</strong></p><ul><li><p>Health probes on <code>/health</code> every 30 seconds</p></li><li><p>Automatic failover if primary region fails</p></li><li><p>WAF with OWASP 2.1 rules and rate limiting</p></li><li><p>Geo-filtering capabilities</p></li></ul><div><hr></div><h2><strong>One-Click Deployment</strong></h2><h3><strong>The Deploy Script</strong></h3><p>We wanted deployment to be simple. A single script handles everything:</p><pre><code>./deploy-azure.sh</code></pre><p><strong>Interactive Flow:</strong></p><pre><code><code>&#9556;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9559;
&#9553;      Azure AI IT Automation Platform - One-Click Deploy     &#9553;
&#9562;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9565;

&#9654; Step 1: Checking Prerequisites
&#10003; Azure CLI: 2.57.0
&#10003; Bicep installed
&#10003; Docker: 24.0.7

&#9654; Step 2: Azure Authentication
&#10003; Logged in as: user@company.com

&#9654; Step 3: Configuration
Environment (dev/test/prod) [dev]: dev
Azure Region [uaenorth]: uaenorth
Alert Email: admin@company.com

... deployment in progress (10-15 minutes) ...

&#9556;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9559;
&#9553;                    Deployment Complete!                    &#9553;
&#9562;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9552;&#9565;

Application URLs:
  Health:    https://aiauto-api-dev.xxx.uae.azurecontainerapps.io/health
  API Docs:  https://aiauto-api-dev.xxx.uae.azurecontainerapps.io/docs
  API:       https://aiauto-api-dev.xxx.uae.azurecontainerapps.io
</code></code></pre><h3><strong>What Gets Deployed</strong></h3><p><strong>ResourcePurposeSKU</strong>Container AppsHost FastAPIConsumptionAzure OpenAIGPT-4 inferenceS0Cognitive SearchKB retrievalStandardService BusEvent messagingPremiumRedisResponse cachingPremium P1Key VaultSecrets managementStandardApp InsightsMonitoringPay-as-you-go</p><div><hr></div><h2><strong>Going Live</strong></h2><h3><strong>Pre-Production Checklist</strong></h3><p><strong>1. Security Review:</strong></p><ul><li><p>&#9989; Private Endpoints enabled</p></li><li><p>&#9989; NSG rules configured</p></li><li><p>&#9989; Key Vault RBAC assigned</p></li><li><p>&#9989; WAF rules active</p></li></ul><p><strong>2. Performance Testing:</strong></p><pre><code># Load test with Locust
locust -f load_test.py --host=https://&lt;your-app&gt;.azurecontainerapps.io</code></pre><p><strong>3. Monitoring Setup:</strong></p><ul><li><p>&#9989; Availability alert (&lt; 99%)</p></li><li><p>&#9989; Latency alert (&gt; 2 seconds)</p></li><li><p>&#9989; Error rate alert (&gt; 1%)</p></li><li><p>&#9989; Token usage tracking</p></li></ul><p><strong>4. Disaster Recovery:</strong></p><ul><li><p>&#9989; Multi-region deployment</p></li><li><p>&#9989; Geo-redundant Service Bus</p></li><li><p>&#9989; Redis persistence configured</p></li></ul><h3><strong>First Deployment</strong></h3><pre><code># 1. Deploy infrastructure
./deploy-azure.sh
# Select: prod, uaenorth, enable private endpoints

# 2. Build and push image
az acr build --registry aiautoprod \
  --image azure-ai-automation:v1.0.0 \
  .

# 3. Update Container App
az containerapp update \
  --name aiauto-api-prod \
  --resource-group rg-aiauto-prod \
  --image aiautoprod.azurecr.io/azure-ai-automation:v1.0.0

# 4. Verify health
curl https://aiauto-api-prod.xxx.uae.azurecontainerapps.io/health</code></pre><div><hr></div><h2><strong>Production Performance</strong></h2><h3><strong>Metrics (First Week)</strong></h3><p><strong>MetricTargetActualAvailability</strong>99.9%99.97%<strong>Avg Response Time</strong>&lt; 2s1.2s<strong>Cache Hit Rate</strong>30%34%<strong>Tickets Automated</strong>70%78%<strong>Token Cost/Ticket</strong>&lt;$0.05$0.03</p><h3><strong>Cost Breakdown (Monthly)</strong></h3><pre><code><code>Production (UAE North):
&#9500;&#9472;&#9472; Container Apps          $300
&#9500;&#9472;&#9472; Azure OpenAI (GPT-4)    $800
&#9500;&#9472;&#9472; Service Bus Premium     $700
&#9500;&#9472;&#9472; Redis Premium P1        $400
&#9500;&#9472;&#9472; App Insights            $100
&#9500;&#9472;&#9472; Front Door + WAF        $200
&#9492;&#9472;&#9472; Total:                 ~$2,500/month

Cost per ticket: ~$0.08
(compared to $25/hour for human agent)
</code></code></pre><div><hr></div><h2><strong>Lessons Learned</strong></h2><h3><strong>1. Prompt Engineering is Critical</strong></h3><p>Our first prompts were too generic. We iterated to include:</p><ul><li><p><strong>System message</strong>: &#8220;You are an IT support specialist...&#8221;</p></li><li><p><strong>Few-shot examples</strong>: 3 examples of good resolutions</p></li><li><p><strong>Output format</strong>: Structured JSON with steps</p></li><li><p><strong>Constraints</strong>: &#8220;Use only provided KB context&#8221;</p></li></ul><h3><strong>2. Confidence Scoring Prevents Bad UX</strong></h3><p>Initially, we showed all AI responses. Users complained about wrong answers. Adding confidence scoring (&lt; 0.8 &#8594; human review) improved satisfaction from 65% to 92%.</p><h3><strong>3. Caching Saves 34% on API Costs</strong></h3><p>Similar tickets (password resets) were generating identical responses. Redis caching reduced OpenAI token consumption significantly.</p><h3><strong>4. Async Processing for Batch</strong></h3><p>Processing 100 tickets synchronously caused timeouts. Moving to Service Bus queues with async workers solved this.</p><h3><strong>5. Test Mocks Are Worth the Effort</strong></h3><p>Setting up comprehensive mocks took time, but enabled:</p><ul><li><p>CI/CD pipeline testing</p></li><li><p>Developer onboarding without Azure credentials</p></li><li><p>29 automated tests running in 13 seconds</p></li></ul><div><hr></div><h2><strong>Future Roadmap</strong></h2><p><strong>Phase 2: Enhancement</strong></p><ul><li><p>Multi-language support (Arabic + English)</p></li><li><p>Integration with ServiceNow/JIRA</p></li><li><p>Fine-tuned classification model</p></li><li><p>Voice-to-text for phone tickets</p></li></ul><p><strong>Phase 3: Scale</strong></p><ul><li><p>ML-based ticket routing</p></li><li><p>Predictive analytics for ticket volume</p></li><li><p>Self-healing infrastructure integration</p></li></ul><div><hr></div><h2><strong>Conclusion</strong></h2><p>Building an enterprise AI platform requires more than just calling OpenAI APIs. You need:</p><ol><li><p><strong>Solid Architecture</strong>: RAG for accuracy, caching for cost</p></li><li><p><strong>Enterprise Security</strong>: Private endpoints, managed identities</p></li><li><p><strong>Observability</strong>: Monitoring everything from tokens to latency</p></li><li><p><strong>Testing</strong>: Mocks enable rapid iteration</p></li><li><p><strong>Automation</strong>: One-click deployment reduces human error</p></li></ol><p>The result? <strong>78% of IT tickets now resolved automatically</strong>, with human agents focusing on complex issues requiring empathy and creativity&#8212;things AI can&#8217;t replicate (yet).</p><div><hr></div><h2><strong>Resources</strong></h2><ul><li><p><strong>Source Code</strong>: <a href="https://github.com/your-repo">GitHub Repository</a></p></li><li><p><strong>Architecture Diagrams</strong>: See <code>documentation/DESIGN.md</code></p></li><li><p><strong>API Documentation</strong>: Available at <code>/docs</code> endpoint</p></li><li><p><strong>Deploy Yourself</strong>: Run <code>./deploy-azure.sh</code></p></li></ul><div><hr></div><p><em>Built with Python, FastAPI, Azure OpenAI, and too much coffee &#9749;</em></p><p><em>Questions? Comments? Share your AI automation stories below!</em></p>]]></content:encoded></item><item><title><![CDATA[Building an Intelligent IT Maintenance Notification System with Azure Cloud and OpenAI]]></title><description><![CDATA[A Comprehensive Guide to AI-Powered Alert Processing and Incident Management]]></description><link>https://seyhunak.substack.com/p/building-an-intelligent-it-maintenance</link><guid isPermaLink="false">https://seyhunak.substack.com/p/building-an-intelligent-it-maintenance</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Thu, 12 Mar 2026 17:54:09 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!wYbE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20584d08-7f36-4661-b59c-e5ba9024a63b_3586x1590.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2><strong>Table of Contents</strong></h2><ol><li><p><a href="https://github.com/seyhunak/azure-ai-it-maintenance-notification/blob/main/blog-post.md#1-introduction">Introduction: The Challenge of Modern IT Operations</a></p></li><li><p><a href="https://github.com/seyhunak/azure-ai-it-maintenance-notification/blob/main/blog-post.md#2-system-architecture">System Architecture Overview</a></p></li><li><p><a href="https://github.com/seyhunak/azure-ai-it-maintenance-notification/blob/main/blog-post.md#3-multi-agent-ai-orchestration">Multi-Agent AI Orchestration</a></p></li><li><p><a href="https://github.com/seyhunak/azure-ai-it-maintenance-notification/blob/main/blog-post.md#4-rag-based-knowledge-grounding">RAG-Based Knowledge Grounding</a></p></li><li><p><a href="https://github.com/seyhunak/azure-ai-it-maintenance-notification/blob/main/blog-post.md#5-token-budgeting-and-cost-optimization">Token Budgeting and Cost Optimization</a></p></li><li><p><a href="https://github.com/seyhunak/azure-ai-it-maintenance-notification/blob/main/blog-post.md#6-security-compliance-and-human-in-the-loop">Security, Compliance, and Human-in-the-Loop</a></p></li><li><p><a href="https://github.com/seyhunak/azure-ai-it-maintenance-notification/blob/main/blog-post.md#7-development-experience-and-testing">Development Experience and Testing</a></p></li><li><p><a href="https://github.com/seyhunak/azure-ai-it-maintenance-notification/blob/main/blog-post.md#8-enterprise-features-and-production-readiness">Enterprise Features and Production Readiness</a></p></li><li><p><a href="https://github.com/seyhunak/azure-ai-it-maintenance-notification/blob/main/blog-post.md#9-deployment-and-operations">Deployment and Operations</a></p></li><li><p><a href="https://github.com/seyhunak/azure-ai-it-maintenance-notification/blob/main/blog-post.md#10-conclusion">Conclusion and Future Directions</a></p></li></ol><div><hr></div><h2><strong>1. Introduction: The Challenge of Modern IT Operations</strong></h2><p>Modern IT infrastructure generates thousands of alerts daily from diverse sources: cloud services, containers, APIs, databases, and networking components. T</p><p>raditional rule-based alert systems struggle to keep pace with the volume and complexity of these alerts. SREs and operations teams face alert fatigue, prolonged incident response times, and the challenge of prioritizing critical issues amid noise.</p><p>This article introduces an <strong>AI-powered IT Maintenance Notification System built for Azure Platform</strong> that addresses these challenges by leveraging Large Language Models (LLMs) for intelligent alert classification, Azure services for scalable infrastructure, and a sophisticated multi-agent architecture for processing, validating, and responding to operational alerts.</p><h3><strong>The Core Problem</strong></h3><p>Consider a typical enterprise scenario:</p><ul><li><p>Multiple Kubernetes clusters across regions</p></li><li><p>Hundreds of microservices emitting metrics and logs</p></li><li><p>On-call teams receiving hundreds of alerts per day</p></li><li><p>Need to classify severity, identify root causes, and route to appropriate responders</p></li><li><p>Regulatory requirements for audit trails and compliance</p></li></ul><p>The traditional approach involves:</p><ul><li><p>Complex routing rules and static escalation policies</p></li><li><p>Manual categorization of alerts</p></li><li><p>Copy-paste from runbooks</p></li><li><p>Time-consuming investigation</p></li></ul><p>My solution automates this entire workflow using AI agents that understand context, match alerts against knowledge bases, and provide actionable recommendations.</p><h3><strong>What This System Delivers</strong></h3><p>The Azure AI IT Maintenance Notification System provides:</p><ol><li><p><strong>Intelligent Classification</strong>: AI-powered categorization of alerts into meaningful incident types</p></li><li><p><strong>Contextual Grounding</strong>: Enriches AI responses with organization-specific runbooks and policies</p></li><li><p><strong>Automated Routing</strong>: Determines the right team to page based on alert characteristics</p></li><li><p><strong>Compliance and Audit</strong>: Maintains complete audit trails for regulatory requirements</p></li><li><p><strong>Cost Control</strong>: Sophisticated token budgeting and caching to manage AI costs</p></li><li><p><strong>Human-in-the-Loop</strong>: Escalation paths for critical or ambiguous alerts</p></li><li><p><strong>Multi-Channel Notifications</strong>: Integrates with Email, Teams, Jira, and ServiceNow</p></li></ol><div><hr></div><h2><strong>2. System Architecture Overview</strong></h2><p>The system follows a cloud-native architecture designed for scalability, reliability, and enterprise requirements. It supports two operation modes: <strong>development</strong> (using local model for AI processing) and <strong>production</strong> (leveraging Azure OpenAI and other Azure services).</p><h3><strong>High-Level Architecture</strong></h3><pre><code><code>&#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;     &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;     &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
&#9474;   Data Sources  &#9474;&#9472;&#9472;&#9472;&#9472;&#9654;&#9474;  Azure Functions &#9474;&#9472;&#9472;&#9472;&#9472;&#9654;&#9474;   AI Services   &#9474;
&#9474;  (Event Hubs)   &#9474;     &#9474;   (Processing)   &#9474;     &#9474;  (LLM + Safety) &#9474;
&#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;     &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;     &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
                                 &#9474;                        &#9474;
                                 &#9660;                        &#9660;
                        &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;     &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
                        &#9474;   Validation     &#9474;     &#9474;  Notifications  &#9474;
                        &#9474;   (PII Removal)  &#9474;     &#9474;(Multi-channel)  &#9474;
                        &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;     &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
                                 &#9474;                        &#9474;
                                 &#9660;                        &#9660;
                        &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
                        &#9474;            Azure Cosmos DB                 &#9474;
                        &#9474;       (Storage + Audit + Analytics)       &#9474;
                        &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
</code></code></pre><h3><strong>Key Components</strong></h3><h4><strong>Ingestion Layer</strong></h4><ul><li><p><strong>Azure Event Hubs</strong>: For streaming telemetry from Kubernetes, applications, and infrastructure</p></li><li><p><strong>HTTP API</strong>: Direct ingestion via <code>/api/alerts/process</code> and <code>/api/agents/process</code></p></li><li><p><strong>Event Hub Simulation</strong>: Local development queue with queue, consume, and completed views</p></li></ul><h4><strong>Processing Layer</strong></h4><ul><li><p><strong>Azure Functions</strong>: Normalize and enrich alert payloads</p></li><li><p><strong>Multi-Agent Orchestration</strong>: ManagerAgent coordinates ValidatorAgent, SafetyAgent, and ClassifierAgent</p></li><li><p><strong>Orchestration Layer</strong>: Tracks workflow state, conflicts, and resource allocation</p></li></ul><h4><strong>AI Services Layer</strong></h4><ul><li><p><strong>Development</strong>: Local model deployed instance for LLM processing</p></li><li><p><strong>Production</strong>: Azure OpenAI with GPT-4 for classification</p></li><li><p><strong>Safety</strong>: Azure Content Safety for content moderation</p></li><li><p><strong>RAG</strong>: Local KB files or Azure Search for knowledge grounding</p></li></ul><h4><strong>Storage Layer</strong></h4><ul><li><p><strong>Azure Cosmos DB</strong>: Production storage for alerts, audit logs, and review queues</p></li><li><p><strong>File System</strong>: Development-mode JSONL files for audit and review logs</p></li></ul><h4><strong>Notification Layer</strong></h4><ul><li><p><strong>Multi-channel delivery</strong>: Email (SMTP), Microsoft Teams, Jira, ServiceNow</p></li><li><p><strong>Configurable recipients</strong>: Per-alert-type routing</p></li></ul><h3><strong>Data Flow</strong></h3><ol><li><p><strong>Telemetry Source</strong> emits alert events (Kubernetes, applications, monitoring tools)</p></li><li><p><strong>Azure Event Hubs</strong> receives and queues the events</p></li><li><p><strong>Azure Functions</strong> preprocesses and normalizes the alert payload</p></li><li><p><strong>ManagerAgent</strong> orchestrates the processing pipeline:</p><ul><li><p>ValidatorAgent validates required fields and timestamp format</p></li><li><p>SafetyAgent checks for blocked keywords and PII</p></li><li><p>ClassifierAgent categorizes the alert and suggests actions</p></li></ul></li><li><p><strong>RAG Grounding</strong> enriches responses with knowledge base citations</p></li><li><p><strong>Notifications</strong> delivered to appropriate channels</p></li><li><p><strong>Audit records</strong> persisted for compliance</p></li></ol><div><hr></div><h2><strong>3. Multi-Agent AI Orchestration</strong></h2><p>The heart of the system is a sophisticated multi-agent architecture where specialized AI agents collaborate to process alerts. This design separates concerns, enables parallel processing, and provides clear audit trails.</p><h3><strong>The Agent Hierarchy</strong></h3><pre><code><code>ManagerAgent (Orchestrator)
&#9500;&#9472;&#9472; ValidatorAgent      &#8594; Validates alert structure and data
&#9500;&#9472;&#9472; SafetyAgent        &#8594; Checks for sensitive content and PII
&#9492;&#9472;&#9472; ClassifierAgent    &#8594; Categorizes and recommends actions
</code></code></pre><h3><strong>Communication Protocol</strong></h3><p>Agents communicate through a structured message protocol:</p><pre><code>class AgentMessage:
    sender: str          # Agent name
    receiver: str       # Target agent
    kind: str          # &#8220;task_request&#8221; or &#8220;task_response&#8221;
    payload: Dict      # Message data
    timestamp: datetime
    correlation_id: str # Links messages to original event</code></pre><p>All inter-agent messages are logged for full traceability, enabling post-incident analysis and compliance audits.</p><h3><strong>Agent Details</strong></h3><h4><strong>ValidatorAgent</strong></h4><p>The ValidatorAgent ensures incoming alerts meet structural requirements:</p><ul><li><p><strong>Required Fields</strong>: Validates presence of event_id, timestamp, service_name, alert_type, severity, and message</p></li><li><p><strong>Timestamp Format</strong>: Enforces ISO-8601 compliance</p></li><li><p><strong>Severity Validation</strong>: Checks against allowed values (critical, high, medium, low)</p></li><li><p><strong>AI-Enhanced Validation</strong>: Optional AI validation for complex cases via <code>use_ai_validation=true</code></p></li></ul><pre><code># ValidatorAgent checks include:
- Required fields present
- ISO-8601 timestamp format
- Valid severity levels
- Non-standard alert type warnings</code></pre><h4><strong>SafetyAgent</strong></h4><p>The SafetyAgent performs content moderation in two stages:</p><p><strong>Local Checks (Development &amp; Production)</strong>:</p><ul><li><p>Blocked keywords: confidential, proprietary, trade secret, classified, secret, top secret</p></li><li><p>PII detection patterns: email, IP address, phone, SSN, credit card, password, API key, bearer tokens</p></li></ul><p><strong>Azure Content Safety (Production)</strong>:</p><ul><li><p>Hate speech detection</p></li><li><p>Violence and self-harm analysis</p></li><li><p>Sexual content filtering</p></li></ul><p>The SafetyAgent returns:</p><pre><code>{
    &#8220;is_safe&#8221;: bool,
    &#8220;sanitized_text&#8221;: str,
    &#8220;issues&#8221;: List[str],
    &#8220;azure_content_safety&#8221;: Dict  # Production only
}</code></pre><h4><strong>ClassifierAgent</strong></h4><p>The ClassifierAgent uses LLMs to categorize alerts and recommend actions:</p><p><strong>Categories</strong>:</p><ul><li><p>database_outage</p></li><li><p>api_failure</p></li><li><p>infrastructure_issue</p></li><li><p>security_breach</p></li><li><p>performance_degradation</p></li><li><p>capacity_issue</p></li><li><p>connectivity_problem</p></li><li><p>application_error</p></li><li><p>configuration_issue</p></li></ul><p><strong>Output</strong>:</p><pre><code>{
    &#8220;category&#8221;: str,
    &#8220;severity&#8221;: str,
    &#8220;confidence&#8221;: float,
    &#8220;root_cause&#8221;: str,
    &#8220;affected_components&#8221;: List[str],
    &#8220;recommended_actions&#8221;: List[str]
}</code></pre><h4><strong>ManagerAgent</strong></h4><p>The ManagerAgent orchestrates the workflow:</p><ol><li><p>Receives the raw alert</p></li><li><p>Dispatches to ValidatorAgent &#8594; SafetyAgent &#8594; ClassifierAgent</p></li><li><p>Short-circuits on validation failure or safety block</p></li><li><p>Applies RAG grounding for contextual enrichment</p></li><li><p>Handles Human-in-the-Loop (HITL) for complex cases</p></li><li><p>Writes audit and review records</p></li><li><p>Returns final response</p></li></ol><h3><strong>Workflow Visualization</strong></h3><p>Here is the sequence diagram format as image</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wYbE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20584d08-7f36-4661-b59c-e5ba9024a63b_3586x1590.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wYbE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20584d08-7f36-4661-b59c-e5ba9024a63b_3586x1590.png 424w, https://substackcdn.com/image/fetch/$s_!wYbE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20584d08-7f36-4661-b59c-e5ba9024a63b_3586x1590.png 848w, https://substackcdn.com/image/fetch/$s_!wYbE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20584d08-7f36-4661-b59c-e5ba9024a63b_3586x1590.png 1272w, https://substackcdn.com/image/fetch/$s_!wYbE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20584d08-7f36-4661-b59c-e5ba9024a63b_3586x1590.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wYbE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20584d08-7f36-4661-b59c-e5ba9024a63b_3586x1590.png" width="1456" height="646" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/20584d08-7f36-4661-b59c-e5ba9024a63b_3586x1590.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:646,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:258755,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/190752801?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20584d08-7f36-4661-b59c-e5ba9024a63b_3586x1590.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wYbE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20584d08-7f36-4661-b59c-e5ba9024a63b_3586x1590.png 424w, https://substackcdn.com/image/fetch/$s_!wYbE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20584d08-7f36-4661-b59c-e5ba9024a63b_3586x1590.png 848w, https://substackcdn.com/image/fetch/$s_!wYbE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20584d08-7f36-4661-b59c-e5ba9024a63b_3586x1590.png 1272w, https://substackcdn.com/image/fetch/$s_!wYbE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20584d08-7f36-4661-b59c-e5ba9024a63b_3586x1590.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;8696f97b-548a-4ed7-81a8-592b5ce84170&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">sequenceDiagram
  participant Client
  participant API
  participant Manager
  participant Validator
  participant Safety
  participant Classifier
  participant RAG
  participant Store

  Client-&gt;&gt;API: POST /api/agents/process
  API-&gt;&gt;Manager: process_alert()
  Manager-&gt;&gt;Validator: task_request
  Validator--&gt;&gt;Manager: task_response (is_valid)
  Manager-&gt;&gt;Safety: task_request
  Safety--&gt;&gt;Manager: task_response (is_safe)
  Manager-&gt;&gt;Classifier: task_request
  Classifier--&gt;&gt;Manager: task_response (classification)
  Manager-&gt;&gt;RAG: build_grounding()
  RAG--&gt;&gt;Manager: citations/actions/escalation
  Manager-&gt;&gt;Store: audit/review logs
  Manager--&gt;&gt;API: final_result
  API--&gt;&gt;Client: response</code></pre></div><div><hr></div><h2><strong>4. RAG-Based Knowledge Grounding</strong></h2><p>A key innovation in this system is the Retrieval-Augmented Generation (RAG) approach that grounds AI responses in your organization&#8217;s specific knowledge base.</p><h3><strong>Knowledge Sources</strong></h3><p>The system supports two knowledge source modes:</p><h4><strong>Local Knowledge Base (Development)</strong></h4><ul><li><p><code>knowledge_base/kb_services.json</code> - Service definitions, owners, SLAs</p></li><li><p><code>knowledge_base/kb_runbooks.json</code> - Incident response procedures</p></li><li><p><code>knowledge_base/kb_policies.json</code> - Security and compliance policies</p></li></ul><h4><strong>Azure Search (Production)</strong></h4><ul><li><p>Vectorized search across indexed documents</p></li><li><p>Hybrid retrieval combining keyword and semantic search</p></li><li><p>Configurable index names and scoring profiles</p></li></ul><h3><strong>Grounding Output</strong></h3><p>When RAG is applied, the system enriches responses with:</p><pre><code>{
    &#8220;grounded_summary&#8221;: str,           # AI-generated summary
    &#8220;citations&#8221;: [                     # Source references
        {
            &#8220;source&#8221;: &#8220;knowledge_base/kb_services.json&#8221;,
            &#8220;path&#8221;: &#8220;services[service_name=api-gateway]&#8221;
        }
    ],
    &#8220;recommended_actions&#8221;: List[str],  # From matching runbooks
    &#8220;escalation&#8221;: {                    # From runbook paging rules
        &#8220;page_team&#8221;: &#8220;platform&#8221;,
        &#8220;paging_policy&#8221;: &#8220;P1&#8221;
    },
    &#8220;policy_actions&#8221;: List[str],        # From policy matches
    &#8220;search_hits&#8221;: List[Dict]          # Azure Search results (production)
}</code></pre><h3><strong>Configuration</strong></h3><pre><code># Knowledge base location
KNOWLEDGE_BASE_DIR=/path/to/kb

# Enable Azure Search in production
USE_AZURE_SEARCH=true
AZURE_SEARCH_ENDPOINT=https://&lt;service&gt;.search.windows.net
AZURE_SEARCH_KEY=&lt;key&gt;
AZURE_SEARCH_INDEX=alerts</code></pre><h3><strong>Practical Example</strong></h3><p>Consider an alert for API Gateway degradation:</p><ol><li><p><strong>Alert Received</strong>: &#8220;Response time exceeded threshold: 1200ms&#8221;</p></li><li><p><strong>Classification</strong>: &#8220;performance_degradation&#8221; with 90% confidence</p></li><li><p><strong>RAG Query</strong>: Search runbooks for &#8220;service_degradation&#8221; + &#8220;high&#8221; severity</p></li><li><p><strong>Grounding Found</strong>: Runbook with recommended actions for API Gateway issues</p></li><li><p><strong>Final Response</strong>:</p></li></ol><pre><code>{
  &#8220;category&#8221;: &#8220;performance_degradation&#8221;,
  &#8220;severity&#8221;: &#8220;high&#8221;,
  &#8220;actions&#8221;: [
    &#8220;Check current error rate and p95 latency for the affected service.&#8221;,
    &#8220;Validate upstream dependencies for increased latency or errors.&#8221;,
    &#8220;Scale the service if CPU or memory is above 80% for 5 minutes.&#8221;
  ],
  &#8220;escalation&#8221;: {&#8221;page_team&#8221;: &#8220;platform&#8221;, &#8220;paging_policy&#8221;: &#8220;P1&#8221;},
  &#8220;citations&#8221;: [
    {&#8221;source&#8221;: &#8220;knowledge_base/kb_runbooks.json&#8221;, 
     &#8220;path&#8221;: &#8220;runbooks[alert_type=service_degradation,severity=high]&#8221;}
  ]
}</code></pre><div><hr></div><h2><strong>5. Token Budgeting and Cost Optimization</strong></h2><p>Running AI at scale requires careful cost management. The system implements multiple layers of optimization to control LLM spending while maintaining quality.</p><h3><strong>Token Budgeting</strong></h3><pre><code># Daily token cap
TOKEN_BUDGET_DAILY=1000000

# Per-request limit
TOKEN_BUDGET_PER_REQUEST=5000

# Circuit breaker - stop LLM calls if budget exceeded
TOKEN_BUDGET_CIRCUIT_BREAKER_RATIO=0.9</code></pre><p>When daily budget approaches the threshold, the circuit breaker automatically engages, falling back to rule-based classification.</p><h3><strong>Response Caching</strong></h3><pre><code># Cache TTL (time-to-live)
LLM_CACHE_TTL_SECONDS=3600

# Maximum cache entries
LLM_CACHE_MAX_ENTRIES=10000

# Normalize numbers in cache keys to improve hit rate
LLM_CACHE_NORMALIZE_NUMBERS=true</code></pre><p>Caching dramatically reduces costs for repeated similar alerts. A 5% improvement in cache hit rate can reduce LLM costs by 15-20%.</p><h3><strong>Deduplication</strong></h3><pre><code># Deduplication window
LLM_DEDUPE_TTL_SECONDS=300

# Maximum dedupe entries
LLM_DEDUPE_MAX_ENTRIES=5000</code></pre><p>When identical alerts arrive within the deduplication window, the system returns cached results without calling the LLM.</p><h3><strong>Sampling</strong></h3><p>For lower-priority alerts, the system can use probabilistic sampling to reduce LLM calls:</p><pre><code># Medium priority sampling rate (0.0-1.0)
LLM_SAMPLE_RATE_MEDIUM=0.8

# Low priority sampling rate
LLM_SAMPLE_RATE_LOW=0.5</code></pre><p>Sampled alerts receive fallback classification based on rules rather than LLM inference.</p><h3><strong>Per-Tenant Budgets</strong></h3><p>For multi-tenant deployments, individual tenants can have separate budgets:</p><pre><code>TENANT_TOKEN_BUDGET_DAILY=500000
TENANT_TOKEN_BUDGET_PER_REQUEST=2500</code></pre><p>This ensures one tenant cannot exhaust the organization&#8217;s total budget.</p><h3><strong>Fallback Classification</strong></h3><p>When budgets, sampling, or deduplication skip LLM inference, the system uses fallback classification:</p><pre><code>FALLBACK_CATEGORY=&#8221;needs_investigation&#8221;
FALLBACK_SEVERITY=&#8221;medium&#8221;</code></pre><p>Fallbacks can trigger Human-in-the-Loop review for ambiguous cases.</p><div><hr></div><h2><strong>6. Security, Compliance, and Human-in-the-Loop</strong></h2><p>Enterprise deployments require robust security controls, compliance tracking, and mechanisms for human oversight.</p><h3><strong>Authentication and Authorization</strong></h3><h4><strong>JWT Authentication</strong></h4><pre><code>AUTH_MODE=jwt
JWT_SECRET=&lt;secret&gt;           # For HS256
JWT_JWKS_URL=&lt;url&gt;            # For RS256/OAuth
JWT_REQUIRED_SCOPES=alerts:read,alerts:write</code></pre><h4><strong>Role-Based Access Control (RBAC)</strong></h4><pre><code>RBAC_ENABLED=true
RBAC_HEADER=X-Role            # Header containing role
RBAC_ALLOWED_ROLES=admin,operator,viewer</code></pre><h4><strong>Tenant Isolation</strong></h4><pre><code>TENANT_HEADER=X-Tenant-Id
TENANT_REQUIRED=true         # Enforce tenant context</code></pre><h3><strong>Rate Limiting</strong></h3><pre><code>RATE_LIMIT_PER_MINUTE=100
RATE_LIMIT_BURST=20</code></pre><p>Rate limits can be applied per tenant or per IP address.</p><h3><strong>Idempotency</strong></h3><p>For exactly-once processing semantics:</p><pre><code>Idempotency-Key: &lt;uuid&gt;</code></pre><p>Duplicate requests with the same key return cached results rather than reprocessing.</p><h3><strong>Human-in-the-Loop (HITL)</strong></h3><p>Certain alerts require human judgment. HITL routes these to a review queue:</p><pre><code>HITL_ENABLED=true
HITL_SEVERITIES=critical,high    # Auto-escalate these severities
HITL_ON_SAFETY=true              # Route when safety issues found
HITL_ON_FALLBACK=true            # Route when using fallback classification</code></pre><p>When HITL triggers, the response includes:</p><pre><code>{
  &#8220;status&#8221;: &#8220;HITL&#8221;,
  &#8220;summary&#8221;: &#8220;Classification deferred pending human review.&#8221;,
  &#8220;classification&#8221;: {
    &#8220;status&#8221;: &#8220;HITL&#8221;,
    &#8220;note&#8221;: &#8220;Classification deferred pending human review.&#8221;
  }
}</code></pre><p>Review queues are stored in:</p><ul><li><p><strong>Production</strong>: Cosmos DB <code>review_queue</code> container</p></li><li><p><strong>Development</strong>: <code>REVIEW_LOG_PATH</code> (JSONL file)</p></li></ul><h3><strong>Audit Trail</strong></h3><p>All processing is logged for compliance:</p><pre><code>AUDIT_RETENTION_DAYS=90
REVIEW_RETENTION_DAYS=30</code></pre><p>Audit records include:</p><ul><li><p>Full request/response payloads</p></li><li><p>Inter-agent message traces</p></li><li><p>Classification rationale</p></li><li><p>Prompt version and model used</p></li><li><p>Trace and tenant IDs</p></li></ul><pre><code># Audit storage
AUDIT_LOG_PATH=logs/audit.log      # Development
# Production: Cosmos DB audit_logs container</code></pre><h3><strong>Data Privacy</strong></h3><p>The SafetyAgent provides PII redaction:</p><ul><li><p>Email addresses &#8594; [EMAIL_REDACTED]</p></li><li><p>IP addresses &#8594; [IP_ADDRESS_REDACTED]</p></li><li><p>Passwords/keys &#8594; [PASSWORD_REDACTED]</p></li><li><p>SSN, credit cards &#8594; [SSN_REDACTED], [CREDIT_CARD_REDACTED]</p></li></ul><div><hr></div><h2><strong>7. Development Experience and Testing</strong></h2><p>The system prioritizes developer experience with local-first development, comprehensive testing, and realistic simulation capabilities.</p><h3><strong>Local Development Setup</strong></h3><pre><code># Create virtual environment
python -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp config/.env.example config/.env
# Edit .env with development settings

# Start the server
./venv/bin/python swagger_server.py</code></pre><h3><strong>Development Configuration</strong></h3><pre><code>ENVIRONMENT=development
PROMPT_VERSION=v2
OLLAMA_MODEL=qwen3.5:cloud
OLLAMA_BASE_URL=http://localhost:11434</code></pre><h3><strong>Event Hub Simulation</strong></h3><p>In development, you can simulate the full Event Hub pipeline without Azure:</p><pre><code># Start simulation - generates 1 event per interval
curl -X POST http://localhost:8080/api/eventhub/sim/start

# Check queue
curl http://localhost:8080/api/eventhub/sim/queue

# Process one item
curl -X POST http://localhost:8080/api/eventhub/sim/consume

# View completed
curl http://localhost:8080/api/eventhub/sim/completed

# Stop simulation
curl -X POST http://localhost:8080/api/eventhub/sim/stop</code></pre><h3><strong>Health Checks</strong></h3><pre><code># Readiness check
curl http://localhost:8080/api/health

# Azure dependency check (production)
curl http://localhost:8080/api/health/azure

# Ollama availability (development)
curl http://localhost:8080/api/health/ollama</code></pre><h3><strong>Response Modes</strong></h3><pre><code># Compact (default) - minimal output
# Full - includes all details and debugging info
DEBUG_RESPONSE=true</code></pre><h3><strong>Testing</strong></h3><pre><code># Run all tests
./venv/bin/python -m pytest

# Run specific test file
./venv/bin/python -m pytest tests/test_agents.py

# Run with coverage
./venv/bin/python -m pytest --cov=src --cov-report=html</code></pre><h4><strong>Test Categories</strong></h4><ul><li><p><strong>Unit Tests</strong>: Individual agent logic (<code>test_agents.py</code>)</p></li><li><p><strong>Configuration Tests</strong>: Environment and service factory (<code>test_config.py</code>)</p></li><li><p><strong>Core Tests</strong>: Data generator and utilities (<code>test_core.py</code>)</p></li><li><p><strong>Notification Tests</strong>: Multi-channel delivery (<code>test_notifications.py</code>)</p></li><li><p><strong>Analytics Tests</strong>: Storage and analysis (<code>test_analytics_storage.py</code>)</p></li></ul><h3><strong>Data Generator</strong></h3><p>The TelemetryDataGenerator creates realistic test data:</p><pre><code>from src.data_generator.main import TelemetryDataGenerator

generator = TelemetryDataGenerator()

# Generate 10 random alerts
alerts = generator.generate_sample_events(count=10)

# Generate harmful test data (for safety testing)
harmful = generator.generate_harmful_event()</code></pre><p>Harmful message types include:</p><ul><li><p>SQL injection attempts</p></li><li><p>XSS payloads</p></li><li><p>Prompt injection</p></li><li><p>Credential leaks</p></li></ul><div><hr></div><h2><strong>8. Enterprise Features and Production Readiness</strong></h2><p>For enterprise deployments, the system provides comprehensive features addressing identity, isolation, observability, and governance.</p><h3><strong>Current Enterprise Features</strong></h3><p><strong>FeatureImplementation</strong>Multi-agent orchestrationManagerAgent, ValidatorAgent, SafetyAgent, ClassifierAgentRAG groundingLocal KB files or Azure SearchAuditabilityCosmos DB audit_logs with retentionExplainabilityFull workflow traces and rationaleHITLReview queue with status routingToken budgetingDaily/per-request limits, circuit breakerCachingTTL-based LLM response cacheAzure integrationOpenAI, Content Safety, Cosmos, Event Hubs, SearchRBACHeader-based role enforcementJWT authHS256/JWKS supportTenant isolationHeader-based tenant contextRate limitingPer-minute and burst limitsIdempotencyIdempotency-Key header supportDead-letter loggingFailed processing storageRequest tracingTrace ID propagationMetricsPrometheus-style counters</p><h3><strong>Identity and Access Management</strong></h3><p><strong>Current</strong>: Header-based RBAC <strong>Recommended</strong>: Entra ID / OAuth2 integration</p><p>The recommended upgrade path includes:</p><ul><li><p>JWT validation with proper issuer/audience</p></li><li><p>API scopes per endpoint</p></li><li><p>Service-to-service auth with managed identity</p></li></ul><h3><strong>Multi-Tenant Isolation</strong></h3><p>The system supports tenant-aware operations:</p><ul><li><p>Tenant header extraction</p></li><li><p>Per-tenant rate limits</p></li><li><p>Per-tenant token budgets</p></li><li><p>Partitioned storage (Cosmos DB <code>/tenant_id</code>)</p></li></ul><h3><strong>Observability</strong></h3><p>Current capabilities:</p><ul><li><p>Request counters and latency metrics (<code>/api/metrics</code>)</p></li><li><p>Structured logging to files</p></li><li><p>Trace ID propagation</p></li></ul><p>Recommended enhancements:</p><ul><li><p>OpenTelemetry integration</p></li><li><p>Distributed tracing across agents</p></li><li><p>SLO dashboards and alerting</p></li></ul><h3><strong>Reliability</strong></h3><p>Production hardening includes:</p><ul><li><p>Retry policies for transient failures</p></li><li><p>Circuit breakers for budget exhaustion</p></li><li><p>Dead-letter queues for failed processing</p></li><li><p>Cosmos DB TTL for automatic cleanup</p></li></ul><h3><strong>Compliance</strong></h3><p>For regulatory requirements:</p><ul><li><p>Audit log retention controls</p></li><li><p>Immutable audit trail (append-only)</p></li><li><p>Data classification for PII</p></li><li><p>Encryption at rest and in transit</p></li></ul><div><hr></div><h2><strong>9. Deployment and Operations</strong></h2><h3><strong>Azure Deployment Options</strong></h3><h4><strong>1-Click Deployment</strong></h4><pre><code>./scripts/deploy_azure_oneclick.sh \
  -g ai-it-maintenance-rg \
  -l eastus \
  -p aiit \
  -t v1</code></pre><p>Parameters:</p><ul><li><p><code>-g</code>: Resource group name</p></li><li><p><code>-l</code>: Azure region</p></li><li><p><code>-p</code>: Prefix for resource naming (must be unique)</p></li><li><p><code>-t</code>: Deployment template version</p></li></ul><h4><strong>Private Networking</strong></h4><pre><code>./scripts/deploy_azure_oneclick.sh \
  -g ai-it-maintenance-rg \
  -l eastus \
  -p aiit \
  -t v1 \
  --private-networking \
  --disable-public</code></pre><p>This creates:</p><ul><li><p>Virtual Network with subnets</p></li><li><p>Private DNS zones</p></li><li><p>Private endpoints for Key Vault, Cosmos, Search, Event Hubs</p></li><li><p>No public internet access to services</p></li></ul><h3><strong>Infrastructure as Code</strong></h3><p>The system uses Bicep for infrastructure:</p><pre><code># Deploy infrastructure only
az deployment group create \
  --resource-group ai-it-maintenance-rg \
  --template-file infra/main.bicep \
  --parameters prefix=aiit location=eastus</code></pre><p>Key infrastructure parameters:</p><ul><li><p><code>enablePrivateNetworking</code>: VNet and private endpoints</p></li><li><p><code>disablePublicAccess</code>: No public IPs</p></li><li><p><code>auditTtlSeconds</code>: Audit log retention</p></li><li><p><code>reviewTtlSeconds</code>: Review queue retention</p></li><li><p><code>searchIndexName</code>: Azure Search index</p></li></ul><h3><strong>Production Checklist</strong></h3><p>Before going live:</p><ol><li><p><strong>Configuration</strong></p><ul><li><p>Set <code>ENVIRONMENT=production</code></p></li><li><p>Configure Key Vault secrets</p></li><li><p>Validate all required config via <code>/api/health</code></p></li></ul></li><li><p><strong>Security</strong></p><ul><li><p>Enable JWT authentication</p></li><li><p>Configure tenant isolation</p></li><li><p>Set up RBAC roles</p></li><li><p>Enable rate limiting</p></li></ul></li><li><p><strong>Observability</strong></p><ul><li><p>Configure metrics collection</p></li><li><p>Set up alerting (Azure Monitor)</p></li><li><p>Define SLOs in <code>config/slo.yaml</code></p></li></ul></li><li><p><strong>Reliability</strong></p><ul><li><p>Enable Event Hub publishing</p></li><li><p>Configure dead-letter handling</p></li><li><p>Set up backup and recovery</p></li></ul></li><li><p><strong>Testing</strong></p><ul><li><p>Run load tests (<code>scripts/load_test_plan.md</code>)</p></li><li><p>Run chaos tests (<code>scripts/chaos_test_plan.md</code>)</p></li><li><p>Validate HITL workflow</p></li></ul></li></ol><h3><strong>Health Endpoints</strong></h3><pre><code># Basic readiness
curl http://&lt;host&gt;/api/health

# Azure dependencies
curl http://&lt;host&gt;/api/health/azure

# Metrics
curl http://&lt;host&gt;/api/metrics</code></pre><h3><strong>Rollback Procedure</strong></h3><p>If issues occur post-deployment:</p><ol><li><p>Disable event ingestion</p></li><li><p>Revert container deployment to previous version</p></li><li><p>Restore environment configuration</p></li><li><p>Validate health endpoints</p></li><li><p>Re-enable ingestion gradually</p></li></ol><div><hr></div><h2><strong>10. Conclusion and Future Directions</strong></h2><p>The Azure AI IT Maintenance Notification System demonstrates a practical approach to applying AI to operational challenges. By combining multi-agent orchestration, RAG-based grounding, and enterprise-grade features, it provides a foundation for intelligent incident management.</p><h3><strong>Key Achievements</strong></h3><ol><li><p><strong>Intelligent Classification</strong>: AI-powered categorization that understands context and suggests actions</p></li><li><p><strong>Knowledge Integration</strong>: RAG grounding with organization-specific runbooks and policies</p></li><li><p><strong>Cost Control</strong>: Token budgeting, caching, and sampling for predictable AI spending</p></li><li><p><strong>Compliance</strong>: Complete audit trails, retention controls, and data privacy</p></li><li><p><strong>Flexibility</strong>: Dual-mode operation (Local dev, Azure OpenAI prod)</p></li><li><p><strong>Developer Experience</strong>: Local development, simulation, and comprehensive testing</p></li></ol><h3><strong>Recommended Next Steps</strong></h3><p>For teams adopting this system:</p><ol><li><p><strong>Start with Development Mode</strong>: Use local model to explore agent behaviors</p></li><li><p><strong>Build Your Knowledge Base</strong>: Create runbooks and service catalogs</p></li><li><p><strong>Pilot with Low-Stakes Alerts</strong>: Begin with non-critical notifications</p></li><li><p><strong>Iterate on Prompt Engineering</strong>: Refine classification prompts based on results</p></li><li><p><strong>Add HITL for Edge Cases</strong>: Build human review workflows</p></li><li><p><strong>Scale to Production</strong>: Enable Azure services and configure production settings</p></li></ol><h3><strong>Future Enhancements</strong></h3><p>Potential areas for extension:</p><ul><li><p><strong>Fine-tuned Models</strong>: Domain-specific fine-tuning for better classification</p></li><li><p><strong>Proactive Remediation</strong>: Auto-remediation scripts triggered by classification</p></li><li><p><strong>Advanced Analytics</strong>: ML-based trend analysis and anomaly detection</p></li><li><p><strong>Multi-Cloud Support</strong>: Extend beyond Azure for multi-cloud deployments</p></li><li><p><strong>Custom Agents</strong>: Framework for adding domain-specific agents</p></li></ul><h3><strong>Resources</strong></h3><ul><li><p><strong>Repository</strong>: <a href="https://github.com/seyhunak/azure-ai-it-maintenance-notification">https://github.com/seyhunak/azure-ai-it-maintenance-notification</a></p></li><li><p><strong>Documentation</strong>: See <code>documentation/</code> folder</p></li><li><p><strong>Architecture Docs</strong>: <code>documentation/architecture.md</code>, <code>documentation/system_architecture.md</code></p></li><li><p><strong>Agent Details</strong>: <code>documentation/agents.md</code></p></li><li><p><strong>RAG Configuration</strong>: <code>documentation/rag.md</code></p></li><li><p><strong>Development Guide</strong>: <code>documentation/development.md</code></p></li><li><p><strong>Production Launch</strong>: <code>documentation/production-launch.md</code></p></li></ul><div><hr></div><p><em>This system represents a practical application of AI agents to real-world operational challenges, demonstrating how modern AI capabilities can be integrated into enterprise infrastructure while maintaining security, compliance, and cost control.</em></p><div><hr></div><p><strong>Tags</strong>: Azure, AI, LLM, Incident Management, Alert Processing, RAG, Multi-Agent Systems, DevOps, SRE, Cloud Native</p>]]></content:encoded></item><item><title><![CDATA[Fintech Mobile Architecture Clean Architecture React Native (Expo) Supabase Backend with Zustand + SQLite + Secure Storage]]></title><description><![CDATA[In this post, we are building a compliant, offline-capable personal finance app with strong consistency guarantees, end-to-end encryption, and minimal operational complexity using Expo, Clean Architecture, and Supabase.]]></description><link>https://seyhunak.substack.com/p/fintech-mobile-architecture-clean</link><guid isPermaLink="false">https://seyhunak.substack.com/p/fintech-mobile-architecture-clean</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Thu, 05 Feb 2026 09:35:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!gH7p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F960d9907-1604-4466-9928-0c7f56fb4282_2297x1620.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>In this post, we are building a compliant, offline-capable personal finance app with strong consistency guarantees, end-to-end encryption, and minimal operational complexity using Expo, Clean Architecture, and Supabase.</strong></p><h4>1. Understanding Requirements</h4><p>A user opens the mobile fintech app to manage their personal finances securely. They authenticate with multi-factor verification, view account balances and transaction history (cached locally for quick access), initiate transfers or payments with details like recipient, amount, and notes, categorize expenses, set budgets, and receive real-time notifications for activities. The app supports offline operations by queuing transactions locally and syncing them to the backend upon reconnection, ensuring compliance with financial regulations and handling conflicts like insufficient funds or duplicate transactions gracefully.</p><h4>2. Event Storming</h4><p>Key domain events extracted from the story, in chronological flow:</p><ul><li><p><strong>UserAuthenticated</strong>: Triggered by Login command; involves User aggregate; results in session token stored and AppInitialized event.</p></li><li><p><strong>AccountsFetched</strong>: Triggered by ViewAccounts command; involves Account aggregate; results in local DB update and UI refresh.</p></li><li><p><strong>TransactionCreated</strong>: Triggered by CreateTransaction command; involves Transaction aggregate; results in local DB insert, balance update, and SyncPending event.</p></li><li><p><strong>TransactionUpdated</strong>: Triggered by UpdateTransaction command; involves Transaction aggregate; results in local DB update and SyncPending event.</p></li><li><p><strong>TransactionDeleted</strong>: Triggered by DeleteTransaction command; involves Transaction aggregate; results in local DB delete and SyncPending event.</p></li><li><p><strong>BudgetSet</strong>: Triggered by SetBudget command; involves Budget aggregate; results in local DB update and Notification event.</p></li><li><p><strong>DataSynced</strong>: Triggered by Sync command (background or manual); involves multiple aggregates; results in backend update, local conflicts resolved (e.g., insufficient funds), and UI refresh.</p></li></ul><p><strong>Event clusters:</strong></p><ul><li><p>Authentication: UserAuthenticated &#8594; AppInitialized.</p></li><li><p>Account Management: AccountsFetched &#8594; TransactionCreated/Updated/Deleted &#8594; SyncPending &#8594; DataSynced.</p></li><li><p>Budgeting: BudgetSet &#8594; Notification.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gH7p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F960d9907-1604-4466-9928-0c7f56fb4282_2297x1620.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gH7p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F960d9907-1604-4466-9928-0c7f56fb4282_2297x1620.png 424w, https://substackcdn.com/image/fetch/$s_!gH7p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F960d9907-1604-4466-9928-0c7f56fb4282_2297x1620.png 848w, https://substackcdn.com/image/fetch/$s_!gH7p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F960d9907-1604-4466-9928-0c7f56fb4282_2297x1620.png 1272w, https://substackcdn.com/image/fetch/$s_!gH7p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F960d9907-1604-4466-9928-0c7f56fb4282_2297x1620.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gH7p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F960d9907-1604-4466-9928-0c7f56fb4282_2297x1620.png" width="1456" height="1027" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/960d9907-1604-4466-9928-0c7f56fb4282_2297x1620.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/073755a1-c260-4897-9de2-8001ee6c42ea_2297x1620.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1027,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:124373,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/186956155?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F073755a1-c260-4897-9de2-8001ee6c42ea_2297x1620.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gH7p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F960d9907-1604-4466-9928-0c7f56fb4282_2297x1620.png 424w, https://substackcdn.com/image/fetch/$s_!gH7p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F960d9907-1604-4466-9928-0c7f56fb4282_2297x1620.png 848w, https://substackcdn.com/image/fetch/$s_!gH7p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F960d9907-1604-4466-9928-0c7f56fb4282_2297x1620.png 1272w, https://substackcdn.com/image/fetch/$s_!gH7p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F960d9907-1604-4466-9928-0c7f56fb4282_2297x1620.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>3. Domain-Driven Design</h4><p><strong>Bounded Contexts:</strong></p><ul><li><p><strong>Authentication Context</strong>: Handles user identity, MFA, sessions, and secure access. Ubiquitous language: &#8220;login&#8221;, &#8220;MFA&#8221;, &#8220;token&#8221;, &#8220;session expiry&#8221;.</p><ul><li><p>Core Entities: User (with ID, email, phone).</p></li><li><p>Value Objects: Credentials (email/password/OTP), Token.</p></li><li><p>Aggregates: UserSession (root: User; invariants: token valid, MFA verified, unexpired).</p></li><li><p>Incoming Events: None (entry point).</p></li><li><p>Outgoing Events: UserAuthenticated.</p></li><li><p>API Contracts: AuthService interface for login/logout/MFA.</p></li></ul></li><li><p><strong>Account Management Context</strong>: Manages accounts, transactions, balances, and synchronization. Ubiquitous language: &#8220;balance&#8221;, &#8220;transfer&#8221;, &#8220;transaction&#8221;, &#8220;sync&#8221;.</p><ul><li><p>Core Entities: Account (with ID, balance, currency), Transaction (with ID, amount, recipient, type, date).</p></li><li><p>Value Objects: Money (amount, currency), TransactionDetails (recipient, notes).</p></li><li><p>Aggregates: AccountLedger (root: Account; invariants: balance non-negative, no duplicate transactions, currency consistent).</p></li><li><p>Incoming Events: UserAuthenticated (to enable access).</p></li><li><p>Outgoing Events: SyncPending, DataSynced, TransactionCreated (for notifications).</p></li><li><p>API Contracts: AccountRepository for CRUD, TransactionService for operations, SyncAdapter for backend.</p></li></ul></li><li><p><strong>Budgeting Context</strong>: Handles budget setting, tracking, and alerts. Ubiquitous language: &#8220;budget&#8221;, &#8220;category&#8221;, &#8220;expense&#8221;, &#8220;alert&#8221;.</p><ul><li><p>Core Entities: Budget (with ID, category, limit, period).</p></li><li><p>Value Objects: Category (enum), Period (start/end dates).</p></li><li><p>Aggregates: BudgetPlan (root: Collection of Budgets; invariants: limits positive, categories unique).</p></li><li><p>Incoming Events: TransactionCreated (to update tracking).</p></li><li><p>Outgoing Events: BudgetExceeded (for notifications).</p></li><li><p>API Contracts: BudgetRepository for CRUD.</p></li></ul></li></ul><p><strong>Context Map:</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!40Am!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F285e3870-4847-4a35-a6c3-376162d460eb_2297x1620.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!40Am!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F285e3870-4847-4a35-a6c3-376162d460eb_2297x1620.png 424w, https://substackcdn.com/image/fetch/$s_!40Am!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F285e3870-4847-4a35-a6c3-376162d460eb_2297x1620.png 848w, https://substackcdn.com/image/fetch/$s_!40Am!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F285e3870-4847-4a35-a6c3-376162d460eb_2297x1620.png 1272w, https://substackcdn.com/image/fetch/$s_!40Am!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F285e3870-4847-4a35-a6c3-376162d460eb_2297x1620.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!40Am!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F285e3870-4847-4a35-a6c3-376162d460eb_2297x1620.png" width="1456" height="1027" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/285e3870-4847-4a35-a6c3-376162d460eb_2297x1620.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/91272d04-fa6d-41d3-9dfa-967b67a4a61c_2297x1620.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1027,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:198813,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/186956155?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91272d04-fa6d-41d3-9dfa-967b67a4a61c_2297x1620.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!40Am!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F285e3870-4847-4a35-a6c3-376162d460eb_2297x1620.png 424w, https://substackcdn.com/image/fetch/$s_!40Am!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F285e3870-4847-4a35-a6c3-376162d460eb_2297x1620.png 848w, https://substackcdn.com/image/fetch/$s_!40Am!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F285e3870-4847-4a35-a6c3-376162d460eb_2297x1620.png 1272w, https://substackcdn.com/image/fetch/$s_!40Am!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F285e3870-4847-4a35-a6c3-376162d460eb_2297x1620.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Domain Validation:</strong></p><ul><li><p>Events are past-tense and business-meaningful.</p></li><li><p>Aggregates are cohesive (e.g., AccountLedger enforces balance invariants).</p></li><li><p>Boundaries are appropriate: Authentication isolated for security; Account Management handles core financial logic; Budgeting separates non-critical features.</p></li><li><p>No data ownership issues: Each context owns its persistence (session in secure store, accounts/transactions in SQLite, budgets in SQLite).</p></li><li><p>No duplicated rules: Sync and balance checks centralized in Account context.</p></li></ul><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/M2a6N/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f970acce-002a-4ee0-bf22-aea44764d55b_1220x834.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/871811c1-5582-4c02-80de-91c8d72390ad_1220x904.png&quot;,&quot;height&quot;:450,&quot;title&quot;:&quot;4. Functional Requirements&quot;,&quot;description&quot;:&quot;&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/M2a6N/1/" width="730" height="450" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/j0EGT/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7debaff4-14ca-4fbd-b026-79937ee6321b_1220x866.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b62dfeac-b709-4146-be27-716bd97661a5_1220x936.png&quot;,&quot;height&quot;:467,&quot;title&quot;:&quot;5. Non-Functional Requirements&quot;,&quot;description&quot;:&quot;&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/j0EGT/1/" width="730" height="467" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><p></p><h4>6. Traceability Matrix</h4><p>F1 &#8594; Authentication Context + Secure Store Adapter<br>F2 &#8594; Account Management Context + SQLite Repository<br>F3 &#8594; Account Management Context + Transaction Aggregate + SQLite<br>F4 &#8594; Budgeting Context + Budget Aggregate + SQLite<br>F5 &#8594; SyncAdapter + Supabase Client + Local Queues<br>F6 &#8594; Notification Service (push via Supabase/Expo)<br>F7 &#8594; React Navigation + UI Presenters<br>N1 &#8594; Caching in Zustand + Optimized SQLite queries<br>N2 &#8594; Offline queuing in Use Cases + Retry logic with exponential backoff<br>N3 &#8594; Expo Secure Store/MMKV encryption + Supabase auth + Tokenization<br>N4 &#8594; SQLite indexing + Supabase auto-scaling<br>N5 &#8594; Dependency Inversion in Clean Architecture layers<br>N6 &#8594; Validation in Use Cases + User-friendly error messages</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zmJb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98f44399-15e8-4dba-b412-9e1ab5a53f44_2297x1620.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zmJb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98f44399-15e8-4dba-b412-9e1ab5a53f44_2297x1620.png 424w, https://substackcdn.com/image/fetch/$s_!zmJb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98f44399-15e8-4dba-b412-9e1ab5a53f44_2297x1620.png 848w, https://substackcdn.com/image/fetch/$s_!zmJb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98f44399-15e8-4dba-b412-9e1ab5a53f44_2297x1620.png 1272w, https://substackcdn.com/image/fetch/$s_!zmJb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98f44399-15e8-4dba-b412-9e1ab5a53f44_2297x1620.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zmJb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98f44399-15e8-4dba-b412-9e1ab5a53f44_2297x1620.png" width="1456" height="1027" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/98f44399-15e8-4dba-b412-9e1ab5a53f44_2297x1620.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a235631c-46eb-482f-b96b-1624dd54c56c_2297x1620.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1027,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:176775,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/186956155?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa235631c-46eb-482f-b96b-1624dd54c56c_2297x1620.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zmJb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98f44399-15e8-4dba-b412-9e1ab5a53f44_2297x1620.png 424w, https://substackcdn.com/image/fetch/$s_!zmJb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98f44399-15e8-4dba-b412-9e1ab5a53f44_2297x1620.png 848w, https://substackcdn.com/image/fetch/$s_!zmJb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98f44399-15e8-4dba-b412-9e1ab5a53f44_2297x1620.png 1272w, https://substackcdn.com/image/fetch/$s_!zmJb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98f44399-15e8-4dba-b412-9e1ab5a53f44_2297x1620.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>7. Architectural Design Options</h4><p><strong>Option A &#8212; Clean Architecture + Expo Managed Workflow (Recommended for speed &amp; compliance focus)</strong><br>Summary: Full Clean Architecture layers inside an Expo-managed app; leverages Expo Secure Store and expo-sqlite for adapters.<br>Key components:</p><ul><li><p><strong>Entities</strong> &#8594; Plain TS classes (Account, Transaction, Money, Budget) with business invariants</p></li><li><p><strong>Use Cases / Application Layer</strong> &#8594; Custom hooks or functions (e.g. createTransactionUseCase, getAccountBalanceUseCase) orchestrating domain logic</p></li><li><p><strong>Interface Adapters</strong> &#8594; Repositories (TransactionRepositoryImpl using SQLite), Supabase gateway, Zustand store wrappers as presenters/controllers</p></li><li><p><strong>Frameworks &amp; Drivers</strong> &#8594; Expo, React Navigation, expo-sqlite, @supabase/supabase-js, Zustand, Expo Secure Store</p></li><li><p>Dependency injection via simple factories or a lightweight container (e.g. tsyringe or manual composition) Scalability profile: Vertical (device limits); backend horizontal via Supabase. Latency &amp; consistency characteristics: Local reads &lt;200 ms (SQLite + Zustand cache); eventual consistency on sync with optimistic UI + conflict detection. Estimated cost behavior: Low (free tier Expo + Supabase starter). Operational complexity: Low&#8211;Medium (Expo OTA, no native builds). Failure modes &amp; mitigation: Sync conflicts/overdrafts &#8594; versioned entities + compensating use cases; Expo limitations &#8594; prebuild only when truly needed.</p></li></ul><p><strong>Option B &#8212; Clean Architecture + RN CLI + MMKV + Native SQLite</strong><br>Summary: Clean Architecture with bare React Native CLI; uses faster native storage options for higher transaction volumes.<br>Key components:</p><ul><li><p><strong>Entities</strong> &#8594; Same domain model as A (immutable, invariant-enforcing)</p></li><li><p><strong>Use Cases</strong> &#8594; Plain functions or hooks, fully decoupled</p></li><li><p><strong>Interface Adapters</strong> &#8594; Repositories implemented with react-native-sqlite-storage, MMKV for encrypted session/fast key-value, custom Supabase client wrapper</p></li><li><p><strong>Frameworks &amp; Drivers</strong> &#8594; RN CLI, React Navigation, MMKV, react-native-sqlite-storage, Zustand (persisted with MMKV), @supabase/supabase-js</p></li><li><p>Manual DI or InversifyJS for stricter inversion Scalability profile: Vertical (better local performance for 10k+ transactions); backend via Supabase. Latency &amp; consistency characteristics: Local operations &lt;150 ms thanks to MMKV + native SQLite; strong local ACID, eventual remote sync. Estimated cost behavior: Low (open-source native modules). Operational complexity: Medium&#8211;High (manual iOS/Android builds, native debugging, CI/CD setup). Failure modes &amp; mitigation: Native module crashes &#8594; extensive unit + device testing; storage corruption &#8594; periodic Supabase sync + local backup queue.</p></li></ul><p><strong>Option C &#8212; Clean Architecture + Feature-based Vertical Slices + Expo (Modular evolution path)</strong><br>Summary: Clean Architecture principles applied per feature/module (vertical slices) rather than strict horizontal layers; starts with Expo, allows future extraction.<br>Key components:</p><ul><li><p><strong>Entities + Use Cases per feature</strong> &#8594; Folders like /features/transfers/domain, /features/budgets/domain containing entities + use cases</p></li><li><p><strong>Adapters per feature</strong> &#8594; /features/transfers/adapters with SQLite/Supabase/Zustand implementations</p></li><li><p><strong>Presentation per feature</strong> &#8594; /features/transfers/ui with screens, components, Zustand slices</p></li><li><p><strong>Shared kernel</strong> &#8594; Common entities (Money, Currency), utilities, DI setup</p></li><li><p>Frameworks &#8594; Expo, React Navigation, expo-sqlite, Supabase, Zustand Scalability profile: Vertical + easier module extraction later (to micro-frontends or separate packages). Latency &amp; consistency characteristics: Similar to Option A; feature isolation reduces cascade changes. Estimated cost behavior: Low initially, medium if refactoring to packages. Operational complexity: Medium (more folders, but better long-term cohesion). Failure modes &amp; mitigation: Feature leakage &#8594; strict folder ownership + eslint rules; sync duplication &#8594; shared sync use case in kernel.</p></li></ul><h4>8. Recommended Option with Reasoning Chain</h4><p><strong>Recommendation: Option A &#8212; Clean Architecture + Expo Managed Workflow</strong></p><ol><li><p><strong>Fintech security &amp; compliance priority</strong> &#8594; Expo&#8217;s managed workflow minimizes native code surface area &#8594; smaller attack surface and easier auditing vs RN CLI (ties to N3 security).</p></li><li><p><strong>Solo/small team</strong> &#8594; Expo OTA updates + no build servers &#8594; faster iteration on MFA, sync conflicts, budget alerts (critical for fintech trust).</p></li><li><p><strong>Clean Architecture fidelity</strong> &#8594; All layers preserved: domain pure, use cases framework-agnostic, adapters swap (SQLite &#8596; Supabase mock) &#8594; high testability without native complexity.</p></li><li><p><strong>Offline-first + sync correctness</strong> &#8594; expo-sqlite + Zustand caching + queued use cases deliver required reliability (N2) without native SQLite pitfalls.</p></li><li><p><strong>Performance acceptable for MVP scale</strong> &#8594; Local &lt;300 ms reads, sync &lt;3 s &#8594; sufficient for personal finance (N1); MMKV gain marginal vs added ops cost.</p></li><li><p><strong>Future-proofing tradeoff</strong> &#8594; Option A allows clean migration to B or C later (prebuild &#8594; eject &#8594; vertical slices) with minimal rewrite thanks to dependency rule.</p></li></ol><p>Option A gives strongest balance of <strong>Clean Architecture purity</strong>, <strong>security surface reduction</strong>, <strong>fast feedback loops</strong>, and <strong>low ops burden</strong> &#8212; ideal for a 2026 Turkish fintech MVP under KVKK/data protection constraints.</p><p>(Options B and C remain viable when hitting 20k+ local transactions or needing custom native crypto modules &#8212; re-evaluate after the sync &amp; balance spike.)</p><h4>9. System Design &amp; Sequence Diagrams</h4><p><strong>System Design Diagram:</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pMYm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febb20508-f8c4-4989-aa8a-48704fecb2de_2297x1620.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pMYm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febb20508-f8c4-4989-aa8a-48704fecb2de_2297x1620.png 424w, https://substackcdn.com/image/fetch/$s_!pMYm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febb20508-f8c4-4989-aa8a-48704fecb2de_2297x1620.png 848w, https://substackcdn.com/image/fetch/$s_!pMYm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febb20508-f8c4-4989-aa8a-48704fecb2de_2297x1620.png 1272w, https://substackcdn.com/image/fetch/$s_!pMYm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febb20508-f8c4-4989-aa8a-48704fecb2de_2297x1620.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pMYm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febb20508-f8c4-4989-aa8a-48704fecb2de_2297x1620.png" width="1456" height="1027" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ebb20508-f8c4-4989-aa8a-48704fecb2de_2297x1620.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e076b532-e6d7-4615-8bbd-04bbaf5495bc_2297x1620.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1027,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:182495,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/186956155?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe076b532-e6d7-4615-8bbd-04bbaf5495bc_2297x1620.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pMYm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febb20508-f8c4-4989-aa8a-48704fecb2de_2297x1620.png 424w, https://substackcdn.com/image/fetch/$s_!pMYm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febb20508-f8c4-4989-aa8a-48704fecb2de_2297x1620.png 848w, https://substackcdn.com/image/fetch/$s_!pMYm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febb20508-f8c4-4989-aa8a-48704fecb2de_2297x1620.png 1272w, https://substackcdn.com/image/fetch/$s_!pMYm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febb20508-f8c4-4989-aa8a-48704fecb2de_2297x1620.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Sequence Diagram (Transaction Creation Flow):</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gRdQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f42f5f4-1c4d-4c44-8167-b839a6f118d0_2297x1620.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gRdQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f42f5f4-1c4d-4c44-8167-b839a6f118d0_2297x1620.png 424w, https://substackcdn.com/image/fetch/$s_!gRdQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f42f5f4-1c4d-4c44-8167-b839a6f118d0_2297x1620.png 848w, https://substackcdn.com/image/fetch/$s_!gRdQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f42f5f4-1c4d-4c44-8167-b839a6f118d0_2297x1620.png 1272w, https://substackcdn.com/image/fetch/$s_!gRdQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f42f5f4-1c4d-4c44-8167-b839a6f118d0_2297x1620.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gRdQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f42f5f4-1c4d-4c44-8167-b839a6f118d0_2297x1620.png" width="1456" height="1027" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0f42f5f4-1c4d-4c44-8167-b839a6f118d0_2297x1620.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e8b5d192-3d64-4f63-a493-2cd545d1872d_2297x1620.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1027,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:167592,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/186956155?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8b5d192-3d64-4f63-a493-2cd545d1872d_2297x1620.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gRdQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f42f5f4-1c4d-4c44-8167-b839a6f118d0_2297x1620.png 424w, https://substackcdn.com/image/fetch/$s_!gRdQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f42f5f4-1c4d-4c44-8167-b839a6f118d0_2297x1620.png 848w, https://substackcdn.com/image/fetch/$s_!gRdQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f42f5f4-1c4d-4c44-8167-b839a6f118d0_2297x1620.png 1272w, https://substackcdn.com/image/fetch/$s_!gRdQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f42f5f4-1c4d-4c44-8167-b839a6f118d0_2297x1620.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>10. Data Management, Security, Observability, Roadmap</h4><p><strong>Data Management</strong>: </p><p>Schema: Entities as JS objects; SQLite tables for accounts (id, balance, currency), transactions (id, account_id, amount, type, date, sync_status), budgets (id, category, limit). </p><p>Sharding/partitioning: Not needed (single device). Caching: Zustand for in-memory balances. </p><p>Backup/Restore: Auto-sync to Supabase; local export. </p><p>Transactional Model: Local ACID via SQLite; sync eventual with optimistic locking (version on transactions). </p><p>Data Residency: User data in Supabase regions compliant with banking regulations.</p><p><strong>Security &amp; Compliance</strong>: MFA via Supabase; encrypt all in Secure Store/MMKV. Tokenize sensitive data (no raw financial info locally). Input validation/sanitization in Use Cases. Secure API calls with JWT. Comply with local financial regs (e.g., data protection).</p><p><strong>Observability &amp; SLOs</strong>: Metrics: App load time, sync latency (logs/Sentry). Tracing: Adapter logging. Alerting: Crash reports via Expo. SLOs: &gt;99% sync success; &lt;0.1% data inconsistency.</p><p><strong>Roadmap &amp; Milestones</strong>: Sprint 1: MVA - Auth/MFA + Account view (offline). Sprint 2: Transactions CRUD + Sync. Sprint 3: Budgets + Notifications. Sprint 4: Security audits + Production build.</p><p><strong>References:</strong></p><ul><li><p>Zustand - https://zustand-demo.pmnd.rs</p></li><li><p>Expo - https://expo.dev</p></li></ul><p>This architecture delivers a production-grade foundation for a secure fintech mobile experience in the global market: fast local reads and writes, reliable offline queuing with conflict-aware synchronization, strict isolation of sensitive financial operations, and compliance-friendly data handling &#8212; all while keeping development velocity high and long-term maintenance cost low.</p><p>By choosing Expo + Clean Architecture we intentionally trade some raw native performance for dramatically faster iteration, easier security hardening, and much lower risk of build &amp; deployment blockers &#8212; a pragmatic choice for most fintech MVPs and early-growth products</p>]]></content:encoded></item><item><title><![CDATA[High-Throughput Ticketing System for Bursty Traffic]]></title><description><![CDATA[In this post, I will design of a ticket sales platform optimized for flash sales and high-demand periods, focusing on inventory consistency, low-latency reads, and secure payment processing.]]></description><link>https://seyhunak.substack.com/p/high-throughput-ticketing-system</link><guid isPermaLink="false">https://seyhunak.substack.com/p/high-throughput-ticketing-system</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Mon, 19 Jan 2026 17:48:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!dg1n!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3563d456-31cd-4301-9df8-58d3eef5e017_2347x1618.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this post, I will design of a ticket sales platform optimized for flash sales and high-demand periods, focusing on inventory consistency, low-latency reads, and secure payment processing. Architecture leverages Redis caching, Kafka queues for burst handling, and database locking strategies to prevent overselling while maintaining strong performance, scalability, and reliability under spikes of up to 10k RPS.</p><blockquote><p><em>Before we start: Please note that, while the architecture, benchmarks, and scale-up phases are grounded in common production patterns, the numbers here are simulated for educational purposes and may not reflect every real-world banking environment. The goal is to demonstrate how design layer could scale toward modern banking platform principles, not to claim a one-size-fits-all blueprint.</em></p></blockquote><h4>1. Requirements of the Project</h4><p>In a ticket sales platform, customers browse available events, select seats or tickets, add them to a cart, and proceed to checkout during high-demand periods like concert on-sales or flash promotions. The system must reserve inventory instantly to avoid overselling, process payments, and confirm bookings, while backend teams monitor stock levels and handle refunds if needed. During bursts, thousands of users hit the system simultaneously, triggering rapid inventory checks and updates, with external partners like payment gateways integrating for secure transactions.</p><h4>2. Understanding Key Events</h4><p>Key domain events extracted from the story include: TicketBrowsed, TicketAddedToCart, InventoryReserved, PaymentProcessed, BookingConfirmed, InventoryReleased (on failure or timeout). These form a flow where user commands trigger events, affecting aggregates like Inventory and Order.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dg1n!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3563d456-31cd-4301-9df8-58d3eef5e017_2347x1618.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dg1n!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3563d456-31cd-4301-9df8-58d3eef5e017_2347x1618.png 424w, https://substackcdn.com/image/fetch/$s_!dg1n!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3563d456-31cd-4301-9df8-58d3eef5e017_2347x1618.png 848w, https://substackcdn.com/image/fetch/$s_!dg1n!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3563d456-31cd-4301-9df8-58d3eef5e017_2347x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!dg1n!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3563d456-31cd-4301-9df8-58d3eef5e017_2347x1618.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dg1n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3563d456-31cd-4301-9df8-58d3eef5e017_2347x1618.png" width="1456" height="1004" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3563d456-31cd-4301-9df8-58d3eef5e017_2347x1618.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a1574008-bd18-41f5-9557-61985b897670_2347x1618.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1004,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:164229,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/185087785?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1574008-bd18-41f5-9557-61985b897670_2347x1618.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dg1n!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3563d456-31cd-4301-9df8-58d3eef5e017_2347x1618.png 424w, https://substackcdn.com/image/fetch/$s_!dg1n!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3563d456-31cd-4301-9df8-58d3eef5e017_2347x1618.png 848w, https://substackcdn.com/image/fetch/$s_!dg1n!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3563d456-31cd-4301-9df8-58d3eef5e017_2347x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!dg1n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3563d456-31cd-4301-9df8-58d3eef5e017_2347x1618.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h4>3. Domain-Driven Design - Bounded Contexts</h4><p>Bounded contexts identified: Catalog (browsing and search), Cart (temporary holds), Ordering (checkout and reservation), Inventory (stock management), Payments (transaction handling).</p><ul><li><p><strong>Catalog Context</strong>: Entities - Event, TicketType; Value Objects - Price, AvailabilitySnapshot; Aggregate - EventCatalog (root: Event); Invariants - Availability snapshots are read-only.</p></li><li><p><strong>Cart Context</strong>: Entities - Cart; Value Objects - CartItem; Aggregate - UserCart (root: Cart); Invariants - Items expire after TTL.</p></li><li><p><strong>Ordering Context</strong>: Entities - Order; Value Objects - OrderLine; Aggregate - Order (root: Order); Invariants - Order total matches reserved items.</p></li><li><p><strong>Inventory Context</strong>: Entities - InventoryItem; Value Objects - Quantity; Aggregate - Stock (root: InventoryItem); Invariants - Quantity never negative.</p></li><li><p><strong>Payments Context</strong>: Entities - Transaction; Value Objects - PaymentDetails; Aggregate - Payment (root: Transaction); Invariants - Compliance with external rules.</p></li></ul><p><strong>Context Map:</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iQVr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ab878fe-a06e-449a-9a4b-6ac7e1390aee_2347x1618.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iQVr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ab878fe-a06e-449a-9a4b-6ac7e1390aee_2347x1618.png 424w, https://substackcdn.com/image/fetch/$s_!iQVr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ab878fe-a06e-449a-9a4b-6ac7e1390aee_2347x1618.png 848w, https://substackcdn.com/image/fetch/$s_!iQVr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ab878fe-a06e-449a-9a4b-6ac7e1390aee_2347x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!iQVr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ab878fe-a06e-449a-9a4b-6ac7e1390aee_2347x1618.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iQVr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ab878fe-a06e-449a-9a4b-6ac7e1390aee_2347x1618.png" width="1456" height="1004" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6ab878fe-a06e-449a-9a4b-6ac7e1390aee_2347x1618.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dbe454a1-c059-4d14-ab4d-a853eddade63_2347x1618.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1004,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:185197,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/185087785?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbe454a1-c059-4d14-ab4d-a853eddade63_2347x1618.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!iQVr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ab878fe-a06e-449a-9a4b-6ac7e1390aee_2347x1618.png 424w, https://substackcdn.com/image/fetch/$s_!iQVr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ab878fe-a06e-449a-9a4b-6ac7e1390aee_2347x1618.png 848w, https://substackcdn.com/image/fetch/$s_!iQVr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ab878fe-a06e-449a-9a4b-6ac7e1390aee_2347x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!iQVr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ab878fe-a06e-449a-9a4b-6ac7e1390aee_2347x1618.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><div><hr></div><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/eXK1z/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/57850986-9bc0-482f-b812-0785964b4514_1220x642.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/89d2c0ac-5245-4a28-9772-b9db76341e28_1220x712.png&quot;,&quot;height&quot;:351,&quot;title&quot;:&quot;Domain-to-Architecture Mapping&quot;,&quot;description&quot;:&quot;&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/eXK1z/1/" width="730" height="351" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><div><hr></div><p><strong>Domain Validation:</strong> Events use consistent past-tense naming; aggregates enforce invariants (e.g., Stock prevents oversell); boundaries are balanced for burst handling; each service owns its data; no duplicated rules detected.</p><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/hG5RQ/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3a7924b4-eee6-48fd-92d2-8ac2d193c9e8_1220x866.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/68a4aeb2-f02e-4861-9a88-31b920487377_1220x936.png&quot;,&quot;height&quot;:467,&quot;title&quot;:&quot;4. Functional Requirements&quot;,&quot;description&quot;:&quot;&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/hG5RQ/1/" width="730" height="467" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><div><hr></div><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/2jtWy/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6f119c81-b1e7-4a37-b01b-f1fe1ba7502c_1220x898.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2c88b59f-821b-427b-a4ae-680f13fb8886_1220x968.png&quot;,&quot;height&quot;:483,&quot;title&quot;:&quot;5. Non-Functional Requirements                                          &nbsp;&quot;,&quot;description&quot;:&quot;&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/2jtWy/1/" width="730" height="483" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><div><hr></div><h4>6. Traceability Matrix</h4><p>F1 &#8594; Catalog Service + Search Index<br>F2 &#8594; Cart Service + Redis<br>F3 &#8594; Inventory Service + Database Locking<br>F4 &#8594; Order Service + Payment Service + Queue<br>F5 &#8594; Inventory Service + Event Bus<br>N1 &#8594; Redis Caching + CDN<br>N2 &#8594; Autoscaling + Queue Management<br>N3 &#8594; Database Locking + Idempotent Processing<br>N4 &#8594; Transactional Reserves + Materialized Views<br>N5 &#8594; Distributed Tracing + Metrics</p><h4>8. Assumptions</h4><ul><li><p>Bursty traffic follows predictable patterns (e.g., event on-sale times) with 100x spikes lasting &lt;1 hour.</p></li><li><p>Inventory is finite and shared across users, requiring atomic updates.</p></li><li><p>Team has experience with distributed systems but prefers managed services to reduce ops.</p></li><li><p>Baseline load is low (100 RPS), allowing cost-optimized scaling.</p></li><li><p>External dependencies (e.g., payments) have their own SLAs (&lt;200ms).</p></li><li><p>No real-time ML or personalization needed.</p></li></ul><h4>9. Important metrics &amp; constraints</h4><ul><li><p>Peak throughput: 10k RPS for reservations without oversell.</p></li><li><p>Latency: p95 &lt;500ms end-to-end for checkout during bursts.</p></li><li><p>Reliability: Oversell rate &lt;1 per 1M; recovery from failures without data loss.</p></li><li><p>Cost: Minimize idle resources; prefer pay-for-use.</p></li><li><p>Ops: Team of 5-10 can handle, with automated scaling.</p></li></ul><h4>10. Designing System Components and Architecture</h4><p><strong>Option A &#8212; Cache-Heavy Monolith with Redis and DB Locking (Simple)</strong></p><ul><li><p>Summary: Single service handles all logic, heavy Redis caching for reads, DB row-locks for writes.</p></li><li><p>Key components: Monolith API, Redis (multi-layer cache: availability snapshots, carts), Postgres (with pessimistic locking), Background workers for async tasks.</p></li><li><p>Scalability profile: Vertical scaling + read replicas; bursts handled by cache hits (90% reads).</p></li><li><p>Latency &amp; consistency characteristics: Low read latency (&lt;50ms cached); writes serialized via locks (~200ms under load); strong consistency.</p></li><li><p>Estimated cost behavior: Low; Redis and DB scale with traffic.</p></li><li><p>Operational complexity: Low.</p></li><li><p>Failure modes &amp; mitigation: Lock contention during bursts &#8212; mitigate with short lock timeouts and retries; cache invalidation bugs &#8212; use Redis pub/sub for updates.</p></li></ul><p><strong>Option B &#8212; Microservices with Kafka Queues and Optimistic Locking (Scalable)</strong></p><ul><li><p>Summary: Services per context, Kafka for decoupling bursts, Redis for caching, optimistic DB locking.</p></li><li><p>Key components: Catalog svc (Redis cache), Inventory svc (Postgres with optimistic concurrency), Order svc (Kafka producer/consumer), Payments svc.</p></li><li><p>Scalability profile: Horizontal; queues buffer bursts, services autoscale independently.</p></li><li><p>Latency &amp; consistency characteristics: Reads &lt;100ms (cached); writes queued for &lt;1s processing; eventual consistency for views, strong via version checks.</p></li><li><p>Estimated cost behavior: Medium; Kafka adds overhead but scales efficiently.</p></li><li><p>Operational complexity: Medium.</p></li><li><p>Failure modes &amp; mitigation: Queue backlog &#8212; auto-scale consumers, dead-letter queues; concurrency conflicts &#8212; exponential backoff retries.</p></li></ul><p><strong>Option C &#8212; Serverless with RabbitMQ and Pessimistic Locking (Flexible)</strong></p><ul><li><p>Summary: Functions for logic, RabbitMQ for task queuing, Redis caching, DB with pessimistic locks.</p></li><li><p>Key components: Lambda/FaaS, RabbitMQ (fanout/exchanges for bursts), ElastiCache Redis, Aurora DB.</p></li><li><p>Scalability profile: Excellent for bursts; serverless auto-scales, queues absorb spikes.</p></li><li><p>Latency &amp; consistency characteristics: Variable (cold starts &lt;100ms mitigated); strong consistency via locks; queues add ~50ms.</p></li><li><p>Estimated cost behavior: Low baseline, high during prolonged bursts.</p></li><li><p>Operational complexity: Low (managed).</p></li><li><p>Failure modes &amp; mitigation: Queue durability &#8212; persistent queues; lock deadlocks &#8212; timeouts and monitoring.</p></li></ul><p><strong>Recommendation: Option B &#8212; Microservices with Kafka Queues and Optimistic Locking.</strong></p><ul><li><p>Bursty traffic (10k RPS spikes) requires decoupling to avoid overwhelming DB; Kafka queues buffer writes, allowing smooth processing (ties to N2, metric 1).</p></li><li><p>Prevent overselling demands strong consistency; optimistic locking in DB minimizes contention vs pessimistic (fewer deadlocks in bursts), with retries handling conflicts (ties to N3, F3).</p></li><li><p>Caching strategy: Redis for multi-tier (hot inventory in memory, invalidated via Kafka events) hits 90% reads, keeping latency low (ties to N1, metric 2).</p></li><li><p>Team constraints: Microservices align with DDD contexts for ownership, Kafka is mature for events (vs RabbitMQ&#8217;s simpler messaging), reducing ops with managed services.</p></li><li><p>Cost/reliability tradeoff: Medium cost but better than Option C&#8217;s potential cold-start latency; avoids Option A&#8217;s monolith bottlenecks at scale.</p></li><li><p>Overall: Balances focus areas (Redis caching, Kafka queues, DB locking) for bursty scenarios like ticket sales.</p></li></ul><h4>11. Data management Schema strategy</h4><ul><li><p><strong>Normalized Postgres for inventory</strong> (tables: events, stock with version column for optimistic locking); document DB for catalog. </p></li><li><p><strong>Sharding/partitioning:</strong> By event ID for inventory to distribute bursts. </p></li><li><p><strong>Caching:</strong> Redis with TTL (e.g., 5min for availability snapshots), write-through for updates via Kafka consumers; LRU eviction.</p></li><li><p><strong>Backup and restore:</strong> Daily snapshots + PITR for Postgres; Redis AOF persistence.</p></li><li><p><strong>Transactional model:</strong> Sagas via Kafka for distributed tx (e.g., reserve -&gt; pay -&gt; confirm, with compensating release on failure); no 2PC to avoid latency. Data residency: Region-specific for compliance.</p></li></ul><h4>12. Security &amp; Compliance and Authentication</h4><ul><li><p>JWT via API Gateway. Encryption: TLS transit, at-rest for DB/Redis. Access controls: Least-privilege IAM for services; audit logs for reservations. <br>Compliance: GDPR for user data, with data isolation in queues.</p></li><li><p>Observability &amp; SLOs SLOs: Reservation success &gt;99.9%; queue lag &lt;1min. Metrics: RPS per service, cache hit rate (&gt;90%), lock contention retries, consumer lag. Tracing &amp; logs: OpenTelemetry across services/queues; centralized ELK. Alerting: Latency breaches, queue depth &gt;10k, retry spikes.</p></li></ul><p>This architecture balances scalability, performance, and reliability to handle bursty traffic scenarios, such as ticket sales or flash promotions. By combining Redis caching, queue-based event handling with Kafka, and careful database locking strategies, the system ensures inventory correctness, low latency, and operational resilience.</p><p>Future enhancements may include advanced monitoring, automated scaling optimizations, and integration with analytics pipelines to better anticipate peak loads. Continuous testing of locking, caching, and queuing mechanisms will ensure the platform maintains its reliability under evolving traffic patterns.</p><p>Overall, this design provides a robust foundation for delivering a seamless and trustworthy user experience during high-demand periods while remaining maintainable and cost-efficient.</p><p></p><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/high-throughput-ticketing-system?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Thanks for reading Seyhun's Substack! This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/high-throughput-ticketing-system?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://seyhunak.substack.com/p/high-throughput-ticketing-system?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><h4>Want to follow the journey?</h4><p>I&#8217;m sharing the process of designing agentic financial systems architecture, engineering, AI automation and building tools with Crafted AI Framework</p><p>If you want to collaborate, test, or co-build the next generation of fintech, reach out.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QemM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QemM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QemM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg" width="604" height="223.57226792009402" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:315,&quot;width&quot;:851,&quot;resizeWidth&quot;:604,&quot;bytes&quot;:15329,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/178341924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!QemM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QemM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Contact with us at Crafted <a href="http://we-crafted.com/">we-crafted.com</a></strong></p><ul><li><p>Discover how we turn complex ideas into working AI products &#8212; visit we-crafted.com and start a conversation with our team.</p></li><li><p>See what we&#8217;re building next. Explore case studies and reach out at we-crafted.com.</p></li><li><p>Have a product idea worth accelerating? Let&#8217;s build it together</p></li><li><p>From prototype to production-grade AI systems &#8212; learn more and get in touch</p></li><li><p>Looking for enterprise-grade AI agents or RAG infrastructure? Visit we-crafted.com</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Seyhun's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/high-throughput-ticketing-system/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://seyhunak.substack.com/p/high-throughput-ticketing-system/comments"><span>Leave a comment</span></a></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Designing Trading Platform Architecture]]></title><description><![CDATA[Low-Latency, Resilient, Multi-Asset FIX & Market-Data Backbone for CFDs, FX, and Cash Equities]]></description><link>https://seyhunak.substack.com/p/designing-trading-platform-architecture</link><guid isPermaLink="false">https://seyhunak.substack.com/p/designing-trading-platform-architecture</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Fri, 16 Jan 2026 21:17:59 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!kO4e!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad90ec77-4c01-46c2-a6ce-113d5cb510f4_2321x1618.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A trader submits an order through the front-end trading platform. The system must quickly route this order to the most appropriate liquidity provider or exchange for the asset class (CFDs, FX, or Cash Equities), using standardized protocols like FIX. The venue acknowledges receipt, processes the order, and sends back execution reports or trade confirmations. </p><blockquote><p><em>Before we start: Please note that, while the architecture, benchmarks, and scale-up phases are grounded in common production patterns, the numbers here are simulated for educational purposes and may not reflect every real-world banking environment. The goal is to demonstrate how design layer could scale toward modern banking platform principles, not to claim a one-size-fits-all blueprint.</em></p></blockquote><div><hr></div><h4>1. Requirements</h4><p>These messages flow back through the system, updating the platform in real-time while maintaining strict sequencing and reliability. </p><p>Market data vendors continuously publish price feeds, which the platform consumes to display quotes and inform routing decisions. Throughout this technical plumbing, the system monitors connections, handles heartbeats, detects failures, and fails over transparently to ensure uninterrupted trading activity.</p><h4>2. Understanding Key Events</h4><p>Key domain events and flows in the technical connectivity layer:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kO4e!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad90ec77-4c01-46c2-a6ce-113d5cb510f4_2321x1618.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kO4e!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad90ec77-4c01-46c2-a6ce-113d5cb510f4_2321x1618.png 424w, https://substackcdn.com/image/fetch/$s_!kO4e!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad90ec77-4c01-46c2-a6ce-113d5cb510f4_2321x1618.png 848w, https://substackcdn.com/image/fetch/$s_!kO4e!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad90ec77-4c01-46c2-a6ce-113d5cb510f4_2321x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!kO4e!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad90ec77-4c01-46c2-a6ce-113d5cb510f4_2321x1618.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kO4e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad90ec77-4c01-46c2-a6ce-113d5cb510f4_2321x1618.png" width="1456" height="1015" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ad90ec77-4c01-46c2-a6ce-113d5cb510f4_2321x1618.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/15dedbc0-9bee-4495-ba5a-3fd138919ba8_2321x1618.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1015,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:154839,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/184812737?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15dedbc0-9bee-4495-ba5a-3fd138919ba8_2321x1618.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kO4e!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad90ec77-4c01-46c2-a6ce-113d5cb510f4_2321x1618.png 424w, https://substackcdn.com/image/fetch/$s_!kO4e!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad90ec77-4c01-46c2-a6ce-113d5cb510f4_2321x1618.png 848w, https://substackcdn.com/image/fetch/$s_!kO4e!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad90ec77-4c01-46c2-a6ce-113d5cb510f4_2321x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!kO4e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad90ec77-4c01-46c2-a6ce-113d5cb510f4_2321x1618.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>(Blue = Commands, Orange = Domain Events)</strong></p><h4>3. Design Domain (Contexts &amp; Aggregates)</h4><p>Identified bounded contexts in the connectivity/middleware scope:</p><ul><li><p><strong>Connectivity &amp; Gateways</strong> &#8212; Handles protocol-specific adapters (FIX, REST/WebSocket), connection lifecycle, heartbeats, failover.</p></li><li><p><strong>Order Routing &amp; Execution</strong> &#8212; Smart routing logic, venue selection, order transformation, execution report processing.</p></li><li><p><strong>Market Data Ingestion</strong> &#8212; Feed handler, normalization, distribution to consumers.</p></li><li><p><strong>Internal Messaging &amp; API</strong> &#8212; Middleware exposing normalized events/APIs to front-end, operations, compliance (without owning business logic).</p></li></ul><p>Core aggregates:</p><ul><li><p>Connection (root) &#8212; Manages state, heartbeats, sessions, failover.</p></li><li><p>OrderFlow (root) &#8212; Tracks order from submission to completion, enforces sequencing.</p></li></ul><p><strong>Context Map</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aY9B!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b2a427a-405e-41ac-90db-3906355e69f1_2321x1618.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aY9B!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b2a427a-405e-41ac-90db-3906355e69f1_2321x1618.png 424w, https://substackcdn.com/image/fetch/$s_!aY9B!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b2a427a-405e-41ac-90db-3906355e69f1_2321x1618.png 848w, https://substackcdn.com/image/fetch/$s_!aY9B!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b2a427a-405e-41ac-90db-3906355e69f1_2321x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!aY9B!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b2a427a-405e-41ac-90db-3906355e69f1_2321x1618.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aY9B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b2a427a-405e-41ac-90db-3906355e69f1_2321x1618.png" width="1456" height="1015" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5b2a427a-405e-41ac-90db-3906355e69f1_2321x1618.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3bdd4c9c-dd9a-4a8e-baa3-e56786bb097b_2321x1618.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1015,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:233685,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/184812737?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bdd4c9c-dd9a-4a8e-baa3-e56786bb097b_2321x1618.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aY9B!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b2a427a-405e-41ac-90db-3906355e69f1_2321x1618.png 424w, https://substackcdn.com/image/fetch/$s_!aY9B!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b2a427a-405e-41ac-90db-3906355e69f1_2321x1618.png 848w, https://substackcdn.com/image/fetch/$s_!aY9B!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b2a427a-405e-41ac-90db-3906355e69f1_2321x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!aY9B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b2a427a-405e-41ac-90db-3906355e69f1_2321x1618.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><div><hr></div><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/Ca6JE/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6286339e-df66-4a14-b0f9-476f275766b9_1220x866.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f687f6c0-92b3-4c73-9271-c7e50fd61fc6_1220x936.png&quot;,&quot;height&quot;:467,&quot;title&quot;:&quot;4. Functional Requirements&quot;,&quot;description&quot;:&quot;Create interactive, responsive &amp; beautiful charts &#8212; no code required.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/Ca6JE/1/" width="730" height="467" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/pbrDA/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/86e89a27-db46-4587-a877-ee9fffaa0f05_1220x742.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bd7a8141-e6f8-40fb-ad89-028a7038f628_1220x812.png&quot;,&quot;height&quot;:403,&quot;title&quot;:&quot;5. Non-Functional Requirements (NFRs)&quot;,&quot;description&quot;:&quot;&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/pbrDA/1/" width="730" height="403" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><h4>6. Traceability Matrix</h4><p>F1 &#8594; FIX Gateway + Adapter Layer<br>F2 &#8594; Order Routing + FIX/REST Adapters<br>F3 &#8594; Market Data Handler Service<br>N1 &#8594; Co-location + kernel bypass + efficient FIX engine<br>N3 &#8594; Multi-region + active-active + automated failover<br>N4 &#8594; Idempotent processing + sequence numbers</p><p><strong>Assumptions</strong> (max 6)</p><ol><li><p>Most latency-sensitive paths use FIX protocol with co-location/proximity hosting.</p></li><li><p>Company operates in a regulated environment (MiFID II, SEC, etc.) requiring auditability but not full PCI-DSS.</p></li><li><p>Team has strong Go/C++/Rust expertise and can handle low-level networking.</p></li><li><p>Peak volumes are bursty (news-driven).</p></li><li><p>Managed cloud (AWS/GCP) + dedicated links are acceptable.</p></li><li><p>Existing front-end platforms consume REST/WebSocket + event streams.</p></li></ol><p><strong>Important metrics &amp; constraints</strong></p><ul><li><p>Tick-to-trade latency &lt;500&#956;s (p99).</p></li><li><p>Zero lost/duplicated messages (strong guarantees).</p></li><li><p>Connection uptime &gt;99.999%.</p></li><li><p>MTTR for connectivity issues &lt;1 minute.</p></li><li><p>Regulatory audit trail for all messages.</p></li></ul><h4>7. Architectural Design Options</h4><p><strong>Option A &#8212; Monolithic High-Performance Gateway</strong><br>Summary: Single high-performance service handling all connectivity, routing, and normalization.<br>Key components: Custom FIX engine (Go/C++), in-memory order book/router, Redis for state.<br>Scalability: Vertical + multi-instance with sharding per venue.<br>Latency &amp; consistency: Excellent (~100&#8211;300&#956;s), strong in-process.<br>Cost: Low&#8211;medium (fewer moving parts).<br>Operational complexity: Low&#8211;medium.<br>Failure modes &amp; mitigation: Single failure domain &#8212; mitigated by hot standbys + fast failover.</p><p><strong>Option B &#8212; Event-Driven Microservices with Specialized Gateways</strong> (Recommended)<br>Summary: Separated services per concern, loosely coupled via high-performance messaging.<br>Key components: FIX Gateway(s) per protocol/venue cluster, Market Data Handler, Smart Order Router (core decision), Internal Event Bus (Kafka + low-latency alternative like NATS), Redis for transient state.<br>Scalability: Horizontal per service/venue.<br>Latency &amp; consistency: ~300&#8211;600&#956;s end-to-end, strong via sequence + idempotency.<br>Cost: Medium&#8211;high (more infra).<br>Operational complexity: Medium&#8211;high (tracing essential).<br>Failure modes &amp; mitigation: Partial failures &#8212; use circuit breakers, sagas for recovery, active-passive connections.</p><p><strong>Option C &#8212; Hybrid Serverless + Ultra-Low Latency Gateways</strong><br>Summary: Core gateways on bare-metal/co-lo, middleware on cloud-native.<br>Key components: FPGA/ASIC-assisted gateways for ultra-low path, cloud functions for routing logic, Kafka for internal.<br>Scalability: Excellent for bursts.<br>Latency &amp; consistency: Sub-100&#956;s on hot path, eventual for some internal.<br>Cost: High (hardware + cloud).<br>Operational complexity: Very high.<br>Failure modes &amp; mitigation: Hardware failure &#8212; redundancy + auto-failover.</p><p><strong>Recommended Option &amp; Reasoning Chain</strong></p><p><strong>Recommendation: Option B &#8212; Event-Driven Microservices with Specialized Gateways.</strong></p><ol><li><p><strong>Latency &amp; performance</strong> (N1): Specialized FIX gateways in Go/C++ with kernel bypass achieve required &#956;s-range while allowing independent scaling.</p></li><li><p><strong>Availability &amp; resilience</strong> (N3): Per-venue gateways + active-active connections + automated failover provide &#8220;five nines&#8221; without monolithic SPOF.</p></li><li><p><strong>Throughput &amp; volume</strong> (N2): Kafka/NATS handles 100k+ msg/sec for internal flows; gateways remain focused on protocol efficiency.</p></li><li><p><strong>Maintainability &amp; evolution</strong> (team context): Bounded contexts (gateways, routing, market data) enable independent deployments and ownership &#8212; critical for 12&#8211;18+ years experience leaders.</p></li><li><p><strong>Regulatory &amp; observability</strong> (N5): Distributed tracing (OpenTelemetry) + sequence numbers ensure auditability without tight coupling.</p></li><li><p><strong>Tradeoff acceptance</strong>: Slightly higher latency than Option A/C is offset by vastly better resilience, scalability, and developer velocity &#8212; acceptable for multi-asset platform.</p></li></ol><div><hr></div><h4>8. System Design Diagram</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VN5Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef193fe5-39a6-4917-8a39-6ab94a8c2a66_2321x1618.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VN5Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef193fe5-39a6-4917-8a39-6ab94a8c2a66_2321x1618.png 424w, https://substackcdn.com/image/fetch/$s_!VN5Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef193fe5-39a6-4917-8a39-6ab94a8c2a66_2321x1618.png 848w, https://substackcdn.com/image/fetch/$s_!VN5Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef193fe5-39a6-4917-8a39-6ab94a8c2a66_2321x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!VN5Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef193fe5-39a6-4917-8a39-6ab94a8c2a66_2321x1618.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VN5Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef193fe5-39a6-4917-8a39-6ab94a8c2a66_2321x1618.png" width="1456" height="1015" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ef193fe5-39a6-4917-8a39-6ab94a8c2a66_2321x1618.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b174c51f-93f9-4bd8-94df-36cfe04932de_2321x1618.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1015,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:148481,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/184812737?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb174c51f-93f9-4bd8-94df-36cfe04932de_2321x1618.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!VN5Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef193fe5-39a6-4917-8a39-6ab94a8c2a66_2321x1618.png 424w, https://substackcdn.com/image/fetch/$s_!VN5Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef193fe5-39a6-4917-8a39-6ab94a8c2a66_2321x1618.png 848w, https://substackcdn.com/image/fetch/$s_!VN5Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef193fe5-39a6-4917-8a39-6ab94a8c2a66_2321x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!VN5Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef193fe5-39a6-4917-8a39-6ab94a8c2a66_2321x1618.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Sequence Diagram (Order Submission)</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!P5rp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F503679ae-4cd6-40cf-ae01-5399887eb1d4_2321x1618.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!P5rp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F503679ae-4cd6-40cf-ae01-5399887eb1d4_2321x1618.png 424w, https://substackcdn.com/image/fetch/$s_!P5rp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F503679ae-4cd6-40cf-ae01-5399887eb1d4_2321x1618.png 848w, https://substackcdn.com/image/fetch/$s_!P5rp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F503679ae-4cd6-40cf-ae01-5399887eb1d4_2321x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!P5rp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F503679ae-4cd6-40cf-ae01-5399887eb1d4_2321x1618.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!P5rp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F503679ae-4cd6-40cf-ae01-5399887eb1d4_2321x1618.png" width="1456" height="1015" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/503679ae-4cd6-40cf-ae01-5399887eb1d4_2321x1618.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/73c82685-1ab4-4176-809c-77e22772dea3_2321x1618.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1015,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:188699,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/184812737?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73c82685-1ab4-4176-809c-77e22772dea3_2321x1618.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!P5rp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F503679ae-4cd6-40cf-ae01-5399887eb1d4_2321x1618.png 424w, https://substackcdn.com/image/fetch/$s_!P5rp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F503679ae-4cd6-40cf-ae01-5399887eb1d4_2321x1618.png 848w, https://substackcdn.com/image/fetch/$s_!P5rp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F503679ae-4cd6-40cf-ae01-5399887eb1d4_2321x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!P5rp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F503679ae-4cd6-40cf-ae01-5399887eb1d4_2321x1618.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>9. Data Management</h4><ul><li><p><strong>Schema strategy</strong>: FIX messages normalized to protobuf/Avro for internal bus.</p></li><li><p><strong>Partitioning</strong>: Kafka topics partitioned by venue/symbol/client.</p></li><li><p><strong>Caching</strong>: Redis for transient connection state + quote snapshots (TTL &lt;1s).</p></li><li><p><strong>Transactional model</strong>: Idempotent consumers + exactly-once semantics (Kafka) + compensating events for rare failures.</p></li><li><p><strong>Data residency</strong>: Co-location in major financial hubs (LD4, NY4, etc.).</p></li></ul><h4>10. Security &amp; Compliance</h4><ul><li><p>Encrypt in-transit (TLS 1.3) + mutual auth for FIX.</p></li><li><p>Role-based access for APIs.</p></li><li><p>Full audit logging of all messages (immutable append-only).</p></li><li><p>Pre-trade risk checks in gateway layer.</p></li><li><p>Regular penetration testing + compliance certifications.</p></li></ul><h4>11. Observability &amp; SLOs</h4><ul><li><p>SLOs: 99.999% connection availability, p99 latency &lt;500&#956;s.</p></li><li><p>Metrics: msg/sec, latency histograms, connection drops, queue depth.</p></li><li><p>Tracing: OpenTelemetry across all services.</p></li><li><p>Alerting: Connection heartbeat miss &gt;5s, latency breach, error rate &gt;0.01%.</p></li></ul><h4>12.Roadmap &amp; Milestones (3&#8211;5 sprints)</h4><p>Sprint 0: Spike FIX engine performance + venue onboarding template.<br>Sprint 1: Core FIX Gateway + monitoring (MVA for one asset class).<br>Sprint 2: Smart Order Router + market data integration.<br>Sprint 3: Multi-venue failover + full internal event bus.<br>Sprint 4: Security hardening + production readiness (load testing).</p><div><hr></div><p><strong>Closing Words</strong></p><p>The proposed architecture &#8212; centered on event-driven microservices with specialized, high-performance FIX gateways &#8212; delivers the ultra-low latency, five-nines availability, and rock-solid message sequencing required in a competitive multi-asset trading environment while preserving team velocity and long-term evolvability.</p><p>By clearly separating protocol concerns (gateways), routing intelligence (SOR), market-data normalization, and internal distribution, we achieve excellent isolation of failure domains, independent scaling, and straightforward onboarding of new venues and liquidity providers.</p><p>Next concrete action: run the <strong>FIX engine performance &amp; language spike</strong> (Go vs Rust vs C++ under 100k+ msg/sec load with realistic venue simulation) within the next 1&#8211;2 weeks. This single experiment will remove the largest remaining technical uncertainty and allow the team to move forward with high confidence.</p><p>This design positions the connectivity layer as a true competitive advantage: fast enough to win on execution quality, reliable enough to survive the most volatile market days, and flexible enough to support future asset classes and regulatory changes without painful rewrites.</p><p></p><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/designing-trading-platform-architecture?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Thanks for reading Seyhun's Substack! This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/designing-trading-platform-architecture?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://seyhunak.substack.com/p/designing-trading-platform-architecture?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><p></p><div><hr></div><h4>Want to follow the journey?</h4><p>I&#8217;m sharing the process of designing agentic financial systems architecture, engineering, AI automation and building tools with Crafted AI Framework</p><p>If you want to collaborate, test, or co-build the next generation of fintech, reach out.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QemM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QemM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QemM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg" width="604" height="223.57226792009402" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:315,&quot;width&quot;:851,&quot;resizeWidth&quot;:604,&quot;bytes&quot;:15329,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/178341924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!QemM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QemM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Contact with us at Crafted <a href="http://we-crafted.com/">we-crafted.com</a></strong></p><ul><li><p>Discover how we turn complex ideas into working AI products &#8212; visit we-crafted.com and start a conversation with our team.</p></li><li><p>See what we&#8217;re building next. Explore case studies and reach out at we-crafted.com.</p></li><li><p>Have a product idea worth accelerating? Let&#8217;s build it together</p></li><li><p>From prototype to production-grade AI systems &#8212; learn more and get in touch</p></li><li><p>Looking for enterprise-grade AI agents or RAG infrastructure? Visit we-crafted.com</p></li></ul><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Seyhun's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/designing-trading-platform-architecture/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://seyhunak.substack.com/p/designing-trading-platform-architecture/comments"><span>Leave a comment</span></a></p><div class="directMessage button" data-attrs="{&quot;userId&quot;:1033694,&quot;userName&quot;:&quot;Seyhun Akyurek&quot;,&quot;canDm&quot;:null,&quot;dmUpgradeOptions&quot;:null,&quot;isEditorNode&quot;:true}" data-component-name="DirectMessageToDOM"></div><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Designing Real-Time Multi-Rail Instant Payments Orchestration Platform]]></title><description><![CDATA[As of January 2026 &#8211; Supporting SEPA Instant, UK Faster Payments, FedNow, RTP, and emerging global rails]]></description><link>https://seyhunak.substack.com/p/designing-real-time-multi-rail-instant</link><guid isPermaLink="false">https://seyhunak.substack.com/p/designing-real-time-multi-rail-instant</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Fri, 09 Jan 2026 16:15:24 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!r9EW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bd12d8-94c6-4814-8e78-9a9d1b4484bf_2345x1618.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The platform captures this as a payment intent, evaluates routing rules based on factors like cost, speed, and regulatory fit across rails (e.g., RTGS for high-value real-time gross settlement, Faster Payments for UK instant transfers, SEPA Instant for eurozone, or ACH for US batch-like but adapted for speed). </p><p>Once routed, the system processes the transaction idempotently to ensure exactly-once execution, handling confirmations from external rails. If issues arise&#8212;like network failures or rail rejections&#8212;the platform triggers retries or compensations, such as reversals, while notifying stakeholders. Ultimately, the payee receives funds instantly, and both parties get status updates, maintaining trust in cross-border or multi-rail scenarios.</p><p>As of January 2026, the landscape of instant payments continues to evolve rapidly with maturing rails like SEPA Instant (mandatory in more EU countries, structured addresses enforced by Nov 2026), UK&#8217;s Faster Payments (high limits), US FedNow and RTP (critical mass, 24/7 high-volume), and emerging systems like Canada&#8217;s Real-Time Rail (industry testing in 2026). A payer initiates an instant transfer via app/API, expecting funds availability in seconds across borders or rails. </p><p>The orchestration platform receives the intent, applies intelligent routing (cost/speed/compliance/availability), executes via the chosen rail (handling confirmations/webhooks), ensures no duplicates or overspends through idempotency, and applies retries/compensations on transient failures while maintaining audit trails for regulations like PSD2/ISO 20022. The system notifies stakeholders instantly and provides reconciliation.</p><blockquote><p><em>Before we start: Please note that, while the architecture, benchmarks, and scale-up phases are grounded in common production patterns, the numbers here are simulated for educational purposes and may not reflect every real-world banking environment. The goal is to demonstrate how design layer could scale toward modern banking platform principles, not to claim a one-size-fits-all blueprint.</em></p></blockquote><h4>1. Key Domain Events</h4><p>Key domain events extracted from the story, in chronological flow:</p><ul><li><p><strong>PaymentIntentCreated</strong>: Triggered by command &#8220;CreatePaymentIntent&#8221;; involves PaymentIntent aggregate; results in state change to &#8220;Pending&#8221; and emits event to routing.</p></li><li><p><strong>RouteSelected</strong>: Triggered by &#8220;EvaluateRouting&#8221;; involves RoutingRules aggregate; selects rail (e.g., RTGS) based on rules; emits to processing.</p></li><li><p><strong>TransactionInitiated</strong>: Triggered by &#8220;ProcessTransaction&#8221;; involves Transaction aggregate; sends to external rail; may emit &#8220;TransactionFailed&#8221; if immediate error.</p></li><li><p><strong>TransactionConfirmed</strong>: Triggered by rail callback/webhook; updates Transaction aggregate to &#8220;Completed&#8221;; emits to settlement or notification.</p></li><li><p><strong>RetryTriggered</strong>: Triggered by &#8220;HandleFailure&#8221;; involves Compensation aggregate; attempts re-processing; may lead to &#8220;CompensationExecuted&#8221; (e.g., reversal).</p></li><li><p><strong>PaymentSettled</strong>: Triggered by &#8220;FinalizeSettlement&#8221;; marks end; notifies parties.</p></li></ul><p>Clusters: Intent Creation (cause: user input), Routing (effect: selection), Processing (cause-effect: initiation to confirmation), Compensation (effect: failure handling).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!r9EW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bd12d8-94c6-4814-8e78-9a9d1b4484bf_2345x1618.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!r9EW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bd12d8-94c6-4814-8e78-9a9d1b4484bf_2345x1618.png 424w, https://substackcdn.com/image/fetch/$s_!r9EW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bd12d8-94c6-4814-8e78-9a9d1b4484bf_2345x1618.png 848w, https://substackcdn.com/image/fetch/$s_!r9EW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bd12d8-94c6-4814-8e78-9a9d1b4484bf_2345x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!r9EW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bd12d8-94c6-4814-8e78-9a9d1b4484bf_2345x1618.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!r9EW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bd12d8-94c6-4814-8e78-9a9d1b4484bf_2345x1618.png" width="1456" height="1005" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e9bd12d8-94c6-4814-8e78-9a9d1b4484bf_2345x1618.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa9bcc9b-95f7-4664-85d3-372230fb846c_2345x1618.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1005,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:139530,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/184034580?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa9bcc9b-95f7-4664-85d3-372230fb846c_2345x1618.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!r9EW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bd12d8-94c6-4814-8e78-9a9d1b4484bf_2345x1618.png 424w, https://substackcdn.com/image/fetch/$s_!r9EW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bd12d8-94c6-4814-8e78-9a9d1b4484bf_2345x1618.png 848w, https://substackcdn.com/image/fetch/$s_!r9EW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bd12d8-94c6-4814-8e78-9a9d1b4484bf_2345x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!r9EW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bd12d8-94c6-4814-8e78-9a9d1b4484bf_2345x1618.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>2. Domain Objects and Bounded Contexts</h4><p><strong>Bounded Contexts:</strong></p><ul><li><p><strong>Payment Intent Context</strong>: Handles creation and validation of intents; core entities: PaymentIntent (aggregate root with ID, amount, parties); value objects: Currency, RecipientDetails; invariants: Amount &gt; 0, valid parties.</p></li><li><p><strong>Routing Context</strong>: Evaluates rules for rail selection; entities: RoutingRule (aggregate); value objects: RailCriteria (cost, speed); incoming: PaymentIntentCreated; outgoing: RouteSelected.</p></li><li><p><strong>Processing Context</strong>: Manages idempotent execution; entities: Transaction (aggregate with idempotency key); value objects: RailResponse; invariants: Exactly-once via key; incoming: RouteSelected; outgoing: TransactionConfirmed/Failed.</p></li><li><p><strong>Compensation Context</strong>: Deals with failures; entities: CompensationAction (aggregate); value objects: RetryPolicy; incoming: TransactionFailed; outgoing: RetryTriggered or CompensationExecuted.</p></li></ul><p><strong>Context Map:</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YbLe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff88d5654-f8b3-479a-8dfc-611e7d6320e3_2345x1618.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YbLe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff88d5654-f8b3-479a-8dfc-611e7d6320e3_2345x1618.png 424w, https://substackcdn.com/image/fetch/$s_!YbLe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff88d5654-f8b3-479a-8dfc-611e7d6320e3_2345x1618.png 848w, https://substackcdn.com/image/fetch/$s_!YbLe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff88d5654-f8b3-479a-8dfc-611e7d6320e3_2345x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!YbLe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff88d5654-f8b3-479a-8dfc-611e7d6320e3_2345x1618.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YbLe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff88d5654-f8b3-479a-8dfc-611e7d6320e3_2345x1618.png" width="1456" height="1005" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f88d5654-f8b3-479a-8dfc-611e7d6320e3_2345x1618.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/485c39ec-f41b-4e3a-9982-fdc924408752_2345x1618.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1005,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:193167,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/184034580?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F485c39ec-f41b-4e3a-9982-fdc924408752_2345x1618.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!YbLe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff88d5654-f8b3-479a-8dfc-611e7d6320e3_2345x1618.png 424w, https://substackcdn.com/image/fetch/$s_!YbLe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff88d5654-f8b3-479a-8dfc-611e7d6320e3_2345x1618.png 848w, https://substackcdn.com/image/fetch/$s_!YbLe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff88d5654-f8b3-479a-8dfc-611e7d6320e3_2345x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!YbLe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff88d5654-f8b3-479a-8dfc-611e7d6320e3_2345x1618.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/ObzsE/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b1b40027-144e-466b-a239-6b3f6e844c88_1220x696.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b05827ce-8acd-4709-898a-7ece5fefa6bc_1220x766.png&quot;,&quot;height&quot;:380,&quot;title&quot;:&quot;Domain-to-Architecture Mapping&quot;,&quot;description&quot;:&quot;Create interactive, responsive &amp; beautiful charts &#8212; no code required.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/ObzsE/1/" width="730" height="380" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><p>Validation: Events use past tense and business terms; aggregates enforce invariants (e.g., Transaction prevents duplicates); boundaries are coarse to avoid over-fragmentation; each service owns its data; no duplicated rules (routing centralized).</p><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/PQgdV/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d45aa7be-900c-4a36-b790-7c2719299174_1220x930.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d8877500-ec5a-4e79-aa47-e7af15ac4538_1220x1000.png&quot;,&quot;height&quot;:500,&quot;title&quot;:&quot;3. Functional Requirements                                          &quot;,&quot;description&quot;:&quot;Create interactive, responsive &amp; beautiful charts &#8212; no code required.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/PQgdV/1/" width="730" height="500" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/awFgF/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95277c6e-9375-4e8f-b7df-b594818b181f_1220x1072.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7b454c94-86d0-4e2b-ad68-32f7d91bc3b1_1220x1142.png&quot;,&quot;height&quot;:572,&quot;title&quot;:&quot;4. Non-Functional Requirements&quot;,&quot;description&quot;:&quot;Create interactive, responsive &amp; beautiful charts &#8212; no code required.&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/awFgF/1/" width="730" height="572" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><h4>5. Traceability Matrix</h4><p>F1 &#8594; Payment Intent Service<br>F2 &#8594; Routing Engine Service<br>F3 &#8594; Idempotent Transaction Processor<br>F4 &#8594; Compensation Logic Service<br>F5 &#8594; Notification Integration<br>N1 &#8594; In-memory caching + async events<br>N2 &#8594; Autoscaling + event bus<br>N3 &#8594; Idempotency keys + event sourcing<br>N4 &#8594; Microservices architecture<br>N5 &#8594; Isolated payment data + encryption<br>N6 &#8594; Distributed tracing + metrics</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sE5Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9756afe-0bc9-4763-b90c-1e66fdcb9e3c_2345x1618.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sE5Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9756afe-0bc9-4763-b90c-1e66fdcb9e3c_2345x1618.png 424w, https://substackcdn.com/image/fetch/$s_!sE5Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9756afe-0bc9-4763-b90c-1e66fdcb9e3c_2345x1618.png 848w, https://substackcdn.com/image/fetch/$s_!sE5Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9756afe-0bc9-4763-b90c-1e66fdcb9e3c_2345x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!sE5Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9756afe-0bc9-4763-b90c-1e66fdcb9e3c_2345x1618.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sE5Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9756afe-0bc9-4763-b90c-1e66fdcb9e3c_2345x1618.png" width="1456" height="1005" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b9756afe-0bc9-4763-b90c-1e66fdcb9e3c_2345x1618.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9637939e-7386-4bee-acf9-ffcc31e33f6d_2345x1618.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1005,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:131803,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/184034580?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9637939e-7386-4bee-acf9-ffcc31e33f6d_2345x1618.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sE5Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9756afe-0bc9-4763-b90c-1e66fdcb9e3c_2345x1618.png 424w, https://substackcdn.com/image/fetch/$s_!sE5Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9756afe-0bc9-4763-b90c-1e66fdcb9e3c_2345x1618.png 848w, https://substackcdn.com/image/fetch/$s_!sE5Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9756afe-0bc9-4763-b90c-1e66fdcb9e3c_2345x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!sE5Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9756afe-0bc9-4763-b90c-1e66fdcb9e3c_2345x1618.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Assumptions</h4><ol><li><p>Traffic is spiky with peaks during business hours; baseline 1k TPS.</p></li><li><p>External rails provide webhooks/callbacks for confirmations.</p></li><li><p>Team of 8-10 engineers; cloud-native stack (AWS/GCP).</p></li><li><p>No batch processing; focus on instant only.</p></li><li><p>Regulatory compliance (e.g., PSD2) mandates auditability.</p></li><li><p>Budget allows managed services for event bus/DB.</p></li></ol><h4>Important Metrics &amp; Constraints</h4><ol><li><p>p95 latency &lt;500ms (drives async design).</p></li><li><p>Exactly-once rate &gt;99.999% (measures idempotency success).</p></li><li><p>Peak TPS 10k (scalability benchmark).</p></li><li><p>Uptime 99.99% (reliability SLA).</p></li><li><p>Compliance adherence (e.g., data residency in EU/US).</p></li></ol><h4>6. Architectural Design Options</h4><p><strong>Option A: Monolithic API with Synchronous Calls</strong><br>Summary: Single service handling all logic synchronously.<br>Key components: - Monolith API, Relational DB, In-memory rules cache.<br>Scalability profile: Vertical scaling; limited horizontal due to shared state.<br>Latency &amp; consistency: Low for simple paths (&lt;300ms); strong via DB transactions.<br>Estimated cost behavior: Low (single instance).<br>Operational complexity: Low.<br>Failure modes &amp; mitigation: Single point failure; use DB replicas + circuit breakers.</p><p><strong>Option B: Microservices with Event-Driven Orchestration</strong><br>Summary: Services per context, Kafka for events.<br>Key components: - Payment Intent svc, Routing svc, Processor svc, Compensation svc, Kafka, Postgres/Mongo.<br>Scalability profile: Horizontal per service; event bus handles decoupling.<br>Latency &amp; consistency: &lt;500ms via async; eventual for non-critical, strong for transactions.<br>Estimated cost behavior: Medium (multiple services + broker).<br>Operational complexity: Medium (tracing needed).<br>Failure modes &amp; mitigation: Event loss; use at-least-once delivery + idempotency.</p><p><strong>Option C: Serverless with Orchestration Functions</strong><br>Summary: Lambda functions + Step Functions for flows.<br>Key components: - Lambdas for each logic, DynamoDB, SQS/EventBridge.<br>Scalability profile: Auto-scales excellently for spikes.<br>Latency &amp; consistency: &lt;600ms; eventual in DynamoDB.<br>Estimated cost behavior: Low baseline, pay-per-use.<br>Operational complexity: Low ops, high debugging.<br>Failure modes &amp; mitigation: Cold starts; provisioned concurrency.</p><h4>7. Recommended Option with Reasoning Chain</h4><p><strong>Recommendation: Option B &#8212; Microservices with Event-Driven Orchestration.</strong></p><ol><li><p>Latency SLA (&lt;500ms): Event-driven decouples slow rail calls, allowing async processing vs sync blocks in A or cold starts in C.</p></li><li><p>Exactly-once: Idempotency keys in processor + event sourcing in Kafka ensure deduplication, stronger than A&#8217;s shared DB or C&#8217;s eventual model.</p></li><li><p>Throughput (10k TPS): Horizontal scaling per service outperforms A&#8217;s vertical limits and matches C but with better consistency control.</p></li><li><p>Compliance: Isolated services ease PCI scoping vs monolith; events provide audit trail.</p></li><li><p>Team/Ops: Medium complexity fits assumed team size; managed Kafka reduces burden over C&#8217;s vendor lock.</p></li><li><p>Tradeoff: Higher cost than A but justified by scale; avoids C&#8217;s latency variability.</p></li></ol><h4>8. System Design &amp; Sequence Diagrams</h4><p><strong>System Design:</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2thf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3a59df8-56ba-4514-9378-41138aacdbf3_2345x1618.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2thf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3a59df8-56ba-4514-9378-41138aacdbf3_2345x1618.png 424w, https://substackcdn.com/image/fetch/$s_!2thf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3a59df8-56ba-4514-9378-41138aacdbf3_2345x1618.png 848w, https://substackcdn.com/image/fetch/$s_!2thf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3a59df8-56ba-4514-9378-41138aacdbf3_2345x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!2thf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3a59df8-56ba-4514-9378-41138aacdbf3_2345x1618.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2thf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3a59df8-56ba-4514-9378-41138aacdbf3_2345x1618.png" width="1456" height="1005" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d3a59df8-56ba-4514-9378-41138aacdbf3_2345x1618.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5ae5a67a-052c-4b35-a33f-1e880c5bd84a_2345x1618.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1005,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:153747,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/184034580?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ae5a67a-052c-4b35-a33f-1e880c5bd84a_2345x1618.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2thf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3a59df8-56ba-4514-9378-41138aacdbf3_2345x1618.png 424w, https://substackcdn.com/image/fetch/$s_!2thf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3a59df8-56ba-4514-9378-41138aacdbf3_2345x1618.png 848w, https://substackcdn.com/image/fetch/$s_!2thf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3a59df8-56ba-4514-9378-41138aacdbf3_2345x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!2thf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3a59df8-56ba-4514-9378-41138aacdbf3_2345x1618.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Sequence Diagram for Payment Flow:</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xjUX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9fa9df-ffa8-46e4-94e9-9e860014a83e_2345x1618.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xjUX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9fa9df-ffa8-46e4-94e9-9e860014a83e_2345x1618.png 424w, https://substackcdn.com/image/fetch/$s_!xjUX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9fa9df-ffa8-46e4-94e9-9e860014a83e_2345x1618.png 848w, https://substackcdn.com/image/fetch/$s_!xjUX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9fa9df-ffa8-46e4-94e9-9e860014a83e_2345x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!xjUX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9fa9df-ffa8-46e4-94e9-9e860014a83e_2345x1618.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xjUX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9fa9df-ffa8-46e4-94e9-9e860014a83e_2345x1618.png" width="1456" height="1005" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a9fa9df-ffa8-46e4-94e9-9e860014a83e_2345x1618.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1005,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:207241,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/184034580?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9fa9df-ffa8-46e4-94e9-9e860014a83e_2345x1618.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xjUX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9fa9df-ffa8-46e4-94e9-9e860014a83e_2345x1618.png 424w, https://substackcdn.com/image/fetch/$s_!xjUX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9fa9df-ffa8-46e4-94e9-9e860014a83e_2345x1618.png 848w, https://substackcdn.com/image/fetch/$s_!xjUX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9fa9df-ffa8-46e4-94e9-9e860014a83e_2345x1618.png 1272w, https://substackcdn.com/image/fetch/$s_!xjUX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9fa9df-ffa8-46e4-94e9-9e860014a83e_2345x1618.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>9. Data Management</h4><p>Schema strategy: Event-sourced for audits (Kafka topics as source of truth); relational for transactions (Postgres with idempotency keys as unique constraints).<br>Sharding/partitioning: By payment ID in DB; topics partitioned by rail.<br>Caching: Redis for rules and intents (TTL 5min).<br>Backup and restore: Daily snapshots + PITR for DB; Kafka replication.<br>Transactional model: Sagas for distributed tx (e.g., compensation on failure); no 2PC due to latency.<br>Data residency: Region-specific (e.g., EU data in EU zones) per compliance.</p><h4>10. Security &amp; Compliance</h4><p>Primary controls: Tokenization for PII; TLS everywhere; RBAC via IAM; audit logs for all events. PSD2 strong auth at intent; PCI for card rails via isolated processor. Pen-tests quarterly.</p><h4>11. Observability &amp; SLOs</h4><p>Metrics: Latency histograms, TPS, error rates, idempotency hits.<br>Tracing: OpenTelemetry across services.<br>Logs: Structured with correlation IDs.<br>Alerting: Latency &gt;400ms p95, uptime breaches, duplicate detections &gt;0.1%.</p><h4>12. Roadmap &amp; Milestones</h4><p>Sprint 0 (1wk): Spike idempotency prototype.<br>Sprint 1 (2wks): MVA: Intent + Routing services, basic event bus.<br>Sprint 2 (2wks): Processor + simple rail integration; load test 1k TPS.<br>Sprint 3 (2wks): Compensation logic; end-to-end tests.<br>Sprint 4 (2wks): Observability + compliance hardening; scale to 10k TPS.<br>Sprint 5: Production rollout with monitoring.</p><p></p><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/designing-real-time-multi-rail-instant?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Thanks for reading Seyhun's Substack! This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/designing-real-time-multi-rail-instant?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://seyhunak.substack.com/p/designing-real-time-multi-rail-instant?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><h4>Want to follow the journey?</h4><p>I&#8217;m sharing the process of designing agentic financial systems architecture, engineering, AI automation and building tools with Crafted AI Framework</p><p>If you want to collaborate, test, or co-build the next generation of fintech, reach out.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QemM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QemM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QemM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg" width="604" height="223.57226792009402" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:315,&quot;width&quot;:851,&quot;resizeWidth&quot;:604,&quot;bytes&quot;:15329,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/178341924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!QemM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QemM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Contact with us at Crafted <a href="http://we-crafted.com/">we-crafted.com</a></strong></p><ul><li><p>Discover how we turn complex ideas into working AI products &#8212; visit we-crafted.com and start a conversation with our team.</p></li><li><p>See what we&#8217;re building next. Explore case studies and reach out at we-crafted.com.</p></li><li><p>Have a product idea worth accelerating? Let&#8217;s build it together</p></li><li><p>From prototype to production-grade AI systems &#8212; learn more and get in touch</p></li><li><p>Looking for enterprise-grade AI agents or RAG infrastructure? Visit we-crafted.com</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Seyhun's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/designing-real-time-multi-rail-instant/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://seyhunak.substack.com/p/designing-real-time-multi-rail-instant/comments"><span>Leave a comment</span></a></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Designing AI-Driven Customer Lifetime Value (CLV) Platform in Retail Banking]]></title><description><![CDATA[In 2026, retail banks face intensifying competition from digital natives and fintechs, where hyper-personalization and predictive customer analytics drive differentiation.]]></description><link>https://seyhunak.substack.com/p/designing-ai-driven-customer-lifetime</link><guid isPermaLink="false">https://seyhunak.substack.com/p/designing-ai-driven-customer-lifetime</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Fri, 02 Jan 2026 13:50:33 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!YLT_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7bc7a446-b18e-4801-afe5-670dc7388b4e_2345x1526.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In 2026, retail banks face intensifying competition from digital natives and fintechs, where <strong>hyper-personalization</strong> and predictive customer analytics drive differentiation. Leading institutions leverage AI to shift from reactive servicing to proactive, lifetime-oriented engagement&#8212;anticipating life events, optimizing cross-selling, and maximizing long-term profitability per customer.</p><p>This report outlines a scalable, event-driven architecture for a CLV platform that delivers accurate predictions (target churn AUC &gt;0.85, CLV MAE &lt;15%), supports dynamic segmentation, and enables real-time personalized offers while complying with GDPR and banking regulations. The recommended design balances scalability for 10&#8211;50M customers, model governance, and operational feasibility, drawing from current industry trends in lake-house architectures and feature stores.</p><blockquote><p><em>Before we start: Please note that, while the architecture, benchmarks, and scale-up phases are grounded in common production patterns, the numbers here are simulated for educational purposes and may not reflect every real-world banking environment. The goal is to demonstrate how design layer could scale toward modern banking platform principles, not to claim a one-size-fits-all blueprint.</em></p></blockquote><p>A retail bank wants to maximize the long-term profitability of each customer. Relationship managers and marketing teams review customer profiles, which include historical transactions, product holdings, demographic data, and behavioral signals (e.g., app logins, channel usage). </p><p>The system continuously analyzes this data to compute a Customer Lifetime Value score, segment customers (high-value, growing, at-risk), predict churn probability, and forecast future revenue streams. Based on these insights, the platform generates personalized product recommendations (e.g., credit cards, mortgages, investment accounts) and triggers targeted offers via integrated marketing automation tools or CRM systems. When a customer accepts an offer or exhibits churn signals, the system updates scores and records the outcome for ongoing model improvement.</p><h4>1. Event Storming</h4><p>Key domain events (past tense): TransactionsIngested, BehaviorEventsIngested, FeaturesComputed, CLVScoreCalculated, ChurnPredicted, RevenueForecasted, CustomerSegmented, PersonalizedOffersGenerated, OfferSentToCRM, OfferAccepted, CustomerChurned.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YLT_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7bc7a446-b18e-4801-afe5-670dc7388b4e_2345x1526.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YLT_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7bc7a446-b18e-4801-afe5-670dc7388b4e_2345x1526.png 424w, https://substackcdn.com/image/fetch/$s_!YLT_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7bc7a446-b18e-4801-afe5-670dc7388b4e_2345x1526.png 848w, https://substackcdn.com/image/fetch/$s_!YLT_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7bc7a446-b18e-4801-afe5-670dc7388b4e_2345x1526.png 1272w, https://substackcdn.com/image/fetch/$s_!YLT_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7bc7a446-b18e-4801-afe5-670dc7388b4e_2345x1526.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YLT_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7bc7a446-b18e-4801-afe5-670dc7388b4e_2345x1526.png" width="1456" height="947" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7bc7a446-b18e-4801-afe5-670dc7388b4e_2345x1526.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f15117cd-ea21-4ba7-adc3-b66dbe009bf1_2345x1526.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:947,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:138026,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/183239658?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff15117cd-ea21-4ba7-adc3-b66dbe009bf1_2345x1526.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!YLT_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7bc7a446-b18e-4801-afe5-670dc7388b4e_2345x1526.png 424w, https://substackcdn.com/image/fetch/$s_!YLT_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7bc7a446-b18e-4801-afe5-670dc7388b4e_2345x1526.png 848w, https://substackcdn.com/image/fetch/$s_!YLT_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7bc7a446-b18e-4801-afe5-670dc7388b4e_2345x1526.png 1272w, https://substackcdn.com/image/fetch/$s_!YLT_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7bc7a446-b18e-4801-afe5-670dc7388b4e_2345x1526.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>2. Domain-Driven Design (Contexts, Aggregates, Context Map)</h4><p><strong>Bounded Contexts</strong>:</p><ul><li><p>Data Ingestion &amp; Feature Engineering</p></li><li><p>Predictive Modeling &amp; Scoring</p></li><li><p>Segmentation &amp; Offer Engine</p></li><li><p>Integration &amp; Orchestration</p></li></ul><p><strong>Core Aggregates</strong>:</p><ul><li><p>Customer Profile (root: CustomerId) &#8211; holds demographics, product holdings, computed features.</p></li><li><p>CLV Model Run &#8211; immutable snapshot of model version + predictions (CLV score, churn prob, revenue forecast).</p></li><li><p>Customer Segment &#8211; dynamic grouping with rules.</p></li><li><p>Personalized Offer &#8211; contains recommendations and eligibility rules.</p></li></ul><p><strong>Context Map</strong>:</p><p>Relationships: Upstream &#8594; Downstream via domain events; Integration acts as conformist to external systems.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cE51!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07732cd6-9cd1-4500-babf-b8a792641469_2345x1526.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cE51!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07732cd6-9cd1-4500-babf-b8a792641469_2345x1526.png 424w, https://substackcdn.com/image/fetch/$s_!cE51!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07732cd6-9cd1-4500-babf-b8a792641469_2345x1526.png 848w, https://substackcdn.com/image/fetch/$s_!cE51!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07732cd6-9cd1-4500-babf-b8a792641469_2345x1526.png 1272w, https://substackcdn.com/image/fetch/$s_!cE51!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07732cd6-9cd1-4500-babf-b8a792641469_2345x1526.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cE51!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07732cd6-9cd1-4500-babf-b8a792641469_2345x1526.png" width="1456" height="947" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/07732cd6-9cd1-4500-babf-b8a792641469_2345x1526.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:947,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:164023,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/183239658?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07732cd6-9cd1-4500-babf-b8a792641469_2345x1526.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cE51!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07732cd6-9cd1-4500-babf-b8a792641469_2345x1526.png 424w, https://substackcdn.com/image/fetch/$s_!cE51!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07732cd6-9cd1-4500-babf-b8a792641469_2345x1526.png 848w, https://substackcdn.com/image/fetch/$s_!cE51!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07732cd6-9cd1-4500-babf-b8a792641469_2345x1526.png 1272w, https://substackcdn.com/image/fetch/$s_!cE51!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07732cd6-9cd1-4500-babf-b8a792641469_2345x1526.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h4>3. Domain Validation:</h4><ul><li><p>Events named consistently in past tense with business meaning.</p></li><li><p>Aggregates enforce invariants (e.g., CLV score only updated via model run).</p></li><li><p>Boundaries appropriately coarse (4 contexts avoid nano-services).</p></li><li><p>Each context owns its data.</p></li><li><p>No duplicated business rules (e.g., churn definition lives only in Modeling).</p></li></ul><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/As37X/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a1ee7c76-9220-451f-ac39-6efbf23fa11b_1220x1036.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/331028f1-ab20-42c3-874d-0c4affc464af_1220x1106.png&quot;,&quot;height&quot;:554,&quot;title&quot;:&quot;4. Functional Requirements&quot;,&quot;description&quot;:&quot;&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/As37X/1/" width="730" height="554" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/jSdUj/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bb9265d3-4aba-4e55-9b7c-5898a69a9853_1220x1004.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1e35f73a-3523-4e93-96b4-18eb675dc66a_1220x1074.png&quot;,&quot;height&quot;:537,&quot;title&quot;:&quot;5. Non-Functional Requirements&quot;,&quot;description&quot;:&quot;&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/jSdUj/1/" width="730" height="537" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><h4>6. Traceability Matrix</h4><p>F1 &#8594; Ingestion Context<br>F2 &#8594; Modeling Context<br>F3 &#8594; Scoring Context<br>F4 &#8594; Offer Engine Context<br>F5 &#8594; Integration Context<br>F6 &#8594; API Layer + Dashboard</p><p>N1 &#8594; Batch processing + caching<br>N2 &#8594; Horizontal scaling + partitioning<br>N3 &#8594; ML monitoring pipeline<br>N4 &#8594; Multi-AZ + autoscaling<br>N5 &#8594; Encryption + ACLs<br>N6 &#8594; OpenTelemetry + model metrics</p><h4>7. Assumptions</h4><ol><li><p>Customer base 10&#8211;50M active accounts.</p></li><li><p>Transaction volume ~1B rows/year; behavior events ~5&#8211;10&#215; higher.</p></li><li><p>Models retrained weekly/monthly; daily scoring runs acceptable.</p></li><li><p>Bank has existing data lake/warehouse for raw data.</p></li><li><p>Team prefers cloud-native managed services (e.g., AWS/GCP/Azure).</p></li><li><p>Regulatory approval needed for production ML models.</p></li></ol><h4>8. Important metrics &amp; constraints</h4><ul><li><p>Daily scoring latency &#8804; 4 hours for full customer base (N1).</p></li><li><p>Prediction accuracy: churn AUC &gt; 0.85, CLV MAE &lt; 15% (N3).</p></li><li><p>Throughput: support 10&#8211;50M customers with horizontal scale (N2).</p></li><li><p>Compliance: GDPR data residency &amp; deletion (N5).</p></li><li><p>Cost: optimize for compute during batch windows.</p></li></ul><h4>9. Three architecture options</h4><p><strong>Option A &#8211; Monolithic Batch + API (Simple, low ops)</strong><br>Summary: Single application with scheduled batch jobs for feature engineering and scoring, serving API/dashboard from same deployment.</p><ul><li><p>Key components: Spark jobs on EMR/Dataproc, PostgreSQL/Timescale for scores, Flask/FastAPI layer, Redis cache.</p></li><li><p>Scalability: Vertical + Spark cluster resize.</p></li><li><p>Latency &amp; consistency: Batch daily; API eventual consistency.</p></li><li><p>Cost: Low&#8211;Medium (EMR on-demand).</p></li><li><p>Operational complexity: Low.</p></li><li><p>Failure modes: Single Spark job failure delays all scoring &#8594; mitigate with retries &amp; alerts.</p></li></ul><p><strong>Option B &#8211; Event-Driven Microservices + Lakehouse (Recommended for scale &amp; agility)</strong><br>Summary: Streaming ingestion &#8594; feature store &#8594; batch/streaming ML pipeline &#8594; materialized scoring tables &#8594; offer engine.</p><ul><li><p>Key components: Kafka/MSK for events, Delta Lake/Iceberg on S3, Feature Store (Feast/Tecton), MLflow/Model Registry, dbt for transformations, Trino/Presto for queries, API Gateway + GraphQL/REST services.</p></li><li><p>Scalability: Highly horizontal (Kafka partitions, Spark/Kubernetes autoscaling).</p></li><li><p>Latency &amp; consistency: Near-real-time features; daily batch scoring + incremental updates.</p></li><li><p>Cost: Medium&#8211;High (managed Kafka + compute).</p></li><li><p>Operational complexity: Medium&#8211;High (need data contract governance).</p></li><li><p>Failure modes: Consumer lag, schema drift &#8594; mitigate with schema registry, backpressure, idempotency.</p></li></ul><p><strong>Option C &#8211; Serverless + Managed ML (Fastest time-to-value, ops-lite)</strong><br>Summary: Fully managed services with minimal custom code.</p><ul><li><p>Key components: Kinesis/Firehose ingestion &#8594; Glue/ Dataflow ETL &#8594; SageMaker Feature Store &amp; Pipelines &#8594; Athena/ BigQuery for scoring views &#8594; AppSync/Lambda API &#8594; DynamoDB for offers.</p></li><li><p>Scalability: Excellent auto-scaling for spiky workloads.</p></li><li><p>Latency &amp; consistency: Similar to B but with potential cold starts.</p></li><li><p>Cost: Medium (pay-per-use; can spike on large batches).</p></li><li><p>Operational complexity: Low (no cluster management).</p></li><li><p>Failure modes: Vendor throttling, cold starts &#8594; provisioned concurrency + capacity units.</p></li></ul><h4>Recommended option &amp; reasoning chain</h4><p><strong>Option B &#8211; Event-Driven Microservices + Lakehouse</strong></p><ol><li><p>Scale requirement (10&#8211;50M customers, high event volume): Lakehouse + Kafka enables partitioned, horizontal processing far beyond monolithic Spark jobs (ties to N2).</p></li><li><p>Accuracy &amp; model iteration (N3): Dedicated feature store and MLflow registry support reproducible experiments and online/offline consistency critical for banking-grade predictions.</p></li><li><p>Near real-time potential: Event-driven design allows future evolution to streaming predictions without full rewrite (future-proofing).</p></li><li><p>Compliance &amp; governance: Data lake with Iceberg tables + fine-grained ACLs + audit logs meets GDPR better than scattered serverless storage (N5).</p></li><li><p>Operational tradeoff: More complex than Option C but team can manage with managed Kafka and Kubernetes; avoids heavy vendor lock-in of pure serverless ML services.</p></li><li><p>Cost vs performance: Batch windows on spot/preemptible compute keep costs predictable vs potentially unpredictable serverless batch costs at this data volume.</p></li></ol><p><strong>Conclusion</strong>: Option B delivers required scale, model governance, and extensibility while remaining operable for a mid-size data engineering team.</p><h4>10. System Design &amp; Sequence Diagrams</h4><p><strong>System Design Diagram</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Rc3J!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F511ff326-196e-486f-8795-3e191c70c0e0_2345x1526.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Rc3J!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F511ff326-196e-486f-8795-3e191c70c0e0_2345x1526.png 424w, https://substackcdn.com/image/fetch/$s_!Rc3J!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F511ff326-196e-486f-8795-3e191c70c0e0_2345x1526.png 848w, https://substackcdn.com/image/fetch/$s_!Rc3J!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F511ff326-196e-486f-8795-3e191c70c0e0_2345x1526.png 1272w, https://substackcdn.com/image/fetch/$s_!Rc3J!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F511ff326-196e-486f-8795-3e191c70c0e0_2345x1526.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Rc3J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F511ff326-196e-486f-8795-3e191c70c0e0_2345x1526.png" width="1456" height="947" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/511ff326-196e-486f-8795-3e191c70c0e0_2345x1526.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b8c8a305-9188-4fcc-b312-c8a88d01c627_2345x1526.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:947,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:126212,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/183239658?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c8a305-9188-4fcc-b312-c8a88d01c627_2345x1526.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Rc3J!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F511ff326-196e-486f-8795-3e191c70c0e0_2345x1526.png 424w, https://substackcdn.com/image/fetch/$s_!Rc3J!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F511ff326-196e-486f-8795-3e191c70c0e0_2345x1526.png 848w, https://substackcdn.com/image/fetch/$s_!Rc3J!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F511ff326-196e-486f-8795-3e191c70c0e0_2345x1526.png 1272w, https://substackcdn.com/image/fetch/$s_!Rc3J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F511ff326-196e-486f-8795-3e191c70c0e0_2345x1526.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Key Flow Sequence Diagram (Daily Scoring + Offer Generation)</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7q3C!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5962703-453d-4989-868e-141d2f320dbb_2345x1526.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7q3C!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5962703-453d-4989-868e-141d2f320dbb_2345x1526.png 424w, https://substackcdn.com/image/fetch/$s_!7q3C!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5962703-453d-4989-868e-141d2f320dbb_2345x1526.png 848w, https://substackcdn.com/image/fetch/$s_!7q3C!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5962703-453d-4989-868e-141d2f320dbb_2345x1526.png 1272w, https://substackcdn.com/image/fetch/$s_!7q3C!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5962703-453d-4989-868e-141d2f320dbb_2345x1526.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7q3C!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5962703-453d-4989-868e-141d2f320dbb_2345x1526.png" width="1456" height="947" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d5962703-453d-4989-868e-141d2f320dbb_2345x1526.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ed1a2f45-8c87-4577-a9d9-5a8b846f0aef_2345x1526.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:947,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:159883,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/183239658?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed1a2f45-8c87-4577-a9d9-5a8b846f0aef_2345x1526.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7q3C!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5962703-453d-4989-868e-141d2f320dbb_2345x1526.png 424w, https://substackcdn.com/image/fetch/$s_!7q3C!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5962703-453d-4989-868e-141d2f320dbb_2345x1526.png 848w, https://substackcdn.com/image/fetch/$s_!7q3C!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5962703-453d-4989-868e-141d2f320dbb_2345x1526.png 1272w, https://substackcdn.com/image/fetch/$s_!7q3C!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5962703-453d-4989-868e-141d2f320dbb_2345x1526.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>11. Data Management, Security, Observability, Roadmap</h4><p><strong>Data Management</strong></p><ul><li><p>Schema strategy: Iceberg tables with schema evolution support.</p></li><li><p>Partitioning: By customer_id (hashed) + date.</p></li><li><p>Caching: Redis for hot customer profiles in API layer.</p></li><li><p>Backup &amp; restore: S3 versioning + snapshots; PITR via lakehouse.</p></li><li><p>Transactional model: Batch atomic writes via Spark transactions; eventual consistency for reads.</p></li><li><p>Data residency: Deploy in region-specific clouds or use private connectivity.</p></li></ul><p><strong>Security &amp; Compliance</strong></p><ul><li><p>Encrypt PII at rest (SSE-KMS) and in transit (TLS 1.3).</p></li><li><p>Column-level encryption for sensitive fields.</p></li><li><p>Row-level security in Trino for RM access.</p></li><li><p>Audit logs of model inference and offer generation.</p></li><li><p>Right-to-be-forgotten: tombstone records + propagation job.</p></li></ul><p><strong>Observability &amp; SLOs</strong></p><ul><li><p>Metrics: Scoring job duration, model drift (PSI), prediction latency, churn AUC weekly.</p></li><li><p>Tracing: OpenTelemetry across services + jobs.</p></li><li><p>Logs: Structured JSON to centralized system.</p></li><li><p>Alerting: Scoring job &gt;4h, drift &gt; threshold, API error rate &gt;0.1%.</p></li></ul><p><strong>Roadmap &amp; Milestones</strong></p><ul><li><p>Sprint 0&#8211;1 (4 weeks): MVA &#8211; Ingestion pipeline + basic feature store + prototype CLV model on sample data.</p></li><li><p>Sprint 2&#8211;3 (6 weeks): Daily batch scoring + materialized views + simple API for scores.</p></li><li><p>Sprint 4&#8211;5 (6 weeks): Offer engine + business rules + integration with one CRM channel.</p></li><li><p>Sprint 6&#8211;7 (6 weeks): Dashboard + RM feedback loop + model monitoring.</p></li><li><p>Sprint 8+: Multi-region, advanced segmentation, streaming updates.</p></li></ul><h4>Closing Summary</h4><p>This event-driven lake-house architecture (Option B) provides the optimal foundation for a production-grade CLV platform in 2026. It enables banks to achieve high-accuracy predictions at scale, seamless integration with marketing systems, and future evolution toward streaming/incremental scoring&#8212;all while maintaining strong governance and compliance.</p><p>Key benefits include:</p><ul><li><p>Horizontal scalability for growing customer bases and transaction volumes.</p></li><li><p>Reproducible ML workflows with online/offline feature consistency.</p></li><li><p>Clear separation of concerns via bounded contexts, reducing coupling and improving maintainability.</p></li></ul><p>Next steps: Validate data volumes with a load test, baseline model performance on historical data, and secure regulatory approval for model explainability. With disciplined execution, this platform can deliver measurable lifts in customer retention, cross-sell conversion, and overall lifetime profitability.</p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/designing-ai-driven-customer-lifetime?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Thanks for reading Seyhun's Substack! This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/p/designing-ai-driven-customer-lifetime?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://seyhunak.substack.com/p/designing-ai-driven-customer-lifetime?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><p></p><h4>Want to follow the journey?</h4><p>I&#8217;m sharing the process of designing agentic financial systems architecture, engineering, AI automation and building tools with Crafted AI Framework</p><p>If you want to collaborate, test, or co-build the next generation of fintech, reach out.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QemM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QemM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QemM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg" width="604" height="223.57226792009402" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:315,&quot;width&quot;:851,&quot;resizeWidth&quot;:604,&quot;bytes&quot;:15329,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/178341924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!QemM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QemM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Contact with us at Crafted <a href="http://we-crafted.com/">we-crafted.com</a></strong></p><ul><li><p>Discover how we turn complex ideas into working AI products &#8212; visit we-crafted.com and start a conversation with our team.</p></li><li><p>See what we&#8217;re building next. Explore case studies and reach out at we-crafted.com.</p></li><li><p>Have a product idea worth accelerating? Let&#8217;s build it together</p></li><li><p>From prototype to production-grade AI systems &#8212; learn more and get in touch</p></li><li><p>Looking for enterprise-grade AI agents or RAG infrastructure? Visit we-crafted.com</p></li></ul><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://seyhunak.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Seyhun's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Designing an AI-Native Incident Response System for Banking Platforms]]></title><description><![CDATA[Let's dive in production incidents&#8212;from payment delays and API outages to cybersecurity breaches and anomalous transaction spikes&#8212;can disrupt critical services, erode customer trust, and invite intense regulatory scrutiny.]]></description><link>https://seyhunak.substack.com/p/designing-an-ai-native-incident-response</link><guid isPermaLink="false">https://seyhunak.substack.com/p/designing-an-ai-native-incident-response</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Thu, 25 Dec 2025 11:38:57 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!cu8K!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d6fe219-f292-4db9-b316-3d0e54ff5881_1080x1350.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Let's dive in production incidents&#8212;from payment delays and API outages to cybersecurity breaches and anomalous transaction spikes&#8212;can disrupt critical services, erode customer trust, and invite intense regulatory scrutiny. Yet incident management remains largely human-centric. On-call engineers battle alert storms, manually correlate fragmented telemetry, form hypotheses under pressure, estimate downstream impact, coordinate remediation, and ultimately assemble post-incident reports for regulators.</p><p>This approach struggles with the scale, speed, and complexity of modern distributed systems, often resulting in prolonged downtime, higher mean time to detection and resolution (MTTD/MTTR), and compliance risks.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cu8K!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d6fe219-f292-4db9-b316-3d0e54ff5881_1080x1350.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cu8K!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d6fe219-f292-4db9-b316-3d0e54ff5881_1080x1350.jpeg 424w, https://substackcdn.com/image/fetch/$s_!cu8K!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d6fe219-f292-4db9-b316-3d0e54ff5881_1080x1350.jpeg 848w, https://substackcdn.com/image/fetch/$s_!cu8K!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d6fe219-f292-4db9-b316-3d0e54ff5881_1080x1350.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!cu8K!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d6fe219-f292-4db9-b316-3d0e54ff5881_1080x1350.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cu8K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d6fe219-f292-4db9-b316-3d0e54ff5881_1080x1350.jpeg" width="538" height="672.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9d6fe219-f292-4db9-b316-3d0e54ff5881_1080x1350.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1350,&quot;width&quot;:1080,&quot;resizeWidth&quot;:538,&quot;bytes&quot;:91022,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/182562817?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d6fe219-f292-4db9-b316-3d0e54ff5881_1080x1350.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cu8K!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d6fe219-f292-4db9-b316-3d0e54ff5881_1080x1350.jpeg 424w, https://substackcdn.com/image/fetch/$s_!cu8K!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d6fe219-f292-4db9-b316-3d0e54ff5881_1080x1350.jpeg 848w, https://substackcdn.com/image/fetch/$s_!cu8K!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d6fe219-f292-4db9-b316-3d0e54ff5881_1080x1350.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!cu8K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d6fe219-f292-4db9-b316-3d0e54ff5881_1080x1350.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>An <strong>AI-native</strong> incident response system flips this paradigm. Built from the ground up around continuous telemetry ingestion, machine learning-driven analysis, and guarded automation, it detects anomalies in real time, generates evidence-backed root-cause hypotheses, estimates blast radius (affected customers, financial exposure, regulatory implications), proposes or executes safe remediations, and produces audit-ready reports all with humans retained in the loop for high-stakes decisions. </p><p>As of late 2025, with regulations like the EU&#8217;s Digital Operational Resilience Act (DORA) mandating harmonized major incident reporting from January 2025, and ongoing emphasis on operational resilience (e.g., BCBS principles, FDIC/OCC guidelines), such systems are not just efficiency enhancers but regulatory imperatives.</p><p>This design leverages event-driven microservices, polyglot persistence, and explainable AI to achieve sub-minute detection latencies, &gt;85% hypothesis accuracy, and immutable audit trails&#8212;transforming incident response from reactive firefighting into proactive, regulator-friendly resilience. The following sections detail the domain model, requirements, architectural options, and recommended implementation.</p><blockquote><p><em>Before we start: Please note that, while the architecture, benchmarks, and scale-up phases are grounded in common production patterns, the numbers here are simulated for educational purposes and may not reflect every real-world banking environment. The goal is to demonstrate how design layer could scale toward modern banking platform principles, not to claim a one-size-fits-all blueprint.</em></p></blockquote><p></p><h4>1. Understanding Domain</h4><p>In a large bank, production platforms process millions of transactions daily across payments, trading, core banking, and customer channels. When an incident occurs&#8212;such as delayed payments, API timeouts, or fraudulent transaction spikes&#8212;engineers receive fragmented alerts from monitoring tools, manually correlate logs and metrics, hypothesize causes, assess impact on customers and finances, execute fixes, and later produce detailed post-mortems for internal stakeholders and regulators.</p><p>An AI-native system changes this: it continuously ingests telemetry, detects anomalies in real time, instantly generates ranked root-cause hypotheses with supporting evidence, estimates blast radius (affected customers, financial exposure, regulatory implications), proposes safe remediation actions (or executes low-risk ones), and auto-generates regulator-ready timeline reports&#8212;all while keeping humans in the loop for high-stakes decisions.</p><h4>2. Key Events</h4><p>Key domain events (past tense):</p><ul><li><p>AnomalyDetected</p></li><li><p>HypothesisGenerated</p></li><li><p>BlastRadiusEstimated</p></li><li><p>RemediationProposed</p></li><li><p>FixApplied</p></li><li><p>IncidentResolved</p></li><li><p>ReportPublished</p></li></ul><h4>3. Domain Context, Bounded Context</h4><p><strong>Bounded Contexts</strong>:</p><ol><li><p><strong>Observability Ingestion</strong> &#8211; Metrics, logs, traces, business events.</p></li><li><p><strong>Anomaly Detection</strong> &#8211; Statistical/ML models identifying deviations.</p></li><li><p><strong>Root Cause Analysis</strong> &#8211; Causal inference, topology-aware reasoning.</p></li><li><p><strong>Impact &amp; Blast Radius</strong> &#8211; Customer, financial, regulatory exposure calculation.</p></li><li><p><strong>Remediation</strong> &#8211; Safe action proposals and guarded auto-execution.</p></li><li><p><strong>Reporting &amp; Compliance</strong> &#8211; Timeline reconstruction, regulator formatting.</p></li></ol><p><strong>Context Map</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AoGV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0963d0d-1b76-41d0-80d1-0f8955008faa_2345x1520.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AoGV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0963d0d-1b76-41d0-80d1-0f8955008faa_2345x1520.png 424w, https://substackcdn.com/image/fetch/$s_!AoGV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0963d0d-1b76-41d0-80d1-0f8955008faa_2345x1520.png 848w, https://substackcdn.com/image/fetch/$s_!AoGV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0963d0d-1b76-41d0-80d1-0f8955008faa_2345x1520.png 1272w, https://substackcdn.com/image/fetch/$s_!AoGV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0963d0d-1b76-41d0-80d1-0f8955008faa_2345x1520.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AoGV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0963d0d-1b76-41d0-80d1-0f8955008faa_2345x1520.png" width="1456" height="944" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c0963d0d-1b76-41d0-80d1-0f8955008faa_2345x1520.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e0d48e58-ae7a-4515-96e1-2b5f86f52215_2345x1520.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:944,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:115784,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/182562817?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d48e58-ae7a-4515-96e1-2b5f86f52215_2345x1520.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!AoGV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0963d0d-1b76-41d0-80d1-0f8955008faa_2345x1520.png 424w, https://substackcdn.com/image/fetch/$s_!AoGV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0963d0d-1b76-41d0-80d1-0f8955008faa_2345x1520.png 848w, https://substackcdn.com/image/fetch/$s_!AoGV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0963d0d-1b76-41d0-80d1-0f8955008faa_2345x1520.png 1272w, https://substackcdn.com/image/fetch/$s_!AoGV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0963d0d-1b76-41d0-80d1-0f8955008faa_2345x1520.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/3raj2/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/be115684-bfa2-40dc-8488-f33db2871af7_1220x1014.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5e331afd-b0e8-40f0-9e79-314d988a5010_1220x1084.png&quot;,&quot;height&quot;:542,&quot;title&quot;:&quot;4. Functional Requirements&quot;,&quot;description&quot;:&quot;&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/3raj2/1/" width="730" height="542" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/Cd26i/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/63148fb4-b9e4-45c6-85d2-63f8b6684614_1220x876.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f79db969-61de-465c-a8f6-22fffa5e4bef_1220x946.png&quot;,&quot;height&quot;:471,&quot;title&quot;:&quot;5. Non-Functional Requirements&quot;,&quot;description&quot;:&quot;&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/Cd26i/1/" width="730" height="471" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><h4>6. Traceability Matrix</h4><p>F1 &#8594; Anomaly Detection Context</p><p>F2 &#8594; Root Cause Analysis Context</p><p>F3 &#8594; Impact &amp; Blast Radius Context</p><p>F4,F6,F7 &#8594; Remediation Context</p><p>F5 &#8594; Reporting &amp; Compliance Context</p><p>N1 &#8594; Streaming ingestion + edge ML</p><p>N3 &#8594; Multi-region active-active deployment</p><p>N4 &#8594; Deterministic reasoning chains + model versioning</p><p>N5 &#8594; Immutable event store</p><h4>7. Architectural Design Options</h4><p><strong>Option A &#8211; Monolithic AI Incident Platform</strong><br>Summary: Single large service hosting all capabilities.</p><ul><li><p>Pros: Simple deployment, low cross-service latency.</p></li><li><p>Cons: Hard to scale individual components, single point of failure risk, difficult to update models independently.</p></li><li><p>Cost: Low&#8211;Medium.</p></li><li><p>Operational complexity: Medium.</p></li></ul><p><strong>Option B &#8211; Microservices + Event-Driven Core (Recommended)</strong><br>Summary: Bounded-context-aligned services communicating via event bus; ML models served separately.</p><ul><li><p>Key components: Ingestion service &#8594; Kafka &#8594; Detection &#8594; RCA &#8594; Impact &#8594; Remediation &#8594; Reporting; separate model serving (SageMaker/KServe).</p></li><li><p>Scalability: Horizontal per context; event bus decouples.</p></li><li><p>Latency: Sub-second internal via gRPC + async events.</p></li><li><p>Consistency: Event sourcing for auditability.</p></li><li><p>Cost: Medium&#8211;High (managed Kafka, multiple DBs).</p></li><li><p>Operational complexity: High but manageable with good observability.</p></li></ul><p><strong>Option C &#8211; Serverless + Managed AI Services</strong><br>Summary: Heavy use of cloud-managed services (CloudWatch Anomalies, Bedrock/Gemini for RCA, Step Functions for orchestration).</p><ul><li><p>Pros: Fastest to build, minimal ops.</p></li><li><p>Cons: Less control over explainability, potential vendor lock-in, harder to meet strict banking audit requirements.</p></li><li><p>Cost: Variable, can spike.</p></li><li><p>Operational complexity: Low.</p></li></ul><h4>8. Recommended Option &amp; Reasoning Chain</h4><p><strong>Recommendation: Option B &#8211; Microservices + Event-Driven</strong></p><ol><li><p>Regulatory explainability (N4) demands full auditability of every AI decision &#8594; event sourcing and immutable logs are easiest in event-driven architecture.</p></li><li><p>Different throughput patterns: ingestion &amp; detection need massive scale; RCA &amp; reporting are bursty &#8594; independent horizontal scaling only possible with decoupled services.</p></li><li><p>Model evolution: anomaly &amp; RCA models will improve frequently &#8594; isolated deployment without redeploying entire monolith.</p></li><li><p>Banking availability requirement (N3) &#8594; multi-region event replication and per-service resilience.</p></li><li><p>Human-in-the-loop for remediation (F6) naturally fits saga/orchestration pattern across services.</p></li><li><p>Option C sacrifices too much control over data lineage and explainability for banking regulators.</p></li></ol><h4>9. System Design Diagram</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!y5YX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff057f4dc-a4b6-4f7c-b226-23b7de9d7835_2345x1520.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!y5YX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff057f4dc-a4b6-4f7c-b226-23b7de9d7835_2345x1520.png 424w, https://substackcdn.com/image/fetch/$s_!y5YX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff057f4dc-a4b6-4f7c-b226-23b7de9d7835_2345x1520.png 848w, https://substackcdn.com/image/fetch/$s_!y5YX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff057f4dc-a4b6-4f7c-b226-23b7de9d7835_2345x1520.png 1272w, https://substackcdn.com/image/fetch/$s_!y5YX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff057f4dc-a4b6-4f7c-b226-23b7de9d7835_2345x1520.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!y5YX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff057f4dc-a4b6-4f7c-b226-23b7de9d7835_2345x1520.png" width="1456" height="944" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f057f4dc-a4b6-4f7c-b226-23b7de9d7835_2345x1520.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0bfe9348-788c-4a2c-a397-665075ce00f0_2345x1520.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:944,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:183828,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/182562817?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bfe9348-788c-4a2c-a397-665075ce00f0_2345x1520.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!y5YX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff057f4dc-a4b6-4f7c-b226-23b7de9d7835_2345x1520.png 424w, https://substackcdn.com/image/fetch/$s_!y5YX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff057f4dc-a4b6-4f7c-b226-23b7de9d7835_2345x1520.png 848w, https://substackcdn.com/image/fetch/$s_!y5YX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff057f4dc-a4b6-4f7c-b226-23b7de9d7835_2345x1520.png 1272w, https://substackcdn.com/image/fetch/$s_!y5YX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff057f4dc-a4b6-4f7c-b226-23b7de9d7835_2345x1520.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>10. Sequence Diagram &#8211; Critical Incident Flow</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pR96!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddce4375-407b-4cc6-a6d0-4f9c0e945101_2345x1520.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pR96!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddce4375-407b-4cc6-a6d0-4f9c0e945101_2345x1520.png 424w, https://substackcdn.com/image/fetch/$s_!pR96!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddce4375-407b-4cc6-a6d0-4f9c0e945101_2345x1520.png 848w, https://substackcdn.com/image/fetch/$s_!pR96!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddce4375-407b-4cc6-a6d0-4f9c0e945101_2345x1520.png 1272w, https://substackcdn.com/image/fetch/$s_!pR96!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddce4375-407b-4cc6-a6d0-4f9c0e945101_2345x1520.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pR96!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddce4375-407b-4cc6-a6d0-4f9c0e945101_2345x1520.png" width="1456" height="944" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ddce4375-407b-4cc6-a6d0-4f9c0e945101_2345x1520.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0ca3bb46-a3b0-411f-8419-3c7112065276_2345x1520.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:944,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:140534,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/182562817?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ca3bb46-a3b0-411f-8419-3c7112065276_2345x1520.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pR96!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddce4375-407b-4cc6-a6d0-4f9c0e945101_2345x1520.png 424w, https://substackcdn.com/image/fetch/$s_!pR96!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddce4375-407b-4cc6-a6d0-4f9c0e945101_2345x1520.png 848w, https://substackcdn.com/image/fetch/$s_!pR96!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddce4375-407b-4cc6-a6d0-4f9c0e945101_2345x1520.png 1272w, https://substackcdn.com/image/fetch/$s_!pR96!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddce4375-407b-4cc6-a6d0-4f9c0e945101_2345x1520.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>11. Data Management</h4><ul><li><p>Event store: Apache Kafka + tiered storage &#8594; immutable append-only topics (7-year retention via object storage).</p></li><li><p>Topology &amp; config: Graph DB (Neo4j or Amazon Neptune) for service dependencies.</p></li><li><p>ML features: Feature store (Feast or equivalent) for training/offline evaluation.</p></li><li><p>Reports: Signed PDF/HTML in immutable bucket with WORM policies.</p></li><li><p>Transactional model: Event sourcing for incident timeline; no distributed transactions needed (saga pattern for remediation coordination).</p></li></ul><h4>12. Security &amp; Compliance</h4><ul><li><p>Zero-trust network; all services authenticate via mTLS.</p></li><li><p>PII/PCI data masked before entering AI system.</p></li><li><p>All model inputs/outputs logged immutably.</p></li><li><p>Human approval required for any action affecting customer funds or regulatory reporting.</p></li><li><p>Regular red-team exercises on AI decision path.</p></li></ul><h4>13. Observability &amp; SLOs</h4><ul><li><p>SLOs: Anomaly detection latency p95 &lt; 60s; Hypothesis accuracy &gt;85%; System availability 99.99%.</p></li><li><p>Metrics: Anomaly rate, false positive rate, MTTD, MTTR, remediation approval time.</p></li><li><p>Tracing: OpenTelemetry across all services + correlation ID from anomaly through report.</p></li><li><p>Alerting: Critical anomalies &#8594; pager; hypothesis confidence &lt;70% &#8594; escalate.</p></li></ul><h4>14. Roadmap (6 months to production)</h4><ul><li><p>Month 0&#8211;1: MVP anomaly detection on existing telemetry + basic alerting.</p></li><li><p>Month 2&#8211;3: Add RCA with topology-aware LLM prompting; human review loop.</p></li><li><p>Month 4: Blast radius + remediation proposal engine.</p></li><li><p>Month 5: Auto-report generation + immutable storage integration.</p></li><li><p>Month 6: Auto-execution of pre-approved runbooks + full regression testing.</p></li></ul><p>This design shifts banking incident response from human-centric firefighting to AI-augmented, regulator-friendly precision&#8212;reducing MTTR, improving accuracy, and producing audit-ready artifacts by default.</p><div><hr></div><h4>Want to follow the journey?</h4><p>I&#8217;m sharing the process of designing agentic financial systems architecture, engineering, AI automation and building tools with Crafted AI Framework</p><p>If you want to collaborate, test, or co-build the next generation of fintech, reach out.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QemM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QemM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QemM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg" width="604" height="223.57226792009402" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:315,&quot;width&quot;:851,&quot;resizeWidth&quot;:604,&quot;bytes&quot;:15329,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/178341924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!QemM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QemM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Contact with us at Crafted <a href="http://we-crafted.com/">we-crafted.com</a></strong></p><ul><li><p>Discover how we turn complex ideas into working AI products &#8212; visit we-crafted.com and start a conversation with our team.</p></li><li><p>See what we&#8217;re building next. Explore case studies and reach out at we-crafted.com.</p></li><li><p>Have a product idea worth accelerating? Let&#8217;s build it together</p></li><li><p>From prototype to production-grade AI systems &#8212; learn more and get in touch</p></li><li><p>Looking for enterprise-grade AI agents or RAG infrastructure? Visit we-crafted.com</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Designing Payment Reversals & Dispute Orchestration System for Banking]]></title><description><![CDATA[In the payments ecosystem, reversals and disputes arise when cardholders challenge transactions (e.g., due to fraud, non-delivery, or dissatisfaction) or when senders recall instant payments (e.g., due to errors or detected fraud).]]></description><link>https://seyhunak.substack.com/p/designing-payment-reversals-and-dispute</link><guid isPermaLink="false">https://seyhunak.substack.com/p/designing-payment-reversals-and-dispute</guid><dc:creator><![CDATA[Seyhun Akyurek]]></dc:creator><pubDate>Tue, 23 Dec 2025 10:12:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Rjtb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F639ae9fd-5690-427b-b21f-6395d1bfeabf_2203x1612.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the payments ecosystem, reversals and disputes arise when cardholders challenge transactions (e.g., due to fraud, non-delivery, or dissatisfaction) or when senders recall instant payments (e.g., due to errors or detected fraud). Merchants receive notifications from acquirers or schemes, must rapidly gather compelling evidence (order records, proofs of delivery, customer communications), and respond within strict, scheme-specific deadlines to avoid automatic liability&#8212;Visa often imposes 9-20 days for representment (shorter in US/Canada as of 2025), Mastercard allows up to 45 days, while SEPA Instant recalls permit only one attempt per transaction with tight post-execution windows. </p><p>Automation of evidence collection, SLA timer enforcement, and scheme-adapter orchestration is critical to maximize win rates (&gt;60% target on fought cases), minimize losses, and comply with evolving rules (e.g., Visa VAMP monitoring, Mastercard ECM programs).</p><p>This architecture focuses on merchant-side orchestration of card disputes (Visa/Mastercard), chargeback automation, and instant payment recalls, enabling timely, evidence-based responses across heterogeneous scheme flows.</p><blockquote><p><em>Before we start: Please note that, while the architecture, benchmarks, and scale-up phases are grounded in common production patterns, the numbers here are simulated for educational purposes and may not reflect every real-world banking environment. The goal is to demonstrate how design layer could scale toward modern banking platform principles, not to claim a one-size-fits-all blueprint.</em></p></blockquote><h4>Domain Context</h4><p>A customer initiates a payment reversal by contacting their bank to dispute a card transaction (e.g., due to fraud, non-receipt of goods, or unauthorized charge), or requests a recall for an instant payment mistakenly sent. The issuing bank reviews the claim and notifies the merchant&#8217;s acquirer, pulling funds back if valid. The merchant receives a dispute notification, gathers evidence (order details, delivery proofs, communications), and decides whether to accept liability (refund) or fight with representment. For card disputes, the scheme (Visa/Mastercard) may involve pre-arbitration or arbitration if contested further. For instant payment recalls (e.g., SEPA Instant), the originator bank sends a recall request within tight windows for errors or fraud, and the beneficiary bank responds. External partners like fulfillment providers supply tracking data, while internal teams orchestrate timers to meet strict SLAs, automate evidence, and minimize financial loss.</p><h4>Key Events</h4><p>Key events: DisputeReceived, EvidenceGathered, TimerStarted, RepresentmentSubmitted, PreArbitrationFiled, DisputeWon/Lost, RecallApproved/Rejected.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Rjtb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F639ae9fd-5690-427b-b21f-6395d1bfeabf_2203x1612.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Rjtb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F639ae9fd-5690-427b-b21f-6395d1bfeabf_2203x1612.png 424w, https://substackcdn.com/image/fetch/$s_!Rjtb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F639ae9fd-5690-427b-b21f-6395d1bfeabf_2203x1612.png 848w, https://substackcdn.com/image/fetch/$s_!Rjtb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F639ae9fd-5690-427b-b21f-6395d1bfeabf_2203x1612.png 1272w, https://substackcdn.com/image/fetch/$s_!Rjtb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F639ae9fd-5690-427b-b21f-6395d1bfeabf_2203x1612.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Rjtb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F639ae9fd-5690-427b-b21f-6395d1bfeabf_2203x1612.png" width="1456" height="1065" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/639ae9fd-5690-427b-b21f-6395d1bfeabf_2203x1612.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fd589cb3-daae-4939-95f5-678eca41debd_2203x1612.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1065,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:135540,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/182404255?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd589cb3-daae-4939-95f5-678eca41debd_2203x1612.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Rjtb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F639ae9fd-5690-427b-b21f-6395d1bfeabf_2203x1612.png 424w, https://substackcdn.com/image/fetch/$s_!Rjtb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F639ae9fd-5690-427b-b21f-6395d1bfeabf_2203x1612.png 848w, https://substackcdn.com/image/fetch/$s_!Rjtb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F639ae9fd-5690-427b-b21f-6395d1bfeabf_2203x1612.png 1272w, https://substackcdn.com/image/fetch/$s_!Rjtb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F639ae9fd-5690-427b-b21f-6395d1bfeabf_2203x1612.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>3. Domain-Driven Design (Contexts, Aggregates, Context Map)</h4><p>Bounded Contexts: Card Disputes (Visa/Mastercard-specific), Instant Payment Recalls (IPP/SEPA-like), Evidence Management, Workflow Orchestration.</p><ul><li><p><strong>Card Disputes Context</strong>: Aggregate Root - DisputeCase (invariants: SLA compliance, valid reason code). Entities: Transaction, ReasonCode. Outgoing: RepresentmentSubmitted event.</p></li><li><p><strong>Instant Recalls Context</strong>: Aggregate Root - RecallRequest (invariants: within time window, single recall per tx). Entities: OriginalPayment.</p></li><li><p><strong>Evidence Management Context</strong>: Value Objects: ProofDocument, DeliveryTracking.</p></li><li><p><strong>Orchestration Context</strong>: Services for saga coordination across schemes.</p></li></ul><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!05ou!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04c24905-5f14-4e43-8141-50cc8ddea5bd_2203x1612.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!05ou!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04c24905-5f14-4e43-8141-50cc8ddea5bd_2203x1612.png 424w, https://substackcdn.com/image/fetch/$s_!05ou!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04c24905-5f14-4e43-8141-50cc8ddea5bd_2203x1612.png 848w, https://substackcdn.com/image/fetch/$s_!05ou!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04c24905-5f14-4e43-8141-50cc8ddea5bd_2203x1612.png 1272w, https://substackcdn.com/image/fetch/$s_!05ou!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04c24905-5f14-4e43-8141-50cc8ddea5bd_2203x1612.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!05ou!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04c24905-5f14-4e43-8141-50cc8ddea5bd_2203x1612.png" width="1456" height="1065" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/04c24905-5f14-4e43-8141-50cc8ddea5bd_2203x1612.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c2341731-ad87-430f-a37a-8fb5f2357f4f_2203x1612.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1065,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:179729,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/182404255?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2341731-ad87-430f-a37a-8fb5f2357f4f_2203x1612.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!05ou!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04c24905-5f14-4e43-8141-50cc8ddea5bd_2203x1612.png 424w, https://substackcdn.com/image/fetch/$s_!05ou!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04c24905-5f14-4e43-8141-50cc8ddea5bd_2203x1612.png 848w, https://substackcdn.com/image/fetch/$s_!05ou!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04c24905-5f14-4e43-8141-50cc8ddea5bd_2203x1612.png 1272w, https://substackcdn.com/image/fetch/$s_!05ou!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04c24905-5f14-4e43-8141-50cc8ddea5bd_2203x1612.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Relationships: Orchestration downstream of Inbound; Card/Recalls upstream of Evidence; Published Language for scheme APIs.</p><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/0ZQ7d/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4bdf37b7-c213-4fd3-ace0-7712f14d7f34_1220x908.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e036f09e-7ce2-4838-9cf9-fea33dc189f9_1220x978.png&quot;,&quot;height&quot;:488,&quot;title&quot;:&quot;4. Functional Requirements&quot;,&quot;description&quot;:&quot;&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/0ZQ7d/1/" width="730" height="488" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><div id="datawrapper-iframe" class="datawrapper-wrap outer" data-attrs="{&quot;url&quot;:&quot;https://datawrapper.dwcdn.net/FASD7/1/&quot;,&quot;thumbnail_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/52f4dfcb-242a-4aa5-8572-eb2fcec67c81_1220x770.png&quot;,&quot;thumbnail_url_full&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/88b7fb3d-3b9d-4893-833f-ede136fa4b1f_1220x840.png&quot;,&quot;height&quot;:417,&quot;title&quot;:&quot;5. Non-Functional Requirements&quot;,&quot;description&quot;:&quot;&quot;}" data-component-name="DatawrapperToDOM"><iframe id="iframe-datawrapper" class="datawrapper-iframe" src="https://datawrapper.dwcdn.net/FASD7/1/" width="730" height="417" frameborder="0" scrolling="no"></iframe><script type="text/javascript">!function(){"use strict";window.addEventListener("message",(function(e){if(void 0!==e.data["datawrapper-height"]){var t=document.querySelectorAll("iframe");for(var a in e.data["datawrapper-height"])for(var r=0;r<t.length;r++){if(t[r].contentWindow===e.source)t[r].style.height=e.data["datawrapper-height"][a]+"px"}}}))}();</script></div><h4>Traceability Matrix</h4><p>F1 &#8594; Inbound Gateway + Dispute Service<br>F2 &#8594; Evidence Collector Service<br>F3/F4 &#8594; Workflow Orchestrator (saga/timers)<br>F5 &#8594; Scheme Integration Services<br>F6 &#8594; Recall Handler<br>N1/N3 &#8594; Async event bus + autoscaling<br>N2 &#8594; Idempotency + retries<br>N4 &#8594; Isolated vaults/tokens<br>N5 &#8594; Distributed tracing + metrics</p><h4>Assumptions (max 6)</h4><ol><li><p>System ingests from acquirers/PSPs; no direct scheme connectivity.</p></li><li><p>Peak volume ~5-10k disputes/month; low for recalls.</p></li><li><p>Evidence sources accessible via APIs (orders DB, logistics partners).</p></li><li><p>Merchant policy: fight winnable disputes; auto-accept low-value.</p></li><li><p>Managed cloud services allowed (e.g., AWS SQS/Kinesis for events).</p></li><li><p>Focus on merchant-side orchestration; not issuer tools.</p></li></ol><h4>Important metrics &amp; constraints</h4><ol><li><p>Response deadline compliance: 100% submissions on-time (Visa 9-18 days US/other, MC 45 days).</p></li><li><p>Win rate: &gt;60% on fought disputes.</p></li><li><p>Processing latency: End-to-end orchestration &lt;1 min for automation.</p></li><li><p>Chargeback ratio impact: Minimize via prevention integration.</p></li><li><p>Cost: Low ops overhead via automation.</p></li></ol><h4>6. Architectural Design Options</h4><p><strong>Option A &#8212; Monolithic Rules Engine</strong><br>Summary: Single app with hardcoded scheme flows, relational DB for cases.</p><ul><li><p>Key components: Monolith API, Postgres DB, background workers for timers/evidence.</p></li><li><p>Scalability: Vertical + read replicas; limited horizontal.</p></li><li><p>Latency &amp; consistency: Strong consistency; low latency internal calls.</p></li><li><p>Cost: Low (single deploy).</p></li><li><p>Operational complexity: Low initially.</p></li><li><p>Failure modes: Single point; mitigate with HA DB.</p></li></ul><p><strong>Option B &#8212; Event-Driven Microservices (Recommended)</strong><br>Summary: Bounded contexts as services, event bus for orchestration, polyglot persistence.</p><ul><li><p>Key components: Dispute Ingest Service, Workflow Orchestrator (saga), Scheme Adapters (Visa/MC/IPP), Evidence Service, Timer Service (e.g., Quartz), Event Bus (Kafka).</p></li><li><p>Scalability: Highly horizontal per context.</p></li><li><p>Latency &amp; consistency: Eventual for reads; strong via saga compensation for critical steps.</p></li><li><p>Cost: Medium (broker + multiple services).</p></li><li><p>Operational complexity: Medium (tracing essential).</p></li><li><p>Failure modes: Event lag/duplicates; mitigate idempotency, schema registry.</p></li></ul><p><strong>Option C &#8212; Serverless Workflow</strong><br>Summary: FaaS for handlers, managed queues, step functions for orchestration.</p><ul><li><p>Key components: Lambda triggers, Step Functions/Durable Functions, DynamoDB/Table Storage, SQS.</p></li><li><p>Scalability: Excellent for bursts.</p></li><li><p>Latency &amp; consistency: Eventual; cold starts possible.</p></li><li><p>Cost: Low baseline, pay-per-use.</p></li><li><p>Operational complexity: Low ops, harder distributed debug.</p></li><li><p>Failure modes: Throttling/cold starts; mitigate provisioned concurrency.</p></li></ul><h4>7. Recommended Option with Reasoning Chain</h4><p><strong>Recommendation: Option B &#8212; Event-Driven Microservices.</strong></p><ol><li><p>Scheme-specific flows require flexibility: Separate adapters per scheme (Visa VCR vs MC cycles vs IPP recalls) allow independent updates without monolith redeploy (vs Option A rigidity).</p></li><li><p>SLA timers &amp; automation: Event-driven saga orchestrator naturally handles long-running processes, compensation (e.g., auto-refund on timer expiry), better than monolithic workers or serverless cold starts.</p></li><li><p>Evidence collection scale: Decoupled Evidence Service can integrate multiple sources asynchronously, scaling independently from ingest spikes.</p></li><li><p>Operational maturity: Medium complexity acceptable for reliability needs (idempotency, tracing); managed bus reduces burden vs full serverless vendor lock/debug issues (Option C).</p></li><li><p>Future-proof: Easy add new schemes/contexts; ties to high win-rate via automated, consistent evidence/representment. Conclusion: Balances strict timelines, scheme variance, and automation while controlling costs/ops.</p></li></ol><h4>8. System Design &amp; Sequence Diagrams</h4><p><strong>System Design Diagram</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gavS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08f30573-c67e-4221-ba50-caf97004c730_2203x1612.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gavS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08f30573-c67e-4221-ba50-caf97004c730_2203x1612.png 424w, https://substackcdn.com/image/fetch/$s_!gavS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08f30573-c67e-4221-ba50-caf97004c730_2203x1612.png 848w, https://substackcdn.com/image/fetch/$s_!gavS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08f30573-c67e-4221-ba50-caf97004c730_2203x1612.png 1272w, https://substackcdn.com/image/fetch/$s_!gavS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08f30573-c67e-4221-ba50-caf97004c730_2203x1612.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gavS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08f30573-c67e-4221-ba50-caf97004c730_2203x1612.png" width="1456" height="1065" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/08f30573-c67e-4221-ba50-caf97004c730_2203x1612.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5a5afb33-bf4b-41ec-94c8-56c0951ecf7c_2203x1612.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1065,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:128345,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/182404255?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a5afb33-bf4b-41ec-94c8-56c0951ecf7c_2203x1612.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gavS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08f30573-c67e-4221-ba50-caf97004c730_2203x1612.png 424w, https://substackcdn.com/image/fetch/$s_!gavS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08f30573-c67e-4221-ba50-caf97004c730_2203x1612.png 848w, https://substackcdn.com/image/fetch/$s_!gavS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08f30573-c67e-4221-ba50-caf97004c730_2203x1612.png 1272w, https://substackcdn.com/image/fetch/$s_!gavS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08f30573-c67e-4221-ba50-caf97004c730_2203x1612.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p><strong>Sequence Diagram (Card Dispute Flow)</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0Jgt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd86b83af-e842-4a4b-b4ab-650b22b4a94d_2203x1612.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0Jgt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd86b83af-e842-4a4b-b4ab-650b22b4a94d_2203x1612.png 424w, https://substackcdn.com/image/fetch/$s_!0Jgt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd86b83af-e842-4a4b-b4ab-650b22b4a94d_2203x1612.png 848w, https://substackcdn.com/image/fetch/$s_!0Jgt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd86b83af-e842-4a4b-b4ab-650b22b4a94d_2203x1612.png 1272w, https://substackcdn.com/image/fetch/$s_!0Jgt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd86b83af-e842-4a4b-b4ab-650b22b4a94d_2203x1612.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0Jgt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd86b83af-e842-4a4b-b4ab-650b22b4a94d_2203x1612.png" width="1456" height="1065" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d86b83af-e842-4a4b-b4ab-650b22b4a94d_2203x1612.png&quot;,&quot;srcNoWatermark&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1fcf0218-976e-4ec4-a8d0-34acf45bb094_2203x1612.png&quot;,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1065,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:163775,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/182404255?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fcf0218-976e-4ec4-a8d0-34acf45bb094_2203x1612.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0Jgt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd86b83af-e842-4a4b-b4ab-650b22b4a94d_2203x1612.png 424w, https://substackcdn.com/image/fetch/$s_!0Jgt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd86b83af-e842-4a4b-b4ab-650b22b4a94d_2203x1612.png 848w, https://substackcdn.com/image/fetch/$s_!0Jgt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd86b83af-e842-4a4b-b4ab-650b22b4a94d_2203x1612.png 1272w, https://substackcdn.com/image/fetch/$s_!0Jgt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd86b83af-e842-4a4b-b4ab-650b22b4a94d_2203x1612.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Annotate: F3/F4 on Orchestrator/Timer; N1 on async paths.</p><h4>9. Data Management</h4><ul><li><p>Schema: Event sourcing for DisputeCase aggregate (immutable audit); relational (Postgres) for read models; document store for evidence blobs.</p></li><li><p>Sharding/Partitioning: By merchant ID or scheme.</p></li><li><p>Caching: Redis for active cases/timers.</p></li><li><p>Backup/Restore: Daily snapshots + PITR; event log retention 13 months (fraud recall).</p></li><li><p>Transactional: Saga pattern with compensation (no 2PC); local ACID per service.</p></li><li><p>Residency: PII/PCI data regional (e.g., EU for GDPR).</p></li></ul><h4>10. Security &amp; Compliance</h4><ul><li><p>PCI isolation: Tokenize/no raw card storage; evidence service scoped minimally.</p></li><li><p>Encryption: TLS everywhere; at-rest for DBs/blobs.</p></li><li><p>Access: RBAC + least privilege; audit logs for submissions.</p></li><li><p>Compliance: Auto-enforce scheme rules; logging for disputes.</p></li></ul><h4>11. Observability &amp; SLOs</h4><ul><li><p>SLOs: 100% on-time submissions; p95 orchestration &lt;2 min; dispute win rate tracked.</p></li><li><p>Metrics: Dispute volume, timer breaches, win/loss per scheme, evidence gather time.</p></li><li><p>Tracing: OpenTelemetry across services/bus.</p></li><li><p>Logs: Structured with case ID; central aggregator.</p></li><li><p>Alerting: Timer &lt;24h remaining, submission failure, ratio thresholds.</p></li></ul><h4>12. Roadmap &amp; Milestones</h4><ul><li><p>Sprint 0 (1-2 weeks): Spike scheme integrations + evidence prototypes.</p></li><li><p>Sprint 1-2: MVA - Ingest + basic orchestration for one scheme (e.g., Visa).</p></li><li><p>Sprint 3-4: Add MC/IPP adapters, evidence automation, timers.</p></li><li><p>Sprint 5: Full saga, analytics, hardening/tests.</p></li><li><p>Ongoing: Prevention integrations (alerts), multi-merchant support.</p></li></ul><div><hr></div><h4>Want to follow the journey?</h4><p>I&#8217;m sharing the process of designing agentic financial systems architecture, engineering, AI automation and building tools with Crafted AI Framework</p><p>If you want to collaborate, test, or co-build the next generation of fintech, reach out.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QemM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QemM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QemM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg" width="604" height="223.57226792009402" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:315,&quot;width&quot;:851,&quot;resizeWidth&quot;:604,&quot;bytes&quot;:15329,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://seyhunak.substack.com/i/178341924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!QemM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QemM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QemM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd5ba760-a648-4a80-868c-7cb1d19afaa1_851x315.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Contact with us at Crafted <a href="http://we-crafted.com/">we-crafted.com</a></strong></p><ul><li><p>Discover how we turn complex ideas into working AI products &#8212; visit we-crafted.com and start a conversation with our team.</p></li><li><p>See what we&#8217;re building next. Explore case studies and reach out at we-crafted.com.</p></li><li><p>Have a product idea worth accelerating? Let&#8217;s build it together</p></li><li><p>From prototype to production-grade AI systems &#8212; learn more and get in touch</p></li><li><p>Looking for enterprise-grade AI agents or RAG infrastructure? Visit we-crafted.com</p></li></ul>]]></content:encoded></item></channel></rss>