<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[AI Smart - Medium]]></title>
        <description><![CDATA[I learn by writing. Contains 100 Days or more of Generative &amp; Agentic AI, News, Prototypes and more…. - Medium]]></description>
        <link>https://medium.com/youme-technology?source=rss----9f2a2586502---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>AI Smart - Medium</title>
            <link>https://medium.com/youme-technology?source=rss----9f2a2586502---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 22:07:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/youme-technology" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Enterprise Scale Agentic Systems Illustrated — Part 1–2 Using LangGraph : The Fundamentals — A…]]></title>
            <link>https://medium.com/youme-technology/enterprise-scale-agentic-systems-illustrated-part-1-2-using-langgraph-the-fundamentals-a-79ab538d5ef5?source=rss----9f2a2586502---4</link>
            <guid isPermaLink="false">https://medium.com/p/79ab538d5ef5</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[langgraph]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[LAKSHMI VENKATESH]]></dc:creator>
            <pubDate>Fri, 05 Jun 2026 07:57:42 GMT</pubDate>
            <atom:updated>2026-06-05T07:57:44.245Z</atom:updated>
            <content:encoded><![CDATA[<h3>Enterprise Scale Agentic Systems Illustrated — Part 1–2 Using LangGraph : The Fundamentals — A, Blueprint</h3><h4>Using LangGraph — From Prompts to Control Planes: Why Enterprise Agents Run on Graphs</h4><h4>LangGraph Fundamentals: A Minimalist Implementation Guide</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0wOXXYiXUofJvXjC4MtE1Q.png" /></figure><p><strong>1. Foundation: Setup and State Initialization — State Management and Graph Initialization</strong></p><p>In the architecture of modern Generative AI, moving beyond linear scripting is a prerequisite for building production-grade agents. The strategic pivot to LangGraph involves defining a central <strong>State Schema</strong> and utilizing a <strong>Graph Builder</strong> to manage the system’s lifecycle. Unlike rigid scripts, this graph-based approach handles cycles and state persistence naturally, using “previous messages” to establish the foundation for robust conversation memory. This structured framework ensures that an agent’s journey is not just a sequence of steps, but a managed state machine capable of complex reasoning.</p><p>To initialize a LangGraph project, an architect must focus on three core technical components:</p><ul><li><strong>The State Schema:</strong> Typically a dictionary-based TypedDict or class that tracks messages and variables across the entire lifecycle.</li><li><strong>The StateGraph Builder:</strong> The primary orchestrator used to register logic and define the execution topology.</li><li><strong>Structural Dependencies:</strong> Essential imports (e.g., StateGraph, END, START) that provide the necessary decorators and types for graph construction.</li></ul><p>The boundaries of the execution flow are defined by two critical structural parameters:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PNSi9FlI__oYlsB5HvWhtQ.png" /></figure><p>Once these boundaries are established, the developer can begin registering the discrete units of work that will populate the graph.</p><p><strong>2. Structural Units: Setup and State Initialization — Defining and Adding Nodes</strong></p><p>Nodes are the discrete functional units of the graph, representing the modular logic of the AI system. By isolating specific tasks — such as updating a location or processing a prompt — into independent nodes, developers achieve a “separation of concerns” that simplifies debugging and allows for granular testing of each architectural component.</p><p>The process of populating the graph with these units follows a rigorous three-step protocol:</p><ol><li><strong>Define the Logic:</strong> Create a Python function that accepts the current state and returns a dictionary. For example, a function might return {&quot;location&quot;: &quot;starting journey&quot;} to update the state.</li><li><strong>Register the Node:</strong> Use the Builder to assign the function to the graph, providing a unique identifier such as <strong>“Node Two”</strong>.</li><li><strong>Map the Entry Point:</strong> Explicitly connect the <strong>START</strong> parameter to the first functional node to initiate the data flow.</li></ol><p>Assigning unique identifiers like “Node Two” allows the orchestrator to manage non-linear jumps and complex transitions. This modularity ensures that the internal dictionary updates of one node do not cause side effects in another, maintaining the integrity of the overall AI architecture.</p><p><strong>3. Orchestration: Building the Graph Logic — Edge Logic and Graph Compilation</strong></p><p>Edges represent the “connective tissue” of the system, transforming isolated nodes into a functional, goal-oriented graph. Without precise edge logic, nodes are merely static fragments. Orchestration determines how the state traverses the graph, moving from the initial “starting journey” toward a final resolution.</p><p>Architects manage this flow through two primary mechanisms:</p><ul><li><strong>Sequential Edges:</strong> These link nodes in a fixed order, such as moving directly from the “Start” node to a processing node.</li><li><strong>Conditional Logic Gates:</strong> These use decision-based paths — often implemented via a “list of strings” or specific logic imports — to evaluate the current state and decide which path leads to the <strong>Final Destination</strong>.</li><li><strong>Graph Compilation:</strong> The “Compile” step is the transition from a design-time blueprint to an executable object. This method validates the graph’s integrity and prepares it for programmatic invocation.</li></ul><p>With the graph compiled into a functional object, the system is ready to be tested against real-world inputs and visualized for architectural verification.</p><p><strong>4.Finalization &amp; Execution: Invocation and Visualization</strong></p><p>The final phase of development involves the programmatic execution of the graph. The ability to “invoke” the graph allows developers to observe the state schema as it evolves across different logic gates, providing a transparent view of the agent’s decision-making process.</p><p><strong>The Invoke Method</strong></p><p>The execution is triggered by passing an initial dictionary schema into the system. For instance, calling graph.invoke({&quot;location&quot;: &quot;starting journey&quot;}) provides the starting value that the nodes will then process and update as the state traverses the topology.</p><p><strong>Visual Confirmation</strong></p><p>In modern AI development, <strong>Flow Visualization</strong> is a requirement rather than a luxury. By rendering the graph, developers can verify the logic path from the “Depart” value through various nodes, ensuring there are no orphaned nodes or infinite loops that could compromise the agent’s reliability.</p><p><strong>Output Analysis</strong></p><p>A successful execution is confirmed through the final state dictionary. By analyzing how keys like “location” were updated or how “previous messages” were appended, architects can verify that the journey from the starting input to the final node was executed according to the design specifications.</p><p>This minimalist implementation strategy maximizes developer velocity by focusing on the core mechanics of state and flow. By adhering to these graph fundamentals, developers can build GenAI applications that are both architecturally sound and easily extensible.</p><h4><strong>The Blueprint for Agentic AI: A Comprehensive Guide to LangGraph and Intelligent Systems</strong></h4><p><strong>1. The Strategic Shift: From Generative to Agentic AI</strong></p><p>Since the 2022 inflection point marked by the release of ChatGPT, computer science has been dominated by the capabilities of large language models (LLMs). However, we have reached a plateau in the utility of standalone Generative AI. While stateless probabilistic outputs were sufficient for early adoption, the industry is now undergoing a paradigm shift in system architecture toward “Agentic AI.” This trajectory represents a move from models that merely predict the next token to systems that reason, utilize tools, and execute autonomous multi-step workflows. Understanding this shift is the difference between building a chatbot and architecting an intelligent system.</p><p>The transition to Agentic AI is fueled by three primary market catalysts and technical enablers:</p><ul><li><strong>Strategic Timing</strong>: We have reached an optimal maturity phase. The infrastructure surrounding Generative AI has stabilized sufficiently to support reliable, autonomous agents, and global enterprise leadership is now prioritizing agentic logic over simple prompt-response interfaces.</li><li><strong>Industry Demand</strong>: There is a critical shortage of architects who can build beyond the prompt. Organizations are no longer seeking “AI wrappers”; they demand production-grade systems capable of solving complex, non-linear problems with minimal human intervention.</li><li><strong>Technological Readiness</strong>: The natural progression from Deep Learning to Generative AI has culminated in a level of collective expertise where the integration of these models into comprehensive, cyclical frameworks is the only logical next step for high-value engineering.</li></ul><p>Mastering Agentic AI today secures a professional’s position in a high-value category for the next five years. By moving from “what” a model says to “how” a system acts, architects can deliver unprecedented value. This necessitates a deep dive into the conceptual “what” and the technical “how” of agentic systems.</p><p><strong>2. Core Definitions and Foundations</strong></p><p>In a field characterized by rapid evolution and “hype cycles,” clear conceptual definitions are a prerequisite for technical rigor. Without a precise engineering vocabulary, implementation becomes a series of unstable experiments. As a curriculum designer, I emphasize that these definitions are not mere semantics — they dictate the underlying architecture and control flow of your system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PSOyw-MpWZwdqmUGBPd3aA.png" /></figure><p>While these definitions provide the strategic map, the execution of such complex logic requires a specialized framework capable of managing non-linear state.</p><p><strong>3. The LangGraph Framework: Fundamental Architecture</strong></p><p>LangGraph serves as the core engine for modern agentic systems, providing the structural integrity required for robust, non-linear workflows. Unlike standard LangChain “chains,” which are essentially Directed Acyclic Graphs (DAGs) limited to linear execution, LangGraph enables the creation of state machines. This is essential for agents that must pivot, retry, or loop based on environmental feedback.</p><p>A graph-based AI system is composed of five foundational architectural components:</p><ol><li><strong>Nodes</strong>: The discrete functional units or “workers” that execute specific code or LLM calls.</li><li><strong>Edges</strong>: The pathways of logic defining the valid transitions between nodes.</li><li><strong>State (Shared State Schema)</strong>: The central mechanism for context retention. LangGraph utilizes a shared schema that all nodes can read from and write to, ensuring a “single source of truth” throughout the agent’s lifecycle.</li><li><strong>Conditional Edges</strong>: Decision-making junctions that route the control flow based on the current state or model output, providing the system with “branching” intelligence.</li><li><strong>Loops</strong>: The iterative pathways that allow an agent to revisit nodes, a critical feature for error recovery and self-correction.</li></ol><p><strong>The “So What?” of Graph Architecture:</strong> The architectural superiority of cyclical graphs over linear chains lies in their ability to handle “AI Workflows” rather than just “AI Steps.” A linear chain is fragile; if a step fails, the pipeline collapses. A graph-based system introduces <strong>determinism</strong> into probabilistic systems, allowing the architect to define recovery loops and reflection cycles that ensure the agent reaches its goal.</p><p><strong>4. Advanced Agentic Design Patterns and Persistence</strong></p><p>To bridge the “Production Gap,” an agent must move beyond basic logic and incorporate industry-grade features. Reliability in a commercial environment is a function of persistence, safety, and observability.</p><p>LangGraph provides advanced capabilities that transform a prototype into a professional-grade asset:</p><ol><li><strong>Persistence &amp; Memory</strong>: This layer ensures that agents can maintain state across multiple sessions. Without a persistence layer, an agent cannot handle long-running tasks or retain context in a multi-user environment.</li><li><strong>Human-in-the-Loop (HITL)</strong>: This involves the strategic implementation of “Break Points” where the agent pauses for human approval or intervention, which is a non-negotiable requirement for high-stakes enterprise deployments.</li><li><strong>Time Travel</strong>: An advanced debugging feature that allows architects to revert the system to a previous state, modify variables, and re-run the execution to analyze different outcomes.</li></ol><p>These features enable the implementation of sophisticated <strong>Agentic Design Patterns</strong>:</p><ul><li><strong>ReAct</strong>: A reasoning-acting cycle where the agent iterates between a “thought” node and a “tool-execution” node.</li><li><strong>Reflection</strong>: A pattern where a “critic” node reviews the output of a “generator” node to improve quality iteratively.</li><li><strong>Self-Ask</strong>: A decomposition pattern where the agent breaks complex queries into simpler sub-tasks to avoid logic errors.</li><li><strong>Multi-Agent Systems</strong>: The orchestration of specialized agents (e.g., a “researcher” and a “writer”) working in a coordinated graph.</li></ul><p>These patterns are increasingly being applied to the retrieval layer, leading to the emergence of Agentic RAG.</p><p><strong>5. Evolution of Retrieval: Transitioning to Agentic RAG</strong></p><p>Standard Retrieval-Augmented Generation (RAG) often fails when faced with ambiguous queries or low-quality source data. Agentic RAG is a hybrid architecture that merges agentic reasoning with retrieval pipelines to add a layer of “Agency” to data sourcing.</p><p>Two critical architectures in this space include:</p><ul><li><strong>Corrective RAG (CRAG)</strong>: Acts as a <strong>retrieval quality gatekeeper</strong>. It evaluates the relevance of retrieved documents and, if they are found wanting, triggers a corrective search or a different retrieval strategy.</li><li><strong>Self-RAG</strong>: Serves as an <strong>output critic</strong>. The system critiques its own generated responses against the retrieved facts to ensure the final output is factually grounded and free of hallucinations.</li></ul><p>By adding these loops, the system moves from a “best guess” retrieval to a verified, high-fidelity output, which is essential for deployment in regulated or data-sensitive industries.</p><p><strong>6. The Path to Production: Deployment and Observability</strong></p><p>The transition from a local Jupyter notebook to a “resume-ready” application is the most difficult stage of the lifecycle. Productionizing an agent requires a comprehensive observability stack and a deployment strategy that prioritizes stability.</p><p>The curriculum identifies four critical components for production:</p><ol><li><strong>UI Integration</strong>: Wrapping the agent logic in a user-friendly interface to enable real-world utility.</li><li><strong>Debugging &amp; Support</strong>: Implementing logging and error-handling layers to ensure the system can be maintained post-deployment.</li><li><strong>Observability (LangSmith)</strong>: Monitoring traces, latency, and token costs in real-time to optimize the agent’s performance.</li><li><strong>Deployment</strong>: Moving the system into a scalable, live environment where it can handle concurrent users and persistent state.</li></ol><p><strong>7. Strategic Prerequisites and Readiness Assessment</strong></p><p>Agentic AI is not a entry-level discipline. Because LangGraph is an abstraction built atop LangChain and complex Python modules, intermediate technical foundations are a “hard gate.” Without them, the underlying code dependencies will remain opaque.</p><p><strong>Readiness Checklist:</strong></p><ul><li><strong>Intermediate Python Mastery</strong>: You must be fluent in <strong>OOPS (Object-Oriented Programming)</strong>, <strong>Pydantic</strong> for data validation, the <strong>Typing module</strong> for state definitions, and <strong>AsyncIO</strong> for managing concurrent agentic tasks.</li><li><strong>LLM Familiarity</strong>: A prerequisite understanding of tokenization, prompt engineering, and model limitations.</li><li><strong>LangChain Dependency</strong>: Since LangGraph is an extension of LangChain, a lack of familiarity with base LangChain objects will cause significant friction in understanding graph construction.</li></ul><p>Failure to meet these prerequisites often leads to an inability to debug the complex state transitions inherent in LangGraph. However, a deep focus on these fundamentals acts as a hedge against “Framework Obsolescence.” While tools like LangGraph will evolve — and the curriculum itself is in constant flux to match the daily changes in the field — the core logic of state machines, persistence, and agentic reasoning will remain the gold standard for years to come.</p><p><em>Next:</em><strong><em> </em></strong>Using LangGraph : The need for Execution Graphs</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79ab538d5ef5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/youme-technology/enterprise-scale-agentic-systems-illustrated-part-1-2-using-langgraph-the-fundamentals-a-79ab538d5ef5">Enterprise Scale Agentic Systems Illustrated — Part 1–2 Using LangGraph : The Fundamentals — A…</a> was originally published in <a href="https://medium.com/youme-technology">AI Smart</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enterprise Scale Agentic Systems Illustrated.]]></title>
            <link>https://medium.com/youme-technology/enterprise-scale-agentic-systems-illustrated-section-1-agentic-ai-using-langgraph-overview-0d4efeef1426?source=rss----9f2a2586502---4</link>
            <guid isPermaLink="false">https://medium.com/p/0d4efeef1426</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[langgraph]]></category>
            <category><![CDATA[data-agents]]></category>
            <dc:creator><![CDATA[LAKSHMI VENKATESH]]></dc:creator>
            <pubDate>Tue, 02 Jun 2026 15:44:59 GMT</pubDate>
            <atom:updated>2026-06-08T03:46:58.135Z</atom:updated>
            <content:encoded><![CDATA[<h3>Enterprise Scale Agentic Systems Illustrated. Section 1 — Agentic AI using LangGraph — What’s the Plan for June 2026…</h3><h4>Design, Build, Govern and Operate</h4><h3>Section 1: Agentic AI using LangGraph</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N_Cpy0k3ez0P-GqXLmYZow.gif" /><figcaption>Enterprise Scale Agentic Systems Illustrated</figcaption></figure><p><strong>Design </strong><em>What it is, and what shape it takes</em></p><h4>01 Foundations of Agentic AI</h4><p>Agentic ≠ generative. Who are the key Agentic Players. Terminology, the GenAI-to-agentic distinction, the maturity ladder, and the framework landscape — A Blueprint.</p><p>▶Who are the Key Agentic Players? ▶<a href="https://medium.com/p/0322b6376b80?postPublishedType=initial"><strong>PUBLISHED HERE</strong></a></p><p>▶The Fundamentals — A, Blueprint ▶ <a href="https://medium.com/youme-technology/enterprise-scale-agentic-systems-illustrated-part-1-2-using-langgraph-the-fundamentals-a-79ab538d5ef5"><strong>PUBLISHED HERE</strong></a></p><h4>02 From Prompts to Control Planes</h4><p>An enterprise agent is a governable execution graph, not a clever prompt. LangGraph as the control substrate.</p><p>The need for Execution Graph. ▶ <a href="https://luxananda.medium.com/enterprise-scale-agentic-systems-illustrated-part-1-3-using-langgraph-the-need-for-execution-d80577c24c24"><strong>PUBLISHED HERE</strong></a></p><p>The need for LangGraph and sample implementation ▶ <a href="https://luxananda.medium.com/enterprise-scale-agentic-systems-illustrated-part-1-4-using-langgraph-install-langgraph-and-a-71a70bdacba8"><strong>PUBLISHED HERE</strong></a></p><p>How to implement Agentic Patterns using Langraph ▶ <a href="https://luxananda.medium.com/enterprise-scale-agentic-systems-illustrated-part-1-5-using-langgraph-how-to-implement-agentic-38a2d5cd9583"><strong>PUBLISHED HERE</strong></a></p><h4>03 Layers, Just not Scripts</h4><p>Scale is an eight-layer reference stack, not a pile of scripts. The platform every team inherits. ▶ <strong>PLANNED</strong></p><h4>04 Agentic Design Patterns · 3-TIER</h4><p>A stack, not a list: control-flow <em>shapes</em> (sequential · parallel · conditional · iterative) → <em>cognitive </em>patterns (ReAct · Reflection · Planning) → <em>structural</em> patterns (Router · Supervisor · Worker · Critic). ▶ <strong>PLANNED</strong></p><p><strong>Build</strong><em>The capabilities that do the work</em></p><h4>05 Production Data Agents</h4><p>Structured-data agents need meaning, access control, and validation — a semantic layer, not raw SQL. ▶ <strong>PLANNED</strong></p><h4>06 Agentic RAGNEW · FROM SYNC</h4><p>Retrieval that corrects and critiques itself. CRAG and Self-RAG over unstructured documents — distinct from structured-data agents. ▶ <strong>PLANNED</strong></p><h4>07 Tools &amp; Integrations</h4><p>Tools let agents act; registries, schemas, and permissions make them safe enterprise actors — with <strong>MCP</strong> as the interoperability standard for the tool layer. ▶ <strong>PLANNED</strong></p><h4>08 DeepAgents, Subgraphs &amp; Multi-Agent Workflows</h4><p>Subgraphs are the composition primitive — a nested graph is a reusable agent. Use many agents only when responsibilities separate cleanly. ▶ <strong>PLANNED</strong></p><p><strong>Govern</strong><em>The controls that make autonomy safe</em></p><h4>09 State, Memory &amp; Checkpointing</h4><p>LLMs are stateless — memory is engineered. Short-term (checkpointer ⁄ thread) and long-term (Store ⁄ cross-thread) are different architectures. Checkpoints make agents reliable, resumable, and auditable. ▶ <strong>PLANNED</strong></p><h4>10 Human-in-the-Loop &amp; Approval Gates</h4><p>Autonomy is designed, not assumed. Approval gates keyed to risk tier — the agent suggests, the human confirms. ▶ <strong>PLANNED</strong></p><h4>11 Observability &amp; Evaluation</h4><p>What cannot be traced cannot be trusted; what cannot be evaluated cannot ship. LangSmith, golden datasets, regression gates — plus streaming and intermediate-step visibility as the user-facing surface. ▶ <strong>PLANNED</strong></p><p><strong>Operate</strong><em>Running it for real, at scale</em></p><h4><strong>12 Security, Governance, Risk &amp; Compliance</strong></h4><p>Enterprise agents need policy-by-design and their own identity. RBAC, secrets, auditability, and the regulatory frame. ▶ <strong>PLANNED</strong></p><h4>13 Operating Agentic Platforms in Production</h4><p>Scale is an operating discipline: CI/CD, monitoring, cost engineering, release model. The capstone. ▶ <strong>PLANNED</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d4efeef1426" width="1" height="1" alt=""><hr><p><a href="https://medium.com/youme-technology/enterprise-scale-agentic-systems-illustrated-section-1-agentic-ai-using-langgraph-overview-0d4efeef1426">Enterprise Scale Agentic Systems Illustrated.</a> was originally published in <a href="https://medium.com/youme-technology">AI Smart</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enterprise Scale Agentic Systems Illustrated — Part 1-1 Using LangGraph : Overview — Who are the…]]></title>
            <link>https://medium.com/youme-technology/enterprise-scale-agentic-systems-illustrated-part-1-1-using-langgraph-overview-who-are-the-0322b6376b80?source=rss----9f2a2586502---4</link>
            <guid isPermaLink="false">https://medium.com/p/0322b6376b80</guid>
            <category><![CDATA[langraph]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[LAKSHMI VENKATESH]]></dc:creator>
            <pubDate>Tue, 02 Jun 2026 15:44:46 GMT</pubDate>
            <atom:updated>2026-06-02T15:44:48.188Z</atom:updated>
            <content:encoded><![CDATA[<h3>Enterprise Scale Agentic Systems Illustrated — Part 1-1 Using LangGraph : Overview — Who are the Key Agentic Players?</h3><h4>Using LangGraph — From Prompts to Control Planes: Why Enterprise Agents Run on Graphs</h4><p><strong><em>Agents 2026 — Open vs Closed Source — Where are we?</em></strong></p><p><strong><em>The Agent Open source 2026</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6YojmGBMqDlN9vpkB76YNA.png" /><figcaption>This is only my view</figcaption></figure><p><strong>Key players:</strong></p><ol><li><strong><em>LangGraph</em></strong></li></ol><p><strong>Best for:</strong> complex, stateful, production-grade agents.</p><p>LangGraph is the orchestration workhorse. It is built around graph state, nodes, edges, memory, durable execution, checkpoints, and human-in-the-loop control.</p><p><strong>Use when:</strong> the agent needs routing, retries, approvals, long-running workflows, or multi-step control.</p><p><strong><em>2. AutoGen</em></strong></p><p><strong>Best for:</strong> conversational multi-agent collaboration.</p><p>AutoGen is an open-source framework for building AI agents and enabling cooperation among multiple agents.</p><p><strong>Use when:</strong> agents need to talk, debate, coordinate, or solve tasks collaboratively.</p><p><strong>This is </strong>strong for research-style multi-agent patterns. <strong>However, </strong>less deterministic than graph-first orchestration.</p><p><strong><em>3. CrewAI</em></strong></p><p><strong>Best for:</strong> role-based agent teams.</p><p>CrewAI focuses on agents, crews, tasks, flows, guardrails, memory, knowledge, and observability.</p><p><strong>Use when:</strong> you want a “team of agents” model: researcher, analyst, writer, reviewer.</p><p><strong>This is </strong>easy mental model. <strong>However,</strong> can become too role-play driven if not tightly governed.</p><p><strong><em>4. LlamaIndex</em></strong></p><p><strong>Best for:</strong> data-centric and RAG-heavy agents.</p><p>LlamaIndex is a framework for context-augmented LLM applications, with query engines and RAG flows as core capabilities.</p><p><strong>Use when:</strong> the hard problem is data access, retrieval, indexing, and knowledge grounding.</p><p><strong>This is </strong>strong data layer. <strong>However, </strong>not primarily an orchestration engine.</p><p><strong><em>5. Haystack</em></strong></p><p><strong>Best for:</strong> LLM app pipelines.</p><p>Haystack is useful when the problem looks like:</p><p>retrieve → rank → generate → evaluate</p><p><strong>Use when:</strong> you need modular RAG, search, evaluation, and production LLM pipelines.</p><p><strong>This is </strong>clean pipeline thinking. <strong>However, </strong>less agent-native than LangGraph.</p><p><strong><em>6. Semantic Kernel</em></strong></p><p><strong>Best for:</strong> enterprise integration, especially Microsoft/.NET environments.</p><p>Semantic Kernel is useful for plugins, function calling, planners, memory, and enterprise system integration.</p><p><strong>Use when:</strong> you are building inside the Microsoft ecosystem.</p><p><strong>This is </strong>enterprise-friendly. <strong>However, </strong>not as graph-native as LangGraph.</p><p><strong><em>The Agent Closed source 2026</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dAK-YIuCGDQiMji3Q2YSvA.png" /></figure><p><strong>Key players:</strong></p><ol><li><strong><em>Microsoft Copilot Studio / Azure AI Foundry</em></strong></li></ol><p><strong>Best for:</strong> Microsoft 365, Teams, Power Platform, Azure.</p><p><strong>Use when:</strong> your enterprise already lives in Microsoft.</p><p><strong>This is </strong>strongest distribution channel. <strong>However,</strong> can lock you into Microsoft patterns.</p><p><strong><em>2. Salesforce Agentforce</em></strong></p><p><strong>Best for:</strong> CRM, sales, service, marketing, customer workflows.</p><p><strong>Use when:</strong> customer data and customer processes live in Salesforce.</p><p><strong>This is </strong>strong business-process fit. <strong>However, </strong>less useful outside Salesforce-heavy environments.</p><p><strong><em>3. Google Gemini Enterprise / Vertex AI Agent Builder</em></strong></p><p><strong>Best for:</strong> Google Cloud, search, data, multimodal AI.</p><p><strong>Use when:</strong> you want agents connected to Google Cloud, Workspace, search, and data products.</p><p><strong>This is </strong>strong AI and data foundation. <strong>However, </strong>enterprise workflow depth depends on your Google footprint.</p><p><strong><em>4. ServiceNow AI Agents</em></strong></p><p><strong>Best for:</strong> ITSM, HR, operations, workflow automation.</p><p><strong>Use when:</strong> the agent needs to resolve tickets, route requests, and automate enterprise operations.</p><p><strong>This is </strong>strong workflow backbone. <strong>However, </strong>narrower outside ServiceNow-led processes.</p><p><strong><em>5. IBM watsonx Orchestrate</em></strong></p><p><strong>Best for:</strong> regulated, governance-heavy enterprises.</p><p><strong>Use when:</strong> auditability, compliance, and enterprise integration matter more than speed.</p><p><strong>This is </strong>governance posture. <strong>However, </strong>may feel heavier than modern developer-first tools.</p><p><strong><em>6. SAP Joule / SAP Business AI</em></strong></p><p><strong>Best for:</strong> ERP, finance, procurement, supply chain.</p><p><strong>Use when:</strong> the agent needs to act inside SAP business processes.</p><p><strong>This is </strong>deep enterprise process context. <strong>However, </strong>strongest mainly for SAP-centric companies.</p><p><strong><em>7. Oracle AI Agent Studio / Fusion AI Agents</em></strong></p><p><strong>Best for:</strong> Oracle ERP, HCM, CX, database-centric enterprises.</p><p><strong>Use when:</strong> your core enterprise stack is Oracle.</p><p><strong>This is </strong>close to enterprise data and apps. <strong>However, </strong>less attractive if Oracle is not your center of gravity.</p><p><strong><em>8. AWS Bedrock Agents / Amazon Q Business</em></strong></p><p><strong>Best for:</strong> AWS-native builders and enterprise knowledge agents.</p><p><strong>Use when:</strong> your infrastructure, apps, and AI workloads already run on AWS.</p><p><strong>This is </strong>strong cloud-native deployment story. <strong>However, </strong>more builder-centric than business-suite-centric.</p><p><strong><em>9. Databricks Agent Bricks</em></strong></p><p><strong>Best for:</strong> governed data + AI agents on the lakehouse.</p><p><strong>Use when:</strong> your agent needs to act on analytics, ML, enterprise data, and governed lakehouse assets.</p><p>This is strong for data/AI-native enterprises. <strong>However, </strong>not a general business-process platform.</p><p><strong><em>10. Snowflake Cortex Agents</em></strong></p><p><strong>Best for:</strong> data-native agents inside Snowflake.</p><p><strong>Use when:</strong> enterprise data already lives in Snowflake and agents need governed data access.</p><p>This is strong data governance and analytics fit. <strong>However, </strong>less suitable for broad workflow orchestration outside the data cloud.</p><p><strong><em>Overall framing of this series Agentic AI using Langraph will be around — </em></strong><a href="https://medium.com/@luxananda/enterprise-scale-agentic-systems-illustrated-section-1-agentic-ai-using-langgraph-overview-0d4efeef1426">https://medium.com/@luxananda/enterprise-scale-agentic-systems-illustrated-section-1-agentic-ai-using-langgraph-overview-0d4efeef1426</a></p><p><em>Next:</em><strong><em> </em></strong>Using LangGraph : The Fundamentals — A, Blueprint</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0322b6376b80" width="1" height="1" alt=""><hr><p><a href="https://medium.com/youme-technology/enterprise-scale-agentic-systems-illustrated-part-1-1-using-langgraph-overview-who-are-the-0322b6376b80">Enterprise Scale Agentic Systems Illustrated — Part 1-1 Using LangGraph : Overview — Who are the…</a> was originally published in <a href="https://medium.com/youme-technology">AI Smart</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 78: Harnessing AI in Data Architecture & vice-Versa]]></title>
            <link>https://medium.com/youme-technology/day-78-harnessing-ai-in-data-architecture-vice-versa-0c1482605fe0?source=rss----9f2a2586502---4</link>
            <guid isPermaLink="false">https://medium.com/p/0c1482605fe0</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[LAKSHMI VENKATESH]]></dc:creator>
            <pubDate>Fri, 29 May 2026 00:55:57 GMT</pubDate>
            <atom:updated>2026-05-29T00:55:58.471Z</atom:updated>
            <content:encoded><![CDATA[<p>I wrote collection of notes on harnessing AI in data architecture and vice-versa. Thought it might be helpful for someone else as well.</p><p>Two ideas shaped it. <br>1. The Simple Architect one: say less. Name the problem. Make the decision clear.<br>2. The Strong Architect + Engineering one: build the logic until it holds. Scope, root cause, dependencies, defend the choice.</p><p>Most co-writing with AI picks one and drops the other. I tried my best to keep both and included HBR-style case studies and also included the working examples.</p><p>Point is simple: AI didn’t remove the need for data architecture. It made it visible. A weak foundation used to produce a wrong dashboard. Now it produces a wrong decision — automated, autonomous.<br>Clear at the point of decision. Robust beneath it.</p><p>Document Attached. Kept it simple. Happy reading.</p><p><a href="https://www.linkedin.com/search/results/all/?keywords=%23agenticai&amp;origin=HASH_TAG_FROM_FEED">#AGENTICAI</a> <a href="https://www.linkedin.com/search/results/all/?keywords=%23data&amp;origin=HASH_TAG_FROM_FEED">#DATA</a> <a href="https://www.linkedin.com/search/results/all/?keywords=%23dataarchitecture&amp;origin=HASH_TAG_FROM_FEED">#DATAARCHITECTURE</a> <a href="https://www.linkedin.com/search/results/all/?keywords=%23ai&amp;origin=HASH_TAG_FROM_FEED">#AI</a> <a href="https://www.linkedin.com/search/results/all/?keywords=%23artificialintelligence&amp;origin=HASH_TAG_FROM_FEED">#ARTIFICIALINTELLIGENCE</a></p><p>To download the notes — <a href="https://www.linkedin.com/posts/lakshmivenkatesh_harnessing-ai-in-data-architecture-and-vice-versa-ugcPost-7464151577516355584-jL9o/?utm_source=share&amp;utm_medium=member_desktop&amp;rcm=ACoAAAipqp4BR1gDr20WTFSGWKCsxWIYy1pZ8pQ">https://www.linkedin.com/posts/lakshmivenkatesh_harnessing-ai-in-data-architecture-and-vice-versa-ugcPost-7464151577516355584-jL9o/?utm_source=share&amp;utm_medium=member_desktop&amp;rcm=ACoAAAipqp4BR1gDr20WTFSGWKCsxWIYy1pZ8pQ</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c1482605fe0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/youme-technology/day-78-harnessing-ai-in-data-architecture-vice-versa-0c1482605fe0">Day 78: Harnessing AI in Data Architecture &amp; vice-Versa</a> was originally published in <a href="https://medium.com/youme-technology">AI Smart</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 71 1.4: Agentic AI in Open Banking — Ontologies, Business Rules and Knowledge Graph & Models]]></title>
            <link>https://medium.com/youme-technology/day-71-1-4-agentic-ai-in-open-banking-ontologies-business-rules-and-knowledge-graph-37d0d43671ff?source=rss----9f2a2586502---4</link>
            <guid isPermaLink="false">https://medium.com/p/37d0d43671ff</guid>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[knowledge-graph]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[open-banking]]></category>
            <dc:creator><![CDATA[LAKSHMI VENKATESH]]></dc:creator>
            <pubDate>Tue, 19 May 2026 12:48:56 GMT</pubDate>
            <atom:updated>2026-05-19T12:48:57.761Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The semantic foundation that makes agents trustworthy</strong></p><p>Models backing the Knowledge Graph &amp; Ontology: <a href="http://72.60.104.24:8080/Meridian_Lab.html">Link</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K6AMdcj_zmNQqLMYKxUVuQ.gif" /></figure><p>This part of the article focuses on first 2 boxes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ysLmrCEfvOP0spfUKsTzng.gif" /></figure><h3>Agentic AI in Open Banking: Ontologies, Business Rules, and Knowledge Graphs</h3><h3>Executive Summary</h3><p>Agentic AI systems make autonomous decisions at machine speed. In Open Banking, where agents orchestrate financial operations across multiple institutions, <strong>semantic guarantees are non-negotiable</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xt4jR-JF8tW4Mz7L8GuKpQ.gif" /></figure><p>This article explains how <strong>ontologies</strong> define concepts formally, <strong>business rules</strong> encode domain logic declaratively, and <strong>knowledge graphs</strong> provide the unified data layer that enables agents to reason correctly about customer finances across internal and external banking systems.</p><p>Why Open Banking needs formal ontologies, not just API schemas</p><ul><li>How business rules transform from code to declarative logic</li><li>Building knowledge graphs from Open Data Contracts</li><li>Graph query patterns for common banking operations</li><li>Implementation: from ontology design to production graph database</li><li>Real examples: customer 360, liquidity classification, cross-sell eligibility</li></ul><h3>Part 1: The Semantic Gap in Open Banking</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Mf8nj6y55uYHTzbH_m13Yg.gif" /></figure><h4>What Open Banking Gave Us</h4><p>Open Banking mandated standardized APIs:</p><ul><li><strong>Account Information:</strong> /accounts/{id}/balance, /accounts/{id}/transactions</li><li><strong>Payment Initiation:</strong> /payments/domestic, /payments/international</li><li><strong>Confirmation of Funds:</strong> /funds-confirmations</li></ul><p><strong>The promise:</strong> Third parties can build services on unified financial data.</p><p><strong>The reality:</strong> APIs provide data, not meaning.</p><h4>The Problem: Same Endpoint, Different Semantics</h4><p><strong>Example: Three banks, one endpoint</strong></p><pre>GET /accounts/ACC123/balance</pre><p><strong>Bank A response:</strong></p><pre>{<br>  &quot;balance&quot;: 5000,<br>  &quot;currency&quot;: &quot;GBP&quot;<br>}</pre><p><strong>Bank B response:</strong></p><pre>{<br>  &quot;balance&quot;: 500000,<br>  &quot;currency&quot;: &quot;GBP&quot;,<br>  &quot;balanceType&quot;: &quot;available&quot;<br>}</pre><p><strong>Bank C response:</strong></p><pre>{<br>  &quot;accountBalance&quot;: {<br>    &quot;amount&quot;: &quot;50.00&quot;,<br>    &quot;currency&quot;: &quot;GBP&quot;<br>  }<br>}</pre><p><strong>Questions an agent cannot answer:</strong></p><ol><li><strong>Units:</strong> Is 5000 in pounds (£5,000) or pence (£50)?</li><li><strong>Type:</strong> Is this available balance, ledger balance, or pending?</li><li><strong>Freshness:</strong> Is this real-time or cached from yesterday?</li><li><strong>Source:</strong> Core banking ledger, data warehouse, or cache?</li><li><strong>Reliability:</strong> What SLA guarantees this data?</li></ol><p><strong>At human speed:</strong> Developers catch this in testing, hardcode per-bank logic.</p><p><strong>At machine speed:</strong> Agents execute 1,000 transactions on malformed data before anyone notices.</p><h3>Why JSON Schema Isn’t Enough</h3><p>JSON Schema validates <strong>structure</strong>, not <strong>semantics</strong>:</p><pre># JSON Schema says:<br>balance:<br>  type: integer<br>  <br># JSON Schema does NOT say:<br>- Units: pence or pounds?<br>- Semantics: available or ledger?<br>- Freshness: real-time or cached?<br>- Business rules: When is an account &quot;liquid&quot;?</pre><p><strong>We need ontologies.</strong></p><h3>Part 2: Ontologies — Formal Concept Definitions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HKGI3xzs1zHOOyBbKAtnOg.gif" /></figure><h3>What Is an Ontology?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Q4ouEkcNrrkCBV9OijdQig.gif" /></figure><p><strong>Ontology</strong> = A formal, explicit specification of a shared conceptualization.</p><p>Breaking it down:</p><ul><li><strong>Formal:</strong> Machine-readable (OWL, RDFS, not English prose)</li><li><strong>Explicit:</strong> Concepts, properties, relationships clearly defined</li><li><strong>Shared:</strong> Agreement across organizations (not one bank’s internal model)</li><li><strong>Conceptualization:</strong> Abstract model of a domain (banking, not implementation)</li></ul><p><strong>In practice:</strong> An ontology is a graph of concepts with:</p><ul><li><strong>Classes:</strong> What things exist? (Account, Customer, Transaction)</li><li><strong>Properties:</strong> What attributes do they have? (balance, type, timestamp)</li><li><strong>Relationships:</strong> How do they connect? (owns, linkedTo, funds)</li><li><strong>Constraints:</strong> What rules must hold? (Account must have exactly one owner)</li><li><strong>Axioms:</strong> What can we infer? (If ISA, then tax-free AND withdrawal-penalty)</li></ul><h3>Banking Ontology Example</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LqHzvICj3fe0Qq9IuZI-5Q.gif" /></figure><p><strong>Core concepts:</strong></p><pre># Web Ontology Language (OWL) format</pre><pre>@prefix bank: &lt;http://openbanking.example.com/ontology#&gt; .<br>@prefix owl: &lt;http://www.w3.org/2002/07/owl#&gt; .<br>@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .<br>@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .</pre><pre># ============================================<br># CLASS HIERARCHY<br># ============================================</pre><pre>bank:Asset<br>  a owl:Class ;<br>  rdfs:label &quot;Financial Asset&quot; ;<br>  rdfs:comment &quot;Any financial asset held by a customer&quot; .</pre><pre>bank:Account<br>  a owl:Class ;<br>  rdfs:subClassOf bank:Asset ;<br>  rdfs:label &quot;Bank Account&quot; ;<br>  rdfs:comment &quot;A deposit account held at a banking institution&quot; .</pre><pre>bank:CurrentAccount<br>  a owl:Class ;<br>  rdfs:subClassOf bank:Account ;<br>  rdfs:label &quot;Current Account&quot; ;<br>  rdfs:comment &quot;Transaction account for daily banking operations&quot; .</pre><pre>bank:SavingsAccount<br>  a owl:Class ;<br>  rdfs:subClassOf bank:Account ;<br>  rdfs:label &quot;Savings Account&quot; ;<br>  rdfs:comment &quot;Interest-bearing account for savings&quot; .</pre><pre>bank:ISAAccount<br>  a owl:Class ;<br>  rdfs:subClassOf bank:SavingsAccount ;<br>  rdfs:label &quot;Individual Savings Account (ISA)&quot; ;<br>  rdfs:comment &quot;Tax-free savings account with contribution limits and withdrawal penalties&quot; .</pre><pre>bank:BusinessAccount<br>  a owl:Class ;<br>  rdfs:subClassOf bank:Account ;<br>  rdfs:label &quot;Business Account&quot; ;<br>  rdfs:comment &quot;Account designated for business use only&quot; .</pre><pre>bank:Portfolio<br>  a owl:Class ;<br>  rdfs:subClassOf bank:Asset ;<br>  rdfs:label &quot;Investment Portfolio&quot; ;<br>  rdfs:comment &quot;Collection of investment holdings&quot; .</pre><pre># ============================================<br># PROPERTIES<br># ============================================</pre><pre>bank:hasBalance<br>  a owl:DatatypeProperty ;<br>  rdfs:domain bank:Account ;<br>  rdfs:range xsd:integer ;<br>  rdfs:label &quot;has balance&quot; ;<br>  rdfs:comment &quot;Account balance in minor currency units (pence)&quot; .</pre><pre>bank:hasCurrency<br>  a owl:DatatypeProperty ;<br>  rdfs:domain bank:Asset ;<br>  rdfs:range xsd:string ;<br>  rdfs:label &quot;has currency&quot; ;<br>  rdfs:comment &quot;ISO 4217 three-letter currency code&quot; .</pre><pre>bank:isLiquid<br>  a owl:DatatypeProperty ;<br>  rdfs:domain bank:Asset ;<br>  rdfs:range xsd:boolean ;<br>  rdfs:label &quot;is liquid&quot; ;<br>  rdfs:comment &quot;Can access funds within 24 hours without penalty&quot; .</pre><pre>bank:hasWithdrawalPenalty<br>  a owl:DatatypeProperty ;<br>  rdfs:domain bank:Account ;<br>  rdfs:range xsd:integer ;<br>  rdfs:label &quot;has withdrawal penalty&quot; ;<br>  rdfs:comment &quot;Penalty amount in minor units for early withdrawal&quot; .</pre><pre>bank:hasInterestRate<br>  a owl:DatatypeProperty ;<br>  rdfs:domain bank:Account ;<br>  rdfs:range xsd:decimal ;<br>  rdfs:label &quot;has interest rate&quot; ;<br>  rdfs:comment &quot;Annual interest rate as decimal (0.042 = 4.2%)&quot; .</pre><pre># ============================================<br># RELATIONSHIPS<br># ============================================</pre><pre>bank:owns<br>  a owl:ObjectProperty ;<br>  rdfs:domain bank:Customer ;<br>  rdfs:range bank:Asset ;<br>  rdfs:label &quot;owns&quot; ;<br>  rdfs:comment &quot;Customer owns this asset&quot; ;<br>  owl:inverseOf bank:ownedBy .</pre><pre>bank:ownedBy<br>  a owl:ObjectProperty ;<br>  rdfs:domain bank:Asset ;<br>  rdfs:range bank:Customer ;<br>  rdfs:label &quot;owned by&quot; ;<br>  owl:inverseOf bank:owns .</pre><pre>bank:linkedTo<br>  a owl:ObjectProperty ;<br>  rdfs:domain bank:Account ;<br>  rdfs:range bank:ExternalAccount ;<br>  rdfs:label &quot;linked to&quot; ;<br>  rdfs:comment &quot;Internal account linked to external account via Open Banking consent&quot; .</pre><pre>bank:funds<br>  a owl:ObjectProperty ;<br>  rdfs:domain bank:Asset ;<br>  rdfs:range bank:Goal ;<br>  rdfs:label &quot;funds&quot; ;<br>  rdfs:comment &quot;This asset contributes funding to a financial goal&quot; .</pre><pre># ============================================<br># CONSTRAINTS<br># ============================================</pre><pre>bank:Account<br>  rdfs:subClassOf [<br>    a owl:Restriction ;<br>    owl:onProperty bank:ownedBy ;<br>    owl:cardinality &quot;1&quot;^^xsd:nonNegativeInteger ;<br>    rdfs:comment &quot;Account must have exactly one owner&quot;<br>  ] .</pre><pre>bank:ISAAccount<br>  rdfs:subClassOf [<br>    a owl:Restriction ;<br>    owl:onProperty bank:hasWithdrawalPenalty ;<br>    owl:minCardinality &quot;1&quot;^^xsd:nonNegativeInteger ;<br>    rdfs:comment &quot;ISA must specify withdrawal penalty&quot;<br>  ] .</pre><pre># ============================================<br># AXIOMS (INFERENCE RULES)<br># ============================================</pre><pre># Rule 1: Current accounts are always liquid<br>bank:CurrentAccount<br>  rdfs:subClassOf [<br>    a owl:Restriction ;<br>    owl:onProperty bank:isLiquid ;<br>    owl:hasValue &quot;true&quot;^^xsd:boolean<br>  ] .</pre><pre># Rule 2: Accounts with withdrawal penalty are not liquid<br>[<br>  a owl:Axiom ;<br>  rdfs:comment &quot;If withdrawal penalty &gt; 0, then not liquid&quot; ;<br>  bank:axiom &quot;&quot;&quot;<br>    IF account:hasWithdrawalPenalty &gt; 0<br>    THEN account:isLiquid = false<br>  &quot;&quot;&quot;<br>] .</pre><pre># Rule 3: Business accounts can only be owned by business entities<br>bank:BusinessAccount<br>  rdfs:subClassOf [<br>    a owl:Restriction ;<br>    owl:onProperty bank:ownedBy ;<br>    owl:allValuesFrom bank:BusinessCustomer<br>  ] .</pre><h4>What This Ontology Provides</h4><p><strong>1. Formal concept definitions:</strong></p><ul><li>ISAAccount is a type of SavingsAccount</li><li>SavingsAccount is a type of Account</li><li>Account is a type of Asset</li></ul><p><strong>2. Property specifications:</strong></p><ul><li>hasBalance must be an integer (minor units)</li><li>hasCurrency must be a string (ISO 4217)</li><li>isLiquid must be a boolean</li></ul><p><strong>3. Relationship semantics:</strong></p><ul><li>owns is the inverse of ownedBy</li><li>linkedTo connects Account to ExternalAccount</li><li>funds shows which assets contribute to which goals</li></ul><p><strong>4. Constraints:</strong></p><ul><li>Account must have exactly one owner</li><li>ISA must specify withdrawal penalty</li></ul><p><strong>5. Inference rules:</strong></p><ul><li>If account is CurrentAccount, then isLiquid = true (automatic)</li><li>If hasWithdrawalPenalty &gt; 0, then isLiquid = false (automatic)</li></ul><p><strong>Why this matters for agents:</strong></p><p>An agent querying “liquid assets” doesn’t need to check account types manually. The ontology <strong>infers</strong> liquidity based on formal rules.</p><h3>Part 3: Business Rules — From Code to Logic</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*enMq5ldnDHJw2oiLOCaf7g.gif" /></figure><h4>The Problem with Rules in Code</h4><p><strong>Traditional approach:</strong></p><pre># Buried in application code<br>def is_account_liquid(account):<br>    if account.type == &quot;current&quot;:<br>        return True<br>    elif account.type == &quot;savings&quot;:<br>        if account.withdrawal_penalty &gt; 0:<br>            return False<br>        return True<br>    elif account.type == &quot;isa&quot;:<br>        return False<br>    elif account.type == &quot;business&quot;:<br>        return account.unrestricted<br>    else:<br>        return False</pre><p><strong>Problems:</strong></p><ul><li>❌ Rules scattered across codebase</li><li>❌ Not auditable by non-developers</li><li>❌ Can’t validate against ontology</li><li>❌ Inconsistent across services</li><li>❌ No version control for logic</li><li>❌ Opaque to regulators</li></ul><h4>Business Rules as Declarative Logic</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*RsXvV1VSRe-pQIig0vx3Xg.gif" /></figure><p><strong>Better approach:</strong> Express rules in a declarative format.</p><p><strong>Example: Liquidity classification</strong></p><pre># business_rules/liquidity_classification.yaml</pre><pre>rule_id: LIQ-001<br>name: &quot;Current Account Liquidity&quot;<br>description: &quot;Current accounts are always liquid&quot;<br>version: &quot;1.0&quot;<br>effective_date: &quot;2024-01-01&quot;</pre><pre>condition:<br>  account_type: &quot;current&quot;</pre><pre>action:<br>  set:<br>    is_liquid: true</pre><pre>rationale: &quot;Current accounts allow immediate withdrawals without penalty&quot;</pre><pre>rule_id: LIQ-002<br>name: &quot;ISA Account Liquidity&quot;<br>description: &quot;ISA accounts are not liquid due to withdrawal penalties&quot;<br>version: &quot;1.0&quot;<br>effective_date: &quot;2024-01-01&quot;<br><br>condition:<br>  account_type: &quot;isa&quot;<br><br>action:<br>  set:<br>    is_liquid: false<br><br>rationale: &quot;ISAs incur penalties on early withdrawal to maintain tax advantages&quot;<br><br>rule_id: LIQ-003<br>name: &quot;Savings with Penalty&quot;<br>description: &quot;Savings accounts with withdrawal penalties are not liquid&quot;<br>version: &quot;1.0&quot;<br>effective_date: &quot;2024-01-01&quot;<br><br>condition:<br>  account_type: &quot;savings&quot;<br>  withdrawal_penalty_pence: {gt: 0}<br><br>action:<br>  set:<br>    is_liquid: false<br><br>rationale: &quot;Penalty cost makes funds effectively inaccessible for short-term needs&quot;<br><br>rule_id: LIQ-004<br>name: &quot;Savings without Penalty&quot;<br>description: &quot;Penalty-free savings accounts with notice ≤1 day are liquid&quot;<br>version: &quot;1.0&quot;<br>effective_date: &quot;2024-01-01&quot;<br><br>condition:<br>  account_type: &quot;savings&quot;<br>  withdrawal_penalty_pence: 0<br>  notice_period_days: {lte: 1}<br><br>action:<br>  set:<br>    is_liquid: true<br><br>rationale: &quot;Can access funds within 24 hours at no cost&quot;</pre><h4>Complex Business Rules</h4><p><strong>Example: Mortgage eligibility</strong></p><pre>rule_id: MORT-001<br>name: &quot;Basic Mortgage Eligibility&quot;<br>description: &quot;Minimum criteria for mortgage product eligibility&quot;<br>version: &quot;2.1&quot;<br>effective_date: &quot;2024-06-01&quot;<br>owner: &quot;Product Team - Mortgages&quot;<br>regulatory_ref: &quot;FCA MCOB 11.6.2&quot;<br><br>conditions:<br>  all_of:<br>    - customer.annual_income_pence: {gte: 3000000}  # £30K<br>    - customer.age: {gte: 21, lte: 70}<br>    - customer.credit_score: {gte: 650}<br>    - customer.missed_payments_12m: 0<br>    - customer.deposit_available_pence: {gte: property_value * 0.10}<br>    - customer.debt_to_income_ratio: {lte: 0.40}<br><br>action:<br>  set:<br>    mortgage_eligible: true<br>    max_loan_to_value: 0.90<br>    max_loan_amount_pence: min(<br>      customer.annual_income_pence * 4.5,<br>      property_value_pence * 0.90<br>    )<br><br>rationale: &quot;FCA affordability requirements + bank risk appetite&quot;<br><br>exceptions:<br>  - condition: customer.segment == &quot;private_banking&quot;<br>    action:<br>      set:<br>        max_loan_to_value: 0.95<br>        max_loan_amount_pence: customer.annual_income_pence * 5.0<br>    rationale: &quot;Private banking customers have enhanced terms&quot;</pre><p><strong>Example: Fraud detection rules</strong></p><pre>rule_id: FRAUD-001<br>name: &quot;High-Value Foreign Transaction&quot;<br>description: &quot;Flag transactions &gt;10x average in foreign country&quot;<br>version: &quot;1.3&quot;<br>effective_date: &quot;2024-03-15&quot;<br>owner: &quot;Fraud Prevention Team&quot;<br><br>conditions:<br>  all_of:<br>    - transaction.amount_pence: {gt: customer.avg_txn_6m * 10}<br>    - transaction.merchant_country: {ne: customer.home_country}<br>    - transaction.merchant_category: {in: [&quot;gambling&quot;, &quot;crypto&quot;, &quot;wire_transfer&quot;]}<br><br>action:<br>  set:<br>    fraud_risk_score: 0.85<br>    requires_verification: true<br>    block_transaction: true<br><br>alert:<br>  channel: &quot;fraud_ops_queue&quot;<br>  priority: &quot;high&quot;<br>  message: &quot;Customer {customer_id}: £{amount} {category} txn in {country}&quot;<br><br>rationale: &quot;Unusual amount + foreign + high-risk category = strong fraud signal&quot;</pre><h4>Rule Engine Architecture</h4><pre>#Rule execution engine</pre><pre>class BusinessRuleEngine:<br>    def __init__(self, ontology, rules_directory):<br>        self.ontology = ontology<br>        self.rules = self.load_rules(rules_directory)<br>        <br>    def evaluate(self, entity, entity_type):<br>        &quot;&quot;&quot;<br>        Apply all applicable rules to an entity<br>        &quot;&quot;&quot;<br>        applicable_rules = self.get_applicable_rules(entity_type)<br>        <br>        for rule in applicable_rules:<br>            if self.evaluate_conditions(rule.conditions, entity):<br>                self.apply_actions(rule.actions, entity)<br>                <br>        return entity<br>    <br>    def evaluate_conditions(self, conditions, entity):<br>        &quot;&quot;&quot;<br>        Check if entity satisfies rule conditions<br>        &quot;&quot;&quot;<br>        if &quot;all_of&quot; in conditions:<br>            return all(<br>                self.check_condition(cond, entity)<br>                for cond in conditions[&quot;all_of&quot;]<br>            )<br>        elif &quot;any_of&quot; in conditions:<br>            return any(<br>                self.check_condition(cond, entity)<br>                for cond in conditions[&quot;any_of&quot;]<br>            )<br>        else:<br>            return self.check_condition(conditions, entity)<br>    <br>    def check_condition(self, condition, entity):<br>        &quot;&quot;&quot;<br>        Evaluate single condition<br>        &quot;&quot;&quot;<br>        for field, constraint in condition.items():<br>            value = getattr(entity, field)<br>            <br>            if isinstance(constraint, dict):<br>                # Operators: gt, gte, lt, lte, eq, ne, in, not_in<br>                for op, threshold in constraint.items():<br>                    if op == &quot;gt&quot; and not value &gt; threshold:<br>                        return False<br>                    elif op == &quot;gte&quot; and not value &gt;= threshold:<br>                        return False<br>                    elif op == &quot;in&quot; and value not in threshold:<br>                        return False<br>                    # ... more operators<br>            else:<br>                # Direct equality<br>                if value != constraint:<br>                    return False<br>                    <br>        return True<br>    <br>    def apply_actions(self, actions, entity):<br>        &quot;&quot;&quot;<br>        Execute rule actions on entity<br>        &quot;&quot;&quot;<br>        if &quot;set&quot; in actions:<br>            for field, value in actions[&quot;set&quot;].items():<br>                setattr(entity, field, value)<br>                <br>        if &quot;alert&quot; in actions:<br>            self.send_alert(actions[&quot;alert&quot;], entity)<br>            <br>        return entity</pre><pre># Usage<br>engine = BusinessRuleEngine(<br>    ontology=load_ontology(&quot;banking_ontology.owl&quot;),<br>    rules_directory=&quot;./business_rules/&quot;<br>)</pre><pre># Apply rules to account<br>account = Account(<br>    id=&quot;ACC123&quot;,<br>    type=&quot;isa&quot;,<br>    balance_pence=20000000,<br>    withdrawal_penalty_pence=1500000<br>)</pre><pre>account = engine.evaluate(account, &quot;Account&quot;)</pre><pre>print(f&quot;Is liquid: {account.is_liquid}&quot;)  # False (rule LIQ-002 applied)</pre><h3>Part 4: Building the Knowledge Graph</h3><h4>From Contracts to Graph Schema</h4><p><strong>Remember:</strong> Open Data Contracts (ODCS) declare entities and relationships. We use these to generate graph schema automatically.</p><p><strong>Contract example:</strong></p><pre># account_balance_v2.yaml<br>contract_id: &quot;account_balance_v2&quot;<br>entities:<br>  Account:<br>    identifier: &quot;accountId&quot;<br>    properties:<br>      balance_pence: integer<br>      currency: string<br>      type: enum[current, savings, isa, business]<br>      liquid: boolean<br>      source_bank: string<br>      <br>    relationships:<br>      - name: &quot;ownedBy&quot;<br>        target: &quot;Customer&quot;<br>        cardinality: &quot;many-to-one&quot;<br>        inverse: &quot;owns&quot;<br>        <br>      - name: &quot;linkedTo&quot;<br>        target: &quot;ExternalAccount&quot;<br>        cardinality: &quot;many-to-many&quot;<br>        description: &quot;Linked via Open Banking consent&quot;</pre><p><strong>Automated graph schema generation:</strong></p><pre>def generate_graph_schema_from_contracts():<br>    &quot;&quot;&quot;<br>    Read all contracts, extract entities and relationships,<br>    generate Neo4j schema<br>    &quot;&quot;&quot;<br>    contracts = load_all_contracts()<br>    <br>    schema = {<br>        &quot;node_labels&quot;: set(),<br>        &quot;relationship_types&quot;: set(),<br>        &quot;constraints&quot;: [],<br>        &quot;indices&quot;: []<br>    }<br>    <br>    for contract in contracts:<br>        for entity_name, entity_def in contract.entities.items():<br>            # Add node label<br>            schema[&quot;node_labels&quot;].add(entity_name)<br>            <br>            # Add uniqueness constraint on identifier<br>            schema[&quot;constraints&quot;].append({<br>                &quot;label&quot;: entity_name,<br>                &quot;property&quot;: entity_def.identifier,<br>                &quot;type&quot;: &quot;UNIQUE&quot;<br>            })<br>            <br>            # Add index on frequently queried properties<br>            for prop_name, prop_def in entity_def.properties.items():<br>                if prop_def.get(&quot;indexed&quot;, False):<br>                    schema[&quot;indices&quot;].append({<br>                        &quot;label&quot;: entity_name,<br>                        &quot;property&quot;: prop_name<br>                    })<br>            <br>            # Add relationship types<br>            for rel in entity_def.relationships:<br>                schema[&quot;relationship_types&quot;].add(rel.name)<br>                <br>                # If inverse specified, add it too<br>                if rel.inverse:<br>                    schema[&quot;relationship_types&quot;].add(rel.inverse)<br>    <br>    return schema<br><br># Apply schema to Neo4j<br>def apply_schema_to_neo4j(schema):<br>    with driver.session() as session:<br>        # Create constraints<br>        for constraint in schema[&quot;constraints&quot;]:<br>            session.run(f&quot;&quot;&quot;<br>                CREATE CONSTRAINT {constraint[&quot;label&quot;]}_{constraint[&quot;property&quot;]}_unique<br>                IF NOT EXISTS<br>                FOR (n:{constraint[&quot;label&quot;]})<br>                REQUIRE n.{constraint[&quot;property&quot;]} IS UNIQUE<br>            &quot;&quot;&quot;)<br>        <br>        # Create indices<br>        for index in schema[&quot;indices&quot;]:<br>            session.run(f&quot;&quot;&quot;<br>                CREATE INDEX {index[&quot;label&quot;]}_{index[&quot;property&quot;]}_idx<br>                IF NOT EXISTS<br>                FOR (n:{index[&quot;label&quot;]})<br>                ON (n.{index[&quot;property&quot;]})<br>            &quot;&quot;&quot;)<br># Execute<br>schema = generate_graph_schema_from_contracts()<br>apply_schema_to_neo4j(schema)</pre><h3>Graph Ingestion: Internal + External APIs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*OGK_9b8Y8WDg--3xDGPquA.gif" /></figure><p><strong>Complete ingestion pipeline:</strong></p><pre>import neo4j<br>from datetime import datetime<br><br>driver = neo4j.GraphDatabase.driver(<br>    &quot;bolt://localhost:7687&quot;,<br>    auth=(&quot;neo4j&quot;, &quot;password&quot;)<br>)<br><br>def ingest_customer_graph(customer_id):<br>    &quot;&quot;&quot;<br>    Build complete customer subgraph from all data sources<br>    &quot;&quot;&quot;<br>    with driver.session() as session:<br>        # 1. Create customer node<br>        customer = internal_api.get_customer(customer_id)<br>        <br>        session.run(&quot;&quot;&quot;<br>            MERGE (c:Customer {id: $id})<br>            SET c.name = $name,<br>                c.age = $age,<br>                c.segment = $segment,<br>                c.risk_profile = $risk_profile,<br>                c.last_updated = datetime()<br>        &quot;&quot;&quot;, **customer)<br>        <br>        # 2. Ingest internal accounts (Retail, Wealth, Corporate, Private)<br>        internal_accounts = internal_api.get_accounts(customer_id)<br>        <br>        for account in internal_accounts:<br>            # Load contract for normalization<br>            contract = get_contract(&quot;internal&quot;, &quot;account_balance_v2&quot;)<br>            <br>            # Normalize data using contract semantics<br>            normalized = {<br>                &quot;id&quot;: account.id,<br>                &quot;balance_pence&quot;: normalize_balance(account.balance, contract),<br>                &quot;currency&quot;: account.currency,<br>                &quot;type&quot;: account.type,<br>                &quot;source_bank&quot;: &quot;internal&quot;,<br>                &quot;contract_id&quot;: contract.contract_id,<br>                &quot;last_updated&quot;: datetime.now()<br>            }<br>            <br>            # Apply business rules<br>            normalized[&quot;liquid&quot;] = apply_liquidity_rules(normalized)<br>            <br>            # Create account node<br>            session.run(&quot;&quot;&quot;<br>                MERGE (a:Account {id: $id})<br>                SET a += $properties<br>            &quot;&quot;&quot;, id=account.id, properties=normalized)<br>            <br>            # Create ownership relationship<br>            session.run(&quot;&quot;&quot;<br>                MATCH (c:Customer {id: $customer_id})<br>                MATCH (a:Account {id: $account_id})<br>                MERGE (c)-[:OWNS]-&gt;(a)<br>            &quot;&quot;&quot;, customer_id=customer_id, account_id=account.id)<br>        <br>        # 3. Ingest external accounts (Open Banking)<br>        external_accounts = open_banking_api.get_accounts(<br>            customer_id=customer_id,<br>            consent_token=get_consent_token(customer_id)<br>        )<br>        <br>        for account in external_accounts:<br>            # Load external bank&#39;s contract<br>            contract = get_contract(account.bank_id, &quot;account_balance_v1&quot;)<br>            <br>            # Normalize using external bank&#39;s contract<br>            normalized = {<br>                &quot;id&quot;: account.iban,<br>                &quot;balance_pence&quot;: normalize_balance(account.balance, contract),<br>                &quot;currency&quot;: account.currency,<br>                &quot;bank_identifier&quot;: account.bank_id,<br>                &quot;consent_status&quot;: &quot;active&quot;,<br>                &quot;consent_expiry&quot;: account.consent_expiry,<br>                &quot;source_bank&quot;: account.bank_id,<br>                &quot;contract_id&quot;: contract.contract_id,<br>                &quot;last_updated&quot;: datetime.now()<br>            }<br>            <br>            normalized[&quot;liquid&quot;] = apply_liquidity_rules(normalized)<br>            <br>            # Create external account node<br>            session.run(&quot;&quot;&quot;<br>                MERGE (e:ExternalAccount {id: $id})<br>                SET e += $properties<br>            &quot;&quot;&quot;, id=account.iban, properties=normalized)<br>            <br>            # Create ownership relationship<br>            session.run(&quot;&quot;&quot;<br>                MATCH (c:Customer {id: $customer_id})<br>                MATCH (e:ExternalAccount {id: $account_id})<br>                MERGE (c)-[:OWNS]-&gt;(e)<br>            &quot;&quot;&quot;, customer_id=customer_id, account_id=account.iban)<br>        <br>        # 4. Ingest portfolios<br>        portfolios = wealth_api.get_portfolios(customer_id)<br>        <br>        for portfolio in portfolios:<br>            session.run(&quot;&quot;&quot;<br>                MERGE (p:Portfolio {id: $id})<br>                SET p.strategy = $strategy,<br>                    p.total_value_pence = $total_value,<br>                    p.liquid_value_pence = $liquid_value,<br>                    p.last_updated = datetime()<br>            &quot;&quot;&quot;, **portfolio)<br>            <br>            session.run(&quot;&quot;&quot;<br>                MATCH (c:Customer {id: $customer_id})<br>                MATCH (p:Portfolio {id: $portfolio_id})<br>                MERGE (c)-[:OWNS]-&gt;(p)<br>            &quot;&quot;&quot;, customer_id=customer_id, portfolio_id=portfolio.id)<br>        <br>        # 5. Ingest goals<br>        goals = get_customer_goals(customer_id)<br>        <br>        for goal in goals:<br>            session.run(&quot;&quot;&quot;<br>                MERGE (g:Goal {id: $id})<br>                SET g.type = $type,<br>                    g.target_amount_pence = $target_amount,<br>                    g.target_date = date($target_date),<br>                    g.last_updated = datetime()<br>            &quot;&quot;&quot;, **goal)<br>            <br>            session.run(&quot;&quot;&quot;<br>                MATCH (c:Customer {id: $customer_id})<br>                MATCH (g:Goal {id: $goal_id})<br>                MERGE (c)-[:HAS_GOAL]-&gt;(g)<br>            &quot;&quot;&quot;, customer_id=customer_id, goal_id=goal.id)<br>        <br>        # 6. Ingest recent transactions (last 6 months)<br>        transactions = transaction_api.get_transactions(<br>            customer_id=customer_id,<br>            since=datetime.now() - timedelta(days=180)<br>        )<br>        <br>        for txn in transactions:<br>            session.run(&quot;&quot;&quot;<br>                MERGE (t:Transaction {id: $id})<br>                SET t.amount_pence = $amount,<br>                    t.timestamp = datetime($timestamp),<br>                    t.category = $category,<br>                    t.merchant_name = $merchant,<br>                    t.merchant_country = $country<br>            &quot;&quot;&quot;, **txn)<br>            <br>            session.run(&quot;&quot;&quot;<br>                MATCH (a:Account {id: $account_id})<br>                MATCH (t:Transaction {id: $txn_id})<br>                MERGE (a)-[:HAS_TRANSACTION]-&gt;(t)<br>            &quot;&quot;&quot;, account_id=txn.account_id, txn_id=txn.id)<br><br># Run for all customers<br>for customer_id in get_all_customer_ids():<br>    ingest_customer_graph(customer_id)</pre><h4>Graph Queries for Banking Operations</h4><p><strong>Query 1: Customer 360 view</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eVLQxuG9JjI5fWCk4gQiwA.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*J1mUK2uJ2W1UPHLL-7hdlg.gif" /></figure><pre>cypher<br><br>// Get complete financial picture<br>MATCH (c:Customer {id: &quot;CUST_X&quot;})<br>OPTIONAL MATCH (c)-[:OWNS]-&gt;(a:Account)<br>OPTIONAL MATCH (c)-[:OWNS]-&gt;(p:Portfolio)<br>OPTIONAL MATCH (c)-[:OWNS]-&gt;(e:ExternalAccount)<br>OPTIONAL MATCH (c)-[:HAS_GOAL]-&gt;(g:Goal)<br>RETURN<br>    c.name as customer_name,<br>    collect(DISTINCT {<br>        type: &#39;account&#39;,<br>        id: a.id,<br>        balance: a.balance_pence,<br>        liquid: a.liquid,<br>        source: a.source_bank<br>    }) as internal_accounts,<br>    collect(DISTINCT {<br>        type: &#39;portfolio&#39;,<br>        id: p.id,<br>        value: p.total_value_pence,<br>        strategy: p.strategy<br>    }) as portfolios,<br>    collect(DISTINCT {<br>        type: &#39;external&#39;,<br>        id: e.id,<br>        balance: e.balance_pence,<br>        bank: e.bank_identifier<br>    }) as external_accounts,<br>    collect(DISTINCT {<br>        type: &#39;goal&#39;,<br>        goal_type: g.type,<br>        target: g.target_amount_pence,<br>        date: g.target_date<br>    }) as goals</pre><p><strong>Query 2: Liquid assets only</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*xNcTQXGoPr45t3ulwh3D7g.gif" /></figure><pre>// Find all liquid assets for emergency fund check<br>cypher<br>MATCH (c:Customer {id: &quot;CUST_X&quot;})-[:OWNS]-&gt;(asset)<br>WHERE asset.liquid = true<br>RETURN sum(asset.balance_pence) as total_liquid_pence</pre><p><strong>Query 3: Cross-bank account linking</strong></p><pre>Cypher<br>// Find customers with both internal and external accounts<br>MATCH (c:Customer)-[:OWNS]-&gt;(internal:Account {source_bank: &quot;internal&quot;})<br>MATCH (c)-[:OWNS]-&gt;(external:ExternalAccount)<br>WHERE external.consent_status = &quot;active&quot;<br>RETURN<br>    c.id as customer_id,<br>    count(DISTINCT internal) as internal_count,<br>    count(DISTINCT external) as external_count,<br>    sum(internal.balance_pence + external.balance_pence) as total_balance_pence</pre><p><strong>Query 4: Transaction velocity (fraud detection)</strong></p><pre>Cypher<br>// Detect unusual transaction patterns<br>MATCH (c:Customer {id: &quot;CUST_X&quot;})-[:OWNS]-&gt;(a:Account)-[:HAS_TRANSACTION]-&gt;(t:Transaction)<br>WHERE t.timestamp &gt; datetime() - duration({hours: 24})<br>WITH c, count(t) as txn_count_24h, sum(t.amount_pence) as total_amount_24h<br><br>MATCH (c)-[:OWNS]-&gt;(a:Account)-[:HAS_TRANSACTION]-&gt;(t:Transaction)<br>WHERE t.timestamp &gt; datetime() - duration({days: 30})<br>      AND t.timestamp &lt;= datetime() - duration({hours: 24})<br>WITH c, txn_count_24h, total_amount_24h,<br>     count(t) / 30.0 as avg_daily_txn_count,<br>     sum(t.amount_pence) / 30.0 as avg_daily_amount<br><br>WHERE txn_count_24h &gt; avg_daily_txn_count * 5<br>   OR total_amount_24h &gt; avg_daily_amount * 10<br><br>RETURN<br>    c.id as customer_id,<br>    txn_count_24h,<br>    avg_daily_txn_count,<br>    total_amount_24h,<br>    avg_daily_amount,<br>    &quot;SUSPICIOUS_VELOCITY&quot; as flag</pre><p><strong>Query 5: Funding path analysis</strong></p><pre>// Find optimal paths to fund a goal<br>Cypher<br>MATCH (c:Customer {id: &quot;CUST_X&quot;})-[:HAS_GOAL]-&gt;(g:Goal {type: &quot;house_deposit&quot;})<br>MATCH (c)-[:OWNS]-&gt;(asset)<br>WHERE asset.liquid = true OR asset:Portfolio<br>RETURN<br>    asset.id as asset_id,<br>    labels(asset)[0] as asset_type,<br>    asset.balance_pence as available_pence,<br>    asset.liquid as is_liquid,<br>    CASE<br>        WHEN asset:Account AND asset.withdrawal_penalty_pence IS NOT NULL<br>            THEN asset.withdrawal_penalty_pence<br>        WHEN asset:Portfolio<br>            THEN asset.estimated_cgt_pence<br>        ELSE 0<br>    END as cost_pence,<br>    g.target_amount_pence as goal_amount<br>ORDER BY cost_pence ASC, is_liquid DESC</pre><h4>Graph Query Optimization</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*iCkidlrBgNNl6WRz6dev0w.gif" /></figure><p><strong>Index strategy:</strong></p><pre>Cypher<br>// Customer lookups (most frequent)<br>CREATE INDEX customer_id_idx FOR (c:Customer) ON (c.id);<br>// Account queries<br>CREATE INDEX account_source_idx FOR (a:Account) ON (a.source_bank);<br>CREATE INDEX account_liquid_idx FOR (a:Account) ON (a.liquid);</pre><pre>// Transaction queries (time-range filters)<br>CREATE INDEX transaction_timestamp_idx FOR (t:Transaction) ON (t.timestamp);</pre><pre>// Composite index for fraud detection<br>CREATE INDEX fraud_detection_idx FOR (t:Transaction) ON (t.merchant_country, t.amount_pence);</pre><p><strong>Query performance:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L5O_zODevV8coOd-y-ijPQ.png" /></figure><h4>Part 5: Agentic Queries on Knowledge Graph</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xGNrrLvldn_wHLwBRJwe7A.gif" /></figure><h4>How Agents Query the Graph</h4><p><strong>Agent workflow:</strong></p><ol><li><strong>Receive request:</strong> “Fund £200K house deposit minimizing cost”</li><li><strong>Translate to Cypher:</strong> Convert natural language to graph query</li><li><strong>Execute query:</strong> Fetch relevant subgraph</li><li><strong>Apply business rules:</strong> Filter based on liquidity, penalties, taxes</li><li><strong>Return structured result:</strong> List of funding sources with costs</li></ol><p><strong>Example: Agent code</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1DMLNrUdgRttQFu98v-7Qw.gif" /></figure><pre>class FundingAgent:<br>    def __init__(self, graph_driver, rule_engine):<br>        self.graph = graph_driver<br>        self.rules = rule_engine<br>        <br>    def find_optimal_funding(self, customer_id, target_amount_pence):<br>        &quot;&quot;&quot;<br>        Find optimal mix of assets to fund a target amount<br>        &quot;&quot;&quot;<br>        # Query 1: Get all assets<br>        assets = self.graph.execute_read(self._get_assets, customer_id)<br>        <br>        # Query 2: Apply business rules<br>        for asset in assets:<br>            asset = self.rules.evaluate(asset, asset[&#39;type&#39;])<br>        <br>        # Query 3: Optimize<br>        funding_mix = self._optimize_funding(assets, target_amount_pence)<br>        <br>        return funding_mix<br>    <br>    @staticmethod<br>    def _get_assets(tx, customer_id):<br>        result = tx.run(&quot;&quot;&quot;<br>            MATCH (c:Customer {id: $customer_id})-[:OWNS]-&gt;(asset)<br>            WHERE asset:Account OR asset:Portfolio OR asset:ExternalAccount<br>            RETURN<br>                asset.id as id,<br>                labels(asset)[0] as type,<br>                asset.balance_pence as balance,<br>                asset.liquid as liquid,<br>                asset.withdrawal_penalty_pence as penalty,<br>                asset.source_bank as source<br>        &quot;&quot;&quot;, customer_id=customer_id)<br>        <br>        return [record.data() for record in result]<br>    <br>    def _optimize_funding(self, assets, target_amount):<br>        &quot;&quot;&quot;<br>        Greedy algorithm: prioritize by cost per pound<br>        &quot;&quot;&quot;<br>        # Sort by cost<br>        sorted_assets = sorted(assets, key=lambda a: self._calculate_cost(a))<br>        <br>        mix = []<br>        remaining = target_amount<br>        <br>        for asset in sorted_assets:<br>            if remaining &lt;= 0:<br>                break<br>                <br>            amount_to_use = min(asset[&#39;balance&#39;], remaining)<br>            cost = self._calculate_cost(asset, amount_to_use)<br>            <br>            mix.append({<br>                &#39;asset_id&#39;: asset[&#39;id&#39;],<br>                &#39;amount_pence&#39;: amount_to_use,<br>                &#39;cost_pence&#39;: cost,<br>                &#39;reason&#39;: self._get_reason(asset)<br>            })<br>            <br>            remaining -= amount_to_use<br>        <br>        return {<br>            &#39;funding_mix&#39;: mix,<br>            &#39;total_amount&#39;: target_amount,<br>            &#39;total_cost&#39;: sum(m[&#39;cost_pence&#39;] for m in mix)<br>        }<br>    <br>    def _calculate_cost(self, asset, amount=None):<br>        &quot;&quot;&quot;<br>        Calculate cost of accessing funds from this asset<br>        &quot;&quot;&quot;<br>        if amount is None:<br>            amount = asset[&#39;balance&#39;]<br>            <br>        if not asset[&#39;liquid&#39;]:<br>            # Not liquid = infinite cost<br>            return float(&#39;inf&#39;)<br>            <br>        cost = 0<br>        <br>        # Withdrawal penalty<br>        if asset.get(&#39;penalty&#39;):<br>            cost += asset[&#39;penalty&#39;]<br>        <br>        # Capital gains tax (for portfolios)<br>        if asset[&#39;type&#39;] == &#39;Portfolio&#39;:<br>            # Simplified: 20% CGT on gains<br>            cost += amount * 0.10  # Assuming 50% is gains<br>        <br>        # Opportunity cost (lost interest)<br>        if asset.get(&#39;interest_rate&#39;):<br>            # 6 months lost interest<br>            cost += amount * asset[&#39;interest_rate&#39;] * 0.5<br>        <br>        return cost<br>    <br>    def _get_reason(self, asset):<br>        &quot;&quot;&quot;<br>        Generate human-readable reason<br>        &quot;&quot;&quot;<br>        if asset[&#39;type&#39;] == &#39;Account&#39; and asset[&#39;liquid&#39;] and not asset.get(&#39;penalty&#39;):<br>            return f&quot;{asset[&#39;type&#39;]} - fully liquid, no penalty&quot;<br>        elif asset[&#39;type&#39;] == &#39;ExternalAccount&#39;:<br>            return f&quot;External account - liquid, opportunity cost (lost interest)&quot;<br>        elif asset[&#39;type&#39;] == &#39;Portfolio&#39;:<br>            return f&quot;Portfolio - sell stocks, estimated CGT&quot;<br>        else:<br>            return f&quot;{asset[&#39;type&#39;]}&quot;<br><br># Usage<br>agent = FundingAgent(graph_driver, rule_engine)<br>result = agent.find_optimal_funding(&quot;CUST_X&quot;, 20000000)  # £200K<br><br>print(json.dumps(result, indent=2))</pre><h4>Part 6: Implementation Roadmap</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*jW9JwDhoBTOOjFlPoLL_HQ.gif" /></figure><h4>Phase 1: Ontology Design (Weeks 1–2)</h4><p><strong>Deliverables:</strong></p><ol><li>Banking ontology (OWL format)</li><li>Core concepts documented</li><li>Relationship semantics defined</li><li>Constraints specified</li></ol><p><strong>Tools:</strong></p><ul><li>Protégé (ontology editor)</li><li>GitHub (version control)</li></ul><h4>Phase 2: Business Rules (Weeks 3–4)</h4><p><strong>Deliverables:</strong></p><ol><li>Rules in YAML format</li><li>Rule engine implementation</li><li>Test suite (100+ test cases)</li><li>Documentation for business users</li></ol><h4>Phase 3: Graph Database Setup (Weeks 5–6)</h4><p><strong>Deliverables:</strong></p><ol><li>Neo4j cluster deployed</li><li>Schema constraints applied</li><li>Indices created</li><li>Backup/restore procedures</li></ol><h4>Phase 4: Graph Ingestion (Weeks 7–10)</h4><p><strong>Deliverables:</strong></p><ol><li>Ingestion pipeline (internal + external)</li><li>Contract normalization layer</li><li>Data quality validation</li><li>Incremental sync mechanism</li></ol><h4>Phase 5: Agent Integration (Weeks 11–14)</h4><p><strong>Deliverables:</strong></p><ol><li>Agent query library</li><li>Graph query optimization</li><li>Performance testing</li><li>Production deployment</li></ol><h3>Part 7: Key Takeaways</h3><h4>Why This Matters</h4><p><strong>Without ontologies + business rules + graph:</strong></p><ul><li>Agents guess semantics (is £5000 in pounds or pence?)</li><li>Rules scattered in code (no audit trail)</li><li>Data siloed by system (no unified view)</li><li>Slow N+1 queries (multiple API calls)</li><li>No explainability (black box decisions)</li></ul><p><strong>With ontologies + business rules + graph:</strong></p><ul><li>✅ Formal semantics (balance_pence: integer in minor units)</li><li>✅ Declarative rules (LIQ-002: ISA → not liquid, auditable YAML)</li><li>✅ Unified graph (internal + external + goals, one query)</li><li>✅ Fast traversals (one Cypher query vs N+1 REST calls)</li><li>✅ Full explainability (graph paths + rule applications visible)</li></ul><h4>The Three-Layer Stack</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*2udbFNtbzo4xwsmMeorWOA.gif" /></figure><p><strong>Layer 1: Ontology</strong> — What concepts exist?</p><ul><li>Classes: Account, Customer, Portfolio, Transaction</li><li>Properties: balance, liquid, penalty, interest_rate</li><li>Relationships: owns, linkedTo, funds, hasGoal</li><li>Constraints: cardinality, value ranges, axioms</li></ul><p><strong>Layer 2: Business Rules</strong> — What logic applies?</p><ul><li>Liquidity classification (LIQ-001 through LIQ-004)</li><li>Eligibility checks (MORT-001, LOAN-001)</li><li>Fraud detection (FRAUD-001, FRAUD-002)</li><li>Cross-sell triggers (CROSS-001, CROSS-002)</li></ul><p><strong>Layer 3: Knowledge Graph</strong> — Where is the data?</p><ul><li>Nodes: 2.3M entities (customers, accounts, portfolios, transactions)</li><li>Edges: 8.7M relationships (owns, linkedTo, funds, hasTransaction)</li><li>Queries: Cypher (declarative graph queries)</li><li>Performance: &lt;50ms for 90% of queries</li></ul><h4>ROI: Numbers That Matter</h4><p><strong>Development velocity:</strong></p><ul><li>Traditional: 12–16 weeks per use case</li><li>With graph: Same day (query graph differently)</li></ul><p><strong>Data quality:</strong></p><ul><li>Traditional: 30–40% inconsistencies across systems</li><li>With contracts + ontology: &lt;2% (normalized at ingestion)</li></ul><p><strong>Agent accuracy:</strong></p><ul><li>Without semantics: 60–70% (guessing units, types)</li><li>With ontology + rules: 95–98% (formal guarantees)</li></ul><p><strong>Query performance:</strong></p><ul><li>N+1 API calls: 500–1200ms</li><li>Graph traversal: 15–50ms (10–30x faster)</li></ul><h3>Conclusion</h3><p><strong>Agentic AI demands semantic precision.</strong></p><p>In Open Banking, where agents coordinate financial operations across multiple institutions at machine speed, <strong>guessing is not an option</strong>.</p><p><strong>Ontologies</strong> define concepts formally. <strong>Business rules</strong> encode domain logic declaratively. <strong>Knowledge graphs</strong> provide the unified data layer.</p><p>Together, they create the semantic foundation that makes agents:</p><ul><li><strong>Trustworthy:</strong> Formal guarantees on data meaning</li><li><strong>Explainable:</strong> Graph paths + rule applications visible</li><li><strong>Fast:</strong> Single queries vs N+1 calls</li><li><strong>Auditable:</strong> YAML rules + OWL ontology + Cypher queries = complete trail</li></ul><p><strong>Build your semantic stack. Make your agents trustworthy.</strong></p><h3>References</h3><ul><li><strong>Web Ontology Language (OWL):</strong> <a href="https://www.w3.org/OWL/">https://www.w3.org/OWL/</a></li><li><strong>Neo4j Graph Database:</strong> <a href="https://neo4j.com/">https://neo4j.com</a></li><li><strong>Open Data Contract Standard (ODCS):</strong> <a href="https://github.com/bitol-io/open-data-contract-standard">https://github.com/bitol-io/open-data-contract-standard</a></li><li><strong>Cypher Query Language:</strong> <a href="https://neo4j.com/developer/cypher/">https://neo4j.com/developer/cypher/</a></li><li><strong>Open Banking UK Standards:</strong> <a href="https://www.openbanking.org.uk/">https://www.openbanking.org.uk/</a></li><li><strong>Protégé Ontology Editor:</strong> <a href="https://protege.stanford.edu/">https://protege.stanford.edu/</a></li></ul><h3>Formal Model Catalogue behind Agentic AI in Open Banking’s Knowledge Graph</h3><p>Related to Ontology:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ovbi4pxGAonaTc945Qr15A.png" /></figure><p>Related to Metadata</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hLVEL7Dgo9cqivWFQnIOBQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W-oFwouAR6pOXzyYfU5aTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*43e3sKh7jfPUZdWVj-cJyw.png" /></figure><p>Related to Lineage</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S1AILGNhhlbZB98kwd1qUw.png" /></figure><p>Related to contract</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*771eQ6UV4I6ULP_vR5Dktg.png" /></figure><p>Entity Resolution</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IPzwMwVG4R5apumdFyh-7Q.png" /></figure><p>Graph Related</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CPipKyGhH9Lbtoe2cfqr6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*69WdaGbuj1h2mGXOrZhIoA.png" /></figure><p>Business Rules related</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ow-Swh2Vqny3XMHkJqSVqw.png" /></figure><p>Related to Access policy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g9AWcOn6qhTa9C3mr5cc6g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lY1D8vkIeUVqqBH49I3tNw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37d0d43671ff" width="1" height="1" alt=""><hr><p><a href="https://medium.com/youme-technology/day-71-1-4-agentic-ai-in-open-banking-ontologies-business-rules-and-knowledge-graph-37d0d43671ff">Day 71 1.4: Agentic AI in Open Banking — Ontologies, Business Rules and Knowledge Graph &amp; Models</a> was originally published in <a href="https://medium.com/youme-technology">AI Smart</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 71 1.5: Agentic AI in Open Banking — MCP Federated Execution]]></title>
            <link>https://medium.com/youme-technology/day-71-1-5-agentic-ai-in-open-banking-mcp-federated-execution-e8ec91a513fb?source=rss----9f2a2586502---4</link>
            <guid isPermaLink="false">https://medium.com/p/e8ec91a513fb</guid>
            <category><![CDATA[finance-and-banking]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[open-banking]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[LAKSHMI VENKATESH]]></dc:creator>
            <pubDate>Tue, 19 May 2026 12:48:44 GMT</pubDate>
            <atom:updated>2026-05-19T12:48:45.811Z</atom:updated>
            <content:encoded><![CDATA[<h3>Model Context Protocol (MCP) for Open Banking</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*qm3nfqbxum1VVPLkvCfeaw.gif" /></figure><p><strong>What MCP provides:</strong></p><ul><li>Standardized protocol for connecting AI models to tools</li><li>Tool discovery (what tools are available?)</li><li>Tool invocation (execute tool with parameters)</li><li>Bidirectional communication (model ↔ tool)</li></ul><p><strong>Applied to Open Banking:</strong></p><pre>MCP Server = Bank&#39;s Open Banking API Gateway<br>MCP Tools = API endpoints exposed as callable functions<br>MCP Client = Agentic AI orchestration engine</pre><h4>Internal vs External MCP Servers</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*8AK40ifF0CNb1V0fUXTYzg.gif" /></figure><p><strong>Internal MCP Server (Your Bank):</strong></p><pre>mcp_server:<br>  name: &quot;internal_banking_mcp&quot;<br>  base_url: &quot;https://internal-api.example.com/mcp&quot;<br>  <br>tools:<br>  - name: &quot;retail_banking.get_balance&quot;<br>    description: &quot;Get balance from retail banking accounts&quot;<br>    contract_reference: &quot;account_balance_v2&quot;<br>    parameters:<br>      account_id:<br>        type: &quot;string&quot;<br>        format: &quot;UUID&quot;<br>        description: &quot;Internal account identifier&quot;<br>    returns:<br>      balance_pence: &quot;integer&quot;<br>      currency: &quot;string&quot;<br>      balance_type: &quot;string&quot;<br>      <br>  - name: &quot;retail_banking.transfer&quot;<br>    description: &quot;Transfer funds between internal accounts&quot;<br>    contract_reference: &quot;internal_transfer_v1&quot;<br>    parameters:<br>      from_account: &quot;string&quot;<br>      to_account: &quot;string&quot;<br>      amount_pence: &quot;integer&quot;<br>      reference: &quot;string&quot;<br>    returns:<br>      transaction_id: &quot;string&quot;<br>      status: &quot;string&quot;<br>      <br>  - name: &quot;wealth_management.sell_stocks&quot;<br>    description: &quot;Sell stocks from investment portfolio&quot;<br>    contract_reference: &quot;portfolio_trade_v1&quot;<br>    parameters:<br>      portfolio_id: &quot;string&quot;<br>      amount_pence: &quot;integer&quot;<br>      strategy: &quot;enum[tax_optimized, fastest, limit_order]&quot;<br>    returns:<br>      trade_id: &quot;string&quot;<br>      stocks_sold: &quot;array&quot;<br>      estimated_cgt: &quot;integer&quot;</pre><p><strong>External MCP Server (Partner Bank via Open Banking):</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*ZcVOyjFOPsS1JSJtLxHFrw.gif" /></figure><pre>mcp_server:<br>  name: &quot;external_bank_openbanking_mcp&quot;<br>  base_url: &quot;https://openbanking.partner-bank.com/mcp&quot;<br>  <br>tools:<br>  - name: &quot;accounts.get_balance&quot;<br>    description: &quot;Get balance from external account (requires consent)&quot;<br>    contract_reference: &quot;external_account_balance_v1&quot;<br>    parameters:<br>      account_id:<br>        type: &quot;string&quot;<br>        format: &quot;IBAN&quot;<br>        description: &quot;IBAN of external account&quot;<br>      consent_token:<br>        type: &quot;string&quot;<br>        description: &quot;OAuth 2.0 access token with account consent&quot;<br>    returns:<br>      balance_pence: &quot;integer&quot;<br>      currency: &quot;string&quot;<br>      <br>  - name: &quot;payments.initiate_domestic&quot;<br>    description: &quot;Initiate payment from external account (PSD2 payment initiation)&quot;<br>    contract_reference: &quot;psd2_payment_initiation_v1&quot;<br>    parameters:<br>      from_account: &quot;string (IBAN)&quot;<br>      to_account: &quot;string (IBAN)&quot;<br>      amount_pence: &quot;integer&quot;<br>      reference: &quot;string&quot;<br>      consent_mechanism: &quot;enum[CIBA, redirect, decoupled]&quot;<br>    returns:<br>      payment_id: &quot;string&quot;<br>      status: &quot;enum[pending, approved, rejected]&quot;<br>      approval_url: &quot;string (if redirect)&quot;</pre><h4>MCP Execution Flow</h4><p><strong>Step 1: Agent receives ML recommendation</strong></p><pre># From Part 5<br>recommendation = {<br>    &quot;Account_Retail&quot;: 5000000,  # £50K<br>    &quot;Account_BankB_Savings&quot;: 8000000,  # £80K<br>    &quot;Account_Portfolio&quot;: 7000000  # £70K<br>}</pre><p><strong>Step 2: Agent discovers MCP tools</strong></p><pre># Query MCP registry<br>tools = mcp_registry.discover_tools([<br>    &quot;transfer&quot;,<br>    &quot;sell_stocks&quot;,<br>    &quot;initiate_payment&quot;<br>])</pre><pre># Returns:<br>[<br>  {<br>    &quot;tool&quot;: &quot;retail_banking.transfer&quot;,<br>    &quot;server&quot;: &quot;internal_banking_mcp&quot;,<br>    &quot;contract&quot;: &quot;internal_transfer_v1&quot;<br>  },<br>  {<br>    &quot;tool&quot;: &quot;wealth_management.sell_stocks&quot;,<br>    &quot;server&quot;: &quot;internal_banking_mcp&quot;,<br>    &quot;contract&quot;: &quot;portfolio_trade_v1&quot;<br>  },<br>  {<br>    &quot;tool&quot;: &quot;payments.initiate_domestic&quot;,<br>    &quot;server&quot;: &quot;external_bank_openbanking_mcp&quot;,<br>    &quot;contract&quot;: &quot;psd2_payment_initiation_v1&quot;<br>  }<br>]</pre><p><strong>Step 3: Agent executes via MCP</strong></p><pre># Call 1: Internal transfer (retail → escrow)<br>result_1 = mcp.call(<br>    server=&quot;internal_banking_mcp&quot;,<br>    tool=&quot;retail_banking.transfer&quot;,<br>    parameters={<br>        &quot;from_account&quot;: &quot;ACC_RETAIL_123&quot;,<br>        &quot;to_account&quot;: &quot;ACC_ESCROW_DEPOSIT&quot;,<br>        &quot;amount_pence&quot;: 5000000,<br>        &quot;reference&quot;: &quot;House deposit funding - Part 1/3&quot;<br>    }<br>)<br><br># Middleware validates against contract before executing<br># Returns:<br>{<br>  &quot;transaction_id&quot;: &quot;TXN_001&quot;,<br>  &quot;status&quot;: &quot;completed&quot;,<br>  &quot;timestamp&quot;: &quot;2024-11-15T14:32:17Z&quot;<br>}<br># Call 2: Internal portfolio sale (wealth → escrow)<br>result_2 = mcp.call(<br>    server=&quot;internal_banking_mcp&quot;,<br>    tool=&quot;wealth_management.sell_stocks&quot;,<br>    parameters={<br>        &quot;portfolio_id&quot;: &quot;PORT_ABC&quot;,<br>        &quot;amount_pence&quot;: 7000000,<br>        &quot;strategy&quot;: &quot;tax_optimized&quot;,<br>        &quot;destination_account&quot;: &quot;ACC_ESCROW_DEPOSIT&quot;<br>    }<br>)<br># Returns:<br>{<br>  &quot;trade_id&quot;: &quot;TRADE_002&quot;,<br>  &quot;stocks_sold&quot;: [<br>    {&quot;symbol&quot;: &quot;XYZ&quot;, &quot;quantity&quot;: 100, &quot;gain_pence&quot;: 50000},<br>    {&quot;symbol&quot;: &quot;ABC&quot;, &quot;quantity&quot;: 50, &quot;gain_pence&quot;: 20000}<br>  ],<br>  &quot;estimated_cgt_pence&quot;: 420000,<br>  &quot;settlement_date&quot;: &quot;2024-11-17&quot;,<br>  &quot;status&quot;: &quot;executed&quot;<br>}<br># Call 3: External payment initiation (Bank B → your bank)<br>result_3 = mcp.call(<br>    server=&quot;external_bank_openbanking_mcp&quot;,<br>    tool=&quot;payments.initiate_domestic&quot;,<br>    parameters={<br>        &quot;from_account&quot;: &quot;GB29EXBN12345678901234&quot;,  # Bank B IBAN<br>        &quot;to_account&quot;: &quot;GB29YOURBANK_ESCROW&quot;,<br>        &quot;amount_pence&quot;: 8000000,<br>        &quot;reference&quot;: &quot;House deposit funding - Part 3/3&quot;,<br>        &quot;consent_mechanism&quot;: &quot;CIBA&quot;  # Push notification to customer&#39;s device<br>    }<br>)<br># Returns:<br>{<br>  &quot;payment_id&quot;: &quot;PAY_003_EXTB&quot;,<br>  &quot;status&quot;: &quot;pending_authorization&quot;,<br>  &quot;ciba_auth_request_id&quot;: &quot;AUTH_12345&quot;,<br>  &quot;message&quot;: &quot;Customer approval required via CIBA push notification&quot;<br>}<br># Agent waits for customer approval...<br># Customer approves on mobile device via biometric auth<br># Poll for status update<br>status = mcp.call(<br>    server=&quot;external_bank_openbanking_mcp&quot;,<br>    tool=&quot;payments.get_status&quot;,<br>    parameters={&quot;payment_id&quot;: &quot;PAY_003_EXTB&quot;}<br>)<br># Returns:<br>{<br>  &quot;payment_id&quot;: &quot;PAY_003_EXTB&quot;,<br>  &quot;status&quot;: &quot;authorized&quot;,<br>  &quot;authorized_at&quot;: &quot;2024-11-15T14:33:42Z&quot;,<br>  &quot;authorized_by&quot;: &quot;customer_biometric&quot;,<br>  &quot;settlement_status&quot;: &quot;in_progress&quot;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*8TnthhkqjpSSZx1CYD7nuA.gif" /></figure><p><strong>Step 4: Agent logs full execution trail</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*gl15jgr98qv7Suf-XGy-HA.gif" /></figure><pre>audit_log = {<br>    &quot;workflow_id&quot;: &quot;HOUSE_DEPOSIT_CUSTOMER_X&quot;,<br>    &quot;started_at&quot;: &quot;2024-11-15T14:32:00Z&quot;,<br>    &quot;completed_at&quot;: &quot;2024-11-15T14:33:50Z&quot;,<br>    &quot;duration_seconds&quot;: 110,<br>    <br>    &quot;knowledge_graph_query&quot;: {<br>        &quot;query&quot;: &quot;Get all accounts for Customer_X&quot;,<br>        &quot;results_count&quot;: 5,<br>        &quot;contracts_used&quot;: [&quot;account_balance_v2&quot;]<br>    },<br>    <br>    &quot;ml_prediction&quot;: {<br>        &quot;model&quot;: &quot;kumo_relational_foundation_v2&quot;,<br>        &quot;query&quot;: &quot;Optimal mix to fund £200K deposit minimizing tax + penalties&quot;,<br>        &quot;recommendation&quot;: {<br>            &quot;Account_Retail&quot;: 5000000,<br>            &quot;Account_BankB_Savings&quot;: 8000000,<br>            &quot;Account_Portfolio&quot;: 7000000<br>        },<br>        &quot;reasoning_path&quot;: [<br>            &quot;Excluded ISA (£15K penalty)&quot;,<br>            &quot;Excluded Corporate (business funds)&quot;,<br>            &quot;Tax-optimized portfolio sale&quot;<br>        ]<br>    },<br>    <br>    &quot;mcp_executions&quot;: [<br>        {<br>            &quot;server&quot;: &quot;internal_banking_mcp&quot;,<br>            &quot;tool&quot;: &quot;retail_banking.transfer&quot;,<br>            &quot;contract&quot;: &quot;internal_transfer_v1&quot;,<br>            &quot;parameters&quot;: {&quot;from&quot;: &quot;ACC_RETAIL_123&quot;, &quot;to&quot;: &quot;ACC_ESCROW&quot;, &quot;amount&quot;: 5000000},<br>            &quot;result&quot;: {&quot;transaction_id&quot;: &quot;TXN_001&quot;, &quot;status&quot;: &quot;completed&quot;},<br>            &quot;validated_against_contract&quot;: true,<br>            &quot;timestamp&quot;: &quot;2024-11-15T14:32:17Z&quot;<br>        },<br>        {<br>            &quot;server&quot;: &quot;internal_banking_mcp&quot;,<br>            &quot;tool&quot;: &quot;wealth_management.sell_stocks&quot;,<br>            &quot;contract&quot;: &quot;portfolio_trade_v1&quot;,<br>            &quot;parameters&quot;: {&quot;portfolio&quot;: &quot;PORT_ABC&quot;, &quot;amount&quot;: 7000000, &quot;strategy&quot;: &quot;tax_optimized&quot;},<br>            &quot;result&quot;: {&quot;trade_id&quot;: &quot;TRADE_002&quot;, &quot;cgt&quot;: 420000},<br>            &quot;validated_against_contract&quot;: true,<br>            &quot;timestamp&quot;: &quot;2024-11-15T14:32:45Z&quot;<br>        },<br>        {<br>            &quot;server&quot;: &quot;external_bank_openbanking_mcp&quot;,<br>            &quot;tool&quot;: &quot;payments.initiate_domestic&quot;,<br>            &quot;contract&quot;: &quot;psd2_payment_initiation_v1&quot;,<br>            &quot;parameters&quot;: {&quot;from&quot;: &quot;GB29EXBN...&quot;, &quot;to&quot;: &quot;GB29YOUR...&quot;, &quot;amount&quot;: 8000000},<br>            &quot;result&quot;: {&quot;payment_id&quot;: &quot;PAY_003_EXTB&quot;, &quot;status&quot;: &quot;authorized&quot;},<br>            &quot;validated_against_contract&quot;: true,<br>            &quot;customer_authorization&quot;: {<br>                &quot;mechanism&quot;: &quot;CIBA&quot;,<br>                &quot;authorized_at&quot;: &quot;2024-11-15T14:33:42Z&quot;,<br>                &quot;method&quot;: &quot;biometric&quot;<br>            },<br>            &quot;timestamp&quot;: &quot;2024-11-15T14:33:50Z&quot;<br>        }<br>    ],<br>    <br>    &quot;compliance&quot;: {<br>        &quot;psd2_article_36&quot;: &quot;Payment account access authorized&quot;,<br>        &quot;gdpr_article_6&quot;: &quot;Consent obtained via OAuth 2.0&quot;,<br>        &quot;strong_customer_authentication&quot;: &quot;CIBA biometric approval&quot;,<br>        &quot;contracts_validated&quot;: [&quot;account_balance_v2&quot;, &quot;internal_transfer_v1&quot;, &quot;psd2_payment_initiation_v1&quot;]<br>    },<br>    <br>    &quot;outcome&quot;: {<br>        &quot;total_funded_pence&quot;: 20000000,<br>        &quot;total_cost_pence&quot;: 630000,<br>        &quot;accounts_used&quot;: 3,<br>        &quot;mcp_calls&quot;: 3,<br>        &quot;execution_time_seconds&quot;: 110<br>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*ku-nMV1pToM1wLO7gETrMg.gif" /></figure><h3>Full stack diagram — Complete Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UFdObwkt5ImbCkQWkiOz5A.gif" /></figure><pre>Details:<br>┌─────────────────────────────────────────────────┐<br>│      Agentic AI Orchestration Engine            │<br>│  (Perceive → Reason → Plan → Act loop)          │<br>└──────────────────┬──────────────────────────────┘<br>                   ↓<br>┌─────────────────────────────────────────────────┐<br>│   Zero-Shot ML Prediction (Kumo / PGN)         │<br>│  • Queries Knowledge Graph                      │<br>│  • Returns prediction + reasoning path          │<br>│  • No training required                         │<br>└──────────────────┬──────────────────────────────┘<br>                   ↓<br>┌─────────────────────────────────────────────────┐<br>│   Knowledge Graph (Built from Contracts)        │<br>│  • Entities: Customer, Account, Portfolio, etc  │<br>│  • Relationships: owns, partOf, linkedTo        │<br>│  • Unified view across internal + external      │<br>└──────────────────┬──────────────────────────────┘<br>                   ↓<br>┌─────────────────────────────────────────────────┐<br>│   MCP Tool Discovery &amp; Execution Layer          │<br>│  • Internal MCP Server (your bank)              │<br>│  • External MCP Servers (Open Banking partners) │<br>│  • Contract-validated tool catalog              │<br>└──────────────────┬──────────────────────────────┘<br>                   ↓<br>┌─────────────────────────────────────────────────┐<br>│   Middleware Control Plane                      │<br>│  • OBO token validation (sub + act claims)      │<br>│  • Contract validation gateway    ← NEW LAYER   │<br>│  • Circuit breakers on violations               │<br>│  • Centralized logging &amp; audit                  │<br>└──────────────────┬──────────────────────────────┘<br>                   ↓<br>         ┌─────────┴─────────┐<br>         ↓                   ↓<br>┌──────────────────┐  ┌─────────────────────┐<br>│ Internal Open    │  │  External Open      │<br>│ Banking APIs     │  │  Banking APIs       │<br>│                  │  │                     │<br>│ Retail Banking   │  │  Partner Bank A     │<br>│ Wealth Mgmt      │  │  Partner Bank B     │<br>│ Corporate        │  │  Partner Bank C     │<br>│ Private Banking  │  │  Fintech Partners   │<br>│                  │  │                     │<br>│ Each exposes     │  │  Each publishes     │<br>│ contracts        │  │  contracts          │<br>└──────────────────┘  └─────────────────────┘</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*4jcICxN6Q77WugqL-fVmWQ.gif" /></figure><h4>Data Flow Example</h4><p><strong>Customer Request:</strong></p><blockquote><em>“I’m buying a house. What’s the best way to fund a £200K deposit using all my resources?”</em></blockquote><p><strong>Flow:</strong></p><ol><li><strong>Agentic AI Orchestration</strong> receives request</li><li><strong>Knowledge Graph Query:</strong></li></ol><p>cypher</p><pre>MATCH (c:Customer {id: &quot;X&quot;})-[:OWNS]-&gt;(a:Account)<br>   RETURN a</pre><p><strong>Returns:</strong> 5 accounts (4 internal, 1 external)</p><p><strong>3. Zero-Shot ML Prediction:</strong></p><pre>prediction = kumo.predict(<br>       graph=knowledge_graph,<br>       query=&quot;Optimal £200K mix minimizing tax + penalties&quot;,<br>       context=[&quot;liquidity&quot;, &quot;tax&quot;, &quot;interest_rates&quot;]<br>   )</pre><p><strong>Returns:</strong> Use Retail £50K + Portfolio £70K + External £80K</p><p><strong>4. MCP Execution:</strong></p><ul><li>Internal tool: retail_banking.transfer(50000)</li><li>Internal tool: wealth_management.sell_stocks(70000, tax_optimized)</li><li>External tool: external_bank.initiate_payment(80000, CIBA)</li></ul><p><strong>5. Middleware Validation:</strong></p><ul><li>Loads contracts for all 3 calls</li><li>Validates parameters against contract schemas</li><li>Validates responses against contract guarantees</li><li>Logs execution with contract versions</li></ul><p><strong>6. Result:</strong></p><ul><li>£200K funded</li><li>£6.3K total cost</li><li>110 seconds execution time</li><li>Full audit trail with contract compliance</li></ul><h3>Implementation Guide</h3><h4>Phase 1: Contract Repository (Weeks 1–2)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*uABEMoG24jT3Cu9LIRmCVw.gif" /></figure><p><strong>Step 1: Choose contract format</strong></p><ul><li>Adopt ODCS YAML format</li><li>Create contract schema (see Part 2 example)</li><li>Set up version control (Git)</li></ul><p><strong>Step 2: Initial contracts</strong></p><ul><li>Start with highest-traffic APIs</li><li>/accounts/{id}/balance (most critical)</li><li>/accounts/{id}/transactions</li><li>Internal transfer endpoints</li></ul><p><strong>Step 3: Contract registry</strong></p><pre># Create contract repository<br>mkdir -p contracts/{banking,wealth,corporate,private}</pre><pre># Publish first contract<br>contracts/banking/accounts/balance_v1.yaml</pre><pre># Set up CI/CD validation<br># On commit: validate YAML schema<br># On merge: publish to production registry</pre><p><strong>Step 4: Developer adoption</strong></p><pre># Middleware loads contract on startup<br>contract = load_contract(&quot;account_balance_v1&quot;)</pre><pre># Generate OpenAPI spec from contract<br>openapi_spec = contract.to_openapi()</pre><pre># Auto-generate client SDKs<br>sdk = generate_sdk(contract, language=&quot;python&quot;)</pre><h4>Phase 2: Middleware Integration (Weeks 3–6)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*oC9LDP3qVcCbg28amtpr3Q.gif" /></figure><p><strong>Step 1: Add contract validation layer</strong></p><pre># middleware/contract_validator.py<br>class ContractValidator:<br>    def __init__(self, registry_url):<br>        self.registry = ContractRegistry(registry_url)<br>        self.cache = {}<br>        <br>    def validate_request(self, endpoint, method, params):<br>        # Load contract<br>        contract = self.get_contract(endpoint, method)<br>        <br>        # Validate parameters<br>        errors = []<br>        for param_name, param_schema in contract.parameters.items():<br>            if param_name not in params and param_schema.required:<br>                errors.append(f&quot;Missing required parameter: {param_name}&quot;)<br>                <br>            if param_name in params:<br>                param_value = params[param_name]<br>                if not self.validate_type(param_value, param_schema.type):<br>                    errors.append(f&quot;Invalid type for {param_name}&quot;)<br>                    <br>        if errors:<br>            raise ValidationError(errors)<br>            <br>        return contract<br>        <br>    def validate_response(self, contract, response):<br>        # Schema validation<br>        schema_errors = validate_json_schema(response, contract.schema)<br>        <br>        # Semantic validation<br>        semantic_errors = []<br>        if contract.semantics.balance_units == &quot;minor_currency&quot;:<br>            if not isinstance(response.balance, int):<br>                semantic_errors.append(&quot;Balance must be integer in minor units&quot;)<br>                <br>        # SLA validation<br>        if response.latency_ms &gt; contract.quality.sla.p95_latency_ms:<br>            log_sla_breach(contract, response.latency_ms)<br>            <br>        all_errors = schema_errors + semantic_errors<br>        if all_errors:<br>            raise ContractViolationError(all_errors)<br>            <br>        return True</pre><p><strong>Step 2: Integrate into API gateway</strong></p><pre># api_gateway/middleware.py<br>@app.route(&#39;/accounts/&lt;account_id&gt;/balance&#39;)<br>def get_balance(account_id):<br>    # 1. Load contract<br>    contract = validator.validate_request(<br>        endpoint=&quot;/accounts/{id}/balance&quot;,<br>        method=&quot;GET&quot;,<br>        params={&quot;account_id&quot;: account_id}<br>    )<br>    <br>    # 2. Call backend API<br>    start_time = time.time()<br>    response = backend_api.get_balance(account_id)<br>    latency_ms = (time.time() - start_time) * 1000<br>    <br>    # 3. Validate response<br>    try:<br>        validator.validate_response(contract, response)<br>    except ContractViolationError as e:<br>        # Log violation<br>        logger.error(f&quot;Contract violation: {e}&quot;)<br>        <br>        # Circuit breaker<br>        circuit_breaker.record_failure(contract.contract_id)<br>        <br>        # Return error to caller<br>        return {&quot;error&quot;: &quot;Contract violation&quot;, &quot;details&quot;: str(e)}, 500<br>        <br>    # 4. Return validated response<br>    return response</pre><h4>Phase 3: Knowledge Graph Build (Weeks 7–10)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*sjOZzdt9Q7MS4n0yRvo39A.gif" /></figure><p><strong>Step 1: Choose graph database</strong></p><ul><li>Neo4j (most popular, Cypher query language)</li><li>AWS Neptune (managed, Gremlin/SPARQL)</li><li>TigerGraph (high performance)</li></ul><p><strong>Step 2: Generate graph schema from contracts</strong></p><pre># scripts/generate_graph_schema.py<br>def generate_graph_schema_from_contracts():<br>    contracts = registry.list_all_contracts()<br>    <br>    schema = {<br>        &quot;node_types&quot;: [],<br>        &quot;edge_types&quot;: []<br>    }<br>    <br>    for contract in contracts:<br>        for entity_name, entity_def in contract.entities.items():<br>            # Create node type<br>            node_type = {<br>                &quot;name&quot;: entity_name,<br>                &quot;properties&quot;: entity_def.properties,<br>                &quot;identifier&quot;: entity_def.identifier<br>            }<br>            schema[&quot;node_types&quot;].append(node_type)<br>            <br>            # Create edge types from relationships<br>            for rel in entity_def.relationships:<br>                edge_type = {<br>                    &quot;name&quot;: rel.name,<br>                    &quot;source&quot;: entity_name,<br>                    &quot;target&quot;: rel.target,<br>                    &quot;cardinality&quot;: rel.cardinality<br>                }<br>                schema[&quot;edge_types&quot;].append(edge_type)<br>                <br>    return schema</pre><pre># Execute<br>schema = generate_graph_schema_from_contracts()</pre><pre># Apply to Neo4j<br>neo4j.execute(&quot;&quot;&quot;<br>    CREATE CONSTRAINT customer_id IF NOT EXISTS<br>    FOR (c:Customer) REQUIRE c.id IS UNIQUE<br>&quot;&quot;&quot;)</pre><pre>neo4j.execute(&quot;&quot;&quot;<br>    CREATE CONSTRAINT account_id IF NOT EXISTS<br>    FOR (a:Account) REQUIRE a.id IS UNIQUE<br>&quot;&quot;&quot;)</pre><p><strong>Step 3: Populate graph from APIs</strong></p><pre># scripts/populate_graph.py<br>def populate_graph():<br>    # Get all customers<br>    customers = api.get_all_customers()<br>    <br>    for customer in customers:<br>        # Create customer node<br>        graph.create_node(&quot;Customer&quot;, {<br>            &quot;id&quot;: customer.id,<br>            &quot;name&quot;: customer.name,<br>            &quot;type&quot;: customer.type<br>        })<br>        <br>        # Get accounts<br>        accounts = api.get_customer_accounts(customer.id)<br>        <br>        for account in accounts:<br>            # Normalize via contract<br>            contract = load_contract(account.source_bank, &quot;account_balance&quot;)<br>            normalized_balance = normalize_balance(contract, account.balance)<br>            <br>            # Create account node<br>            graph.create_node(&quot;Account&quot;, {<br>                &quot;id&quot;: account.id,<br>                &quot;balance_pence&quot;: normalized_balance,<br>                &quot;currency&quot;: account.currency,<br>                &quot;source_bank&quot;: account.source_bank,<br>                &quot;source_contract&quot;: contract.contract_id<br>            })<br>            <br>            # Create ownership edge<br>            graph.create_edge(<br>                source_type=&quot;Customer&quot;,<br>                source_id=customer.id,<br>                edge_type=&quot;owns&quot;,<br>                target_type=&quot;Account&quot;,<br>                target_id=account.id<br>            )<br>            <br># Run daily incremental sync<br>schedule.every().day.at(&quot;02:00&quot;).do(populate_graph)</pre><h4>Phase 4: MCP Server Setup (Weeks 11–14)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*ssAXW-wdNukrwST-lo8-Jw.gif" /></figure><p><strong>Step 1: Internal MCP server</strong></p><pre># mcp_server/internal_banking.py<br>from mcp import MCPServer, Tool<br>server = MCPServer(name=&quot;internal_banking_mcp&quot;)<br>@server.tool(<br>    name=&quot;retail_banking.get_balance&quot;,<br>    description=&quot;Get balance from retail banking accounts&quot;,<br>    contract=&quot;account_balance_v2&quot;<br>)<br>async def get_balance(account_id: str) -&gt; dict:<br>    # Load contract<br>    contract = load_contract(&quot;account_balance_v2&quot;)<br>    <br>    # Validate parameters<br>    if not validate_account_id(account_id):<br>        raise ValueError(&quot;Invalid account ID format&quot;)<br>        <br>    # Call backend<br>    response = await backend.get_balance(account_id)<br>    <br>    # Validate response against contract<br>    validate_response(response, contract)<br>    <br>    return response<br>@server.tool(<br>    name=&quot;retail_banking.transfer&quot;,<br>    description=&quot;Transfer funds between internal accounts&quot;,<br>    contract=&quot;internal_transfer_v1&quot;<br>)<br>async def transfer(from_account: str, to_account: str, <br>                  amount_pence: int, reference: str) -&gt; dict:<br>    contract = load_contract(&quot;internal_transfer_v1&quot;)<br>    <br>    # Execute transfer<br>    result = await backend.transfer(<br>        from_account, to_account, amount_pence, reference<br>    )<br>    <br>    validate_response(result, contract)<br>    <br>    return result<br># Start server<br>server.run(host=&quot;0.0.0.0&quot;, port=8080)</pre><p><strong>Step 2: External MCP integration</strong></p><pre># mcp_client/external_banking.py<br># Connect to external bank&#39;s MCP server<br>external_server = MCPClient(<br>    url=&quot;https://openbanking.partner-bank.com/mcp&quot;,<br>    auth=OAuth2(client_id, client_secret)<br>)<br># Discover available tools<br>tools = await external_server.list_tools()<br># Call external tool<br>result = await external_server.call_tool(<br>    name=&quot;payments.initiate_domestic&quot;,<br>    parameters={<br>        &quot;from_account&quot;: &quot;GB29...&quot;,<br>        &quot;to_account&quot;: &quot;GB29...&quot;,<br>        &quot;amount_pence&quot;: 8000000,<br>        &quot;consent_mechanism&quot;: &quot;CIBA&quot;<br>    }<br>)<br></pre><h4>Phase 5: Agent Integration (Weeks 15–18)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*bc93vnhnQVr7MYoUuyOzwQ.gif" /></figure><p><strong>Step 1: Connect to Kumo/PGN</strong></p><pre># ml/zero_shot_predictor.py<br>from kumo import KumoClient<br>kumo = KumoClient(api_key=os.getenv(&quot;KUMO_API_KEY&quot;))<br>async def predict_optimal_funding(customer_id: str, target_amount: int):<br>    # Query graph<br>    subgraph = knowledge_graph.get_customer_subgraph(customer_id)<br>    <br>    # Call Kumo<br>    prediction = await kumo.predict(<br>        graph=subgraph,<br>        query=f&quot;Optimal mix to fund {target_amount/100}K deposit minimizing tax + penalties&quot;,<br>        context=[&quot;liquidity&quot;, &quot;tax_implications&quot;, &quot;interest_rates&quot;]<br>    )<br>    <br>    return prediction</pre><p><strong>Step 2: Agent orchestration</strong></p><pre># agents/house_deposit_agent.py<br>async def handle_house_deposit_request(customer_id: str, target_amount: int):<br>    # Step 1: Query knowledge graph<br>    accounts = knowledge_graph.query(f&quot;&quot;&quot;<br>        MATCH (c:Customer {{id: &quot;{customer_id}&quot;}})-[:OWNS]-&gt;(a:Account)<br>        RETURN a<br>    &quot;&quot;&quot;)<br>    <br>    # Step 2: Get ML prediction<br>    prediction = await predict_optimal_funding(customer_id, target_amount)<br>    <br>    # Step 3: Execute via MCP<br>    results = []<br>    <br>    for account_id, amount in prediction.recommendation.items():<br>        # Determine which MCP tool to use<br>        account = accounts[account_id]<br>        <br>        if account.source_bank == &quot;internal&quot;:<br>            if account.type == &quot;retail&quot;:<br>                result = await mcp.call(<br>                    &quot;retail_banking.transfer&quot;,<br>                    {&quot;from&quot;: account_id, &quot;to&quot;: &quot;escrow&quot;, &quot;amount&quot;: amount}<br>                )<br>            elif account.type == &quot;portfolio&quot;:<br>                result = await mcp.call(<br>                    &quot;wealth_management.sell_stocks&quot;,<br>                    {&quot;portfolio&quot;: account_id, &quot;amount&quot;: amount, &quot;strategy&quot;: &quot;tax_optimized&quot;}<br>                )<br>        else:<br>            # External account<br>            result = await mcp.call(<br>                f&quot;{account.source_bank}_openbanking.initiate_payment&quot;,<br>                {&quot;from&quot;: account_id, &quot;to&quot;: &quot;escrow&quot;, &quot;amount&quot;: amount, &quot;consent&quot;: &quot;CIBA&quot;}<br>            )<br>            <br>        results.append(result)<br>        <br>    return {<br>        &quot;total_funded&quot;: target_amount,<br>        &quot;accounts_used&quot;: len(results),<br>        &quot;execution_results&quot;: results,<br>        &quot;cost_breakdown&quot;: prediction.cost_breakdown<br>    }</pre><h3>Benefits &amp; Outcomes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*tYJlpAt5rUqjPXl29vc_uw.gif" /></figure><h4>Regulatory &amp; Audit Advantages</h4><p><strong>Complete audit trail:</strong></p><pre>Regulator asks: &quot;Why did the agent transfer £50K from Account 123 to escrow?&quot;</pre><pre>Audit trail shows:<br>1. Customer request: &quot;Best way to fund £200K deposit&quot;<br>2. Knowledge Graph query: Discovered 5 accounts<br>3. Contracts used:<br>   - account_balance_v2 (published 2024-06-15 by Treasury Ops)<br>   - internal_transfer_v1 (published 2024-01-10 by Payments Team)<br>4. ML reasoning:<br>   - Excluded ISA (£15K penalty per contract semantics)<br>   - Selected Retail (fully liquid per contract)<br>   - Total cost £6.3K vs £15K ISA penalty<br>5. MCP execution:<br>   - Tool: retail_banking.transfer<br>   - Contract validation: PASSED<br>   - Parameters validated against schema<br>   - Response validated against SLA (&lt;200ms)<br>6. Customer authorization: OAuth 2.0 consent token valid<br>7. Compliance:<br>   - GDPR Article 6(1)(b): Contract<br>   - PSD2 Article 36: Payment account access<br>   - Contract version tracking: all breaking changes documented</pre><p><strong>Explainability:</strong></p><ul><li>Every decision traces back to contract-declared semantics</li><li>ML reasoning path shows graph traversal</li><li>Contract versions provide temporal audit (what was true at decision time)</li></ul><h4>Performance Benefits</h4><p><strong>Traditional approach:</strong></p><pre>Developer writes code:<br>1. Call API A<br>2. Parse response (guess what fields mean)<br>3. Call API B<br>4. Parse response (different field names)<br>5. Manual normalization (hardcoded per bank)<br>6. Execute business logic</pre><pre>Result: Fragile, breaks on API changes, no guarantees</pre><p><strong>Contract-based approach:</strong></p><pre>Agent receives request:<br>1. Load contracts from registry (cached)<br>2. Query knowledge graph (unified view)<br>3. ML prediction over graph<br>4. Execute via MCP (contract-validated)</pre><pre>Result: Robust, self-documenting, SLA-backed</pre><p><strong>Speed improvements:</strong></p><ul><li>Knowledge Graph query: 1 query vs N+1 API calls</li><li>Contract validation: Circuit breaker prevents cascading failures</li><li>Zero-shot ML: Same-day deployment vs 3–4 months training</li></ul><h4>Economic Impact</h4><p><strong>Cost savings:</strong></p><ul><li><strong>Reduced ML overhead:</strong> No training pipelines, no feature engineering, no retraining</li><li><strong>Faster time-to-market:</strong> Days instead of months for new use cases</li><li><strong>Lower maintenance:</strong> Contracts self-document, reducing support burden</li><li><strong>Fewer errors:</strong> Contract validation catches issues before execution</li></ul><p><strong>Revenue opportunities:</strong></p><ul><li><strong>Cross-bank services:</strong> Unified graph enables portfolio view across institutions</li><li><strong>Personalized recommendations:</strong> Zero-shot ML predicts next best action</li><li><strong>Automated workflows:</strong> End-to-end orchestration without manual steps</li></ul><h3>Next Steps &amp; Roadmap</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*GPOjpkKQusOVLBoFFYSU-A.gif" /></figure><h4>Immediate Actions (Week 1)</h4><ol><li><strong>Adopt ODCS format</strong> for existing APIs</li><li><strong>Create 3 initial contracts</strong> (balance, transactions, transfer)</li><li><strong>Set up contract registry</strong> (Git + CI/CD validation)</li><li><strong>Add validation to 1 high-traffic endpoint</strong> (prove concept)</li></ol><h4>Short Term (Months 1–3)</h4><ol><li><strong>Expand contract coverage</strong> to top 20 APIs</li><li><strong>Build knowledge graph</strong> from contracts</li><li><strong>Deploy middleware validation</strong> to production</li><li><strong>Integrate MCP</strong> for internal tools</li></ol><h4>Medium Term (Months 4–6)</h4><ol><li><strong>Connect external Open Banking</strong> via MCP</li><li><strong>Deploy zero-shot ML</strong> (Kumo/PGN integration)</li><li><strong>Launch first agentic use case</strong> (house deposit funding)</li><li><strong>Establish governance</strong> (contract ownership, version control)</li></ol><h4>Long Term (Months 7–12)</h4><ol><li><strong>Ecosystem expansion:</strong> 10+ external banks via MCP</li><li><strong>Multi-use case deployment:</strong> Churn, cross-sell, fraud, compliance</li><li><strong>Regulatory certification:</strong> Demonstrate contract-based auditability</li><li><strong>Open standard:</strong> Contribute Open Banking contract spec to industry body</li></ol><h3>Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*FnfMUlMxWwMgvS0rJFxXJQ.gif" /></figure><p><strong>Open Banking created the pipes.</strong><br><strong>Agentic AI creates the pressure.</strong><br><strong>Open Data Contracts ensure the pipes don’t burst.</strong></p><p>The combination of <strong>ODCS-inspired contracts</strong>, <strong>knowledge graphs</strong>, <strong>zero-shot ML</strong>, and <strong>MCP federation</strong> transforms Open Banking from a data access layer into an <strong>execution fabric for agentic AI</strong>.</p><p>Without contracts:</p><ul><li>Agents guess what data means</li><li>Each bank’s API is a special case</li><li>No SLA enforcement</li><li>Audit trails incomplete</li><li>ML models retrained per use case</li></ul><p>With contracts:</p><ul><li>Agents operate on guaranteed semantics</li><li>Multi-bank orchestration via unified graph</li><li>Runtime validation with circuit breakers</li><li>Complete audit trail back to contract versions</li><li>Zero-shot predictions across any use case</li></ul><p><strong>The future is agents that:</strong></p><ul><li>Understand what £50,000 means (minor vs major units)</li><li>Know whether data is real-time or cached</li><li>Enforce SLAs at runtime</li><li>Execute across institutional boundaries</li><li>Explain every decision with contract-backed reasoning</li></ul><p><strong>Build on contracts. Scale with confidence.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8ec91a513fb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/youme-technology/day-71-1-5-agentic-ai-in-open-banking-mcp-federated-execution-e8ec91a513fb">Day 71 1.5: Agentic AI in Open Banking — MCP Federated Execution</a> was originally published in <a href="https://medium.com/youme-technology">AI Smart</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 71 1.6: Agentic AI in Open Banking — Zero-shot ML inference on Knowledge Graph]]></title>
            <link>https://medium.com/youme-technology/day-71-1-6-agentic-ai-in-open-banking-zero-shot-ml-inference-on-knowledge-graph-7a1ef9ea1e02?source=rss----9f2a2586502---4</link>
            <guid isPermaLink="false">https://medium.com/p/7a1ef9ea1e02</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[zero-shot-learning]]></category>
            <category><![CDATA[knowledge-graph]]></category>
            <dc:creator><![CDATA[LAKSHMI VENKATESH]]></dc:creator>
            <pubDate>Tue, 19 May 2026 12:48:29 GMT</pubDate>
            <atom:updated>2026-05-19T12:48:30.561Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The architecture that eliminates ML training while maximizing intelligence</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ysLmrCEfvOP0spfUKsTzng.gif" /></figure><h3>Executive Summary</h3><p>Traditional machine learning in banking requires 3–4 months per use case: feature engineering, data labeling, model training, validation, deployment. <strong>Zero-shot inference on knowledge graphs eliminates this entirely.</strong></p><p>This article explains how <strong>relational foundation models</strong> (Kumo AI, PGN, TabPFN) perform predictions directly over graph structures without training, how ontologies + business rules create semantic guarantees, and why this combination is transformational for agentic AI in Open Banking.</p><p><strong>What it covers:</strong></p><ul><li>Why knowledge graphs enable zero-shot predictions</li><li>How relational foundation models reason over graph structure</li><li>The role of ontologies and business rules in graph construction</li><li>Complete implementation: from contracts to graphs to predictions</li><li>Open-source alternatives: PyTorch Frame, PyG, RelBench</li><li>Real examples: house deposit funding, churn prediction, fraud detection</li></ul><h3>Agentic AI in Open Banking — Zero-shot ML over the graph</h3><p>Traditional machine learning in banking requires 3–4 months per use case: feature engineering, data labeling, model training, validation, deployment. <strong>Zero-shot inference on knowledge graphs eliminates this entirely.</strong></p><p>This article explains how <strong>relational foundation models</strong> (Kumo AI, PGN, TabPFN) perform predictions directly over graph structures without training, how ontologies + business rules create semantic guarantees, and why this combination is transformational for agentic AI in Open Banking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ysLmrCEfvOP0spfUKsTzng.gif" /></figure><p>Few key takes from me:</p><ul><li>Why knowledge graphs enable zero-shot predictions</li><li>How relational foundation models reason over graph structure</li><li>The role of ontologies and business rules in graph construction</li><li>Complete implementation: from contracts to graphs to predictions</li><li>Open-source alternatives: PyTorch Frame, PyG, RelBench</li><li>Real examples: house deposit funding, churn prediction, fraud detection</li></ul><h3>Why Zero-Shot Promise</h3><p><strong>Traditional ML approach: use Case: Predict Customer Churn</strong></p><pre>Traditional supervised ML:</pre><pre>1. Define use case (churn prediction)<br>2. Engineer features (30-50 columns)<br>3. Label historical data (churned vs retained)<br>4. Train model (XGBoost, neural nets)<br>5. Validate, tune hyperparameters<br>6. Deploy to production<br>7. Monitor, retrain quarterly</pre><pre>Timeline: 12-16 weeks<br>Result: One model for one use case</pre><pre>Total: 3-4 months per use case</pre><p><strong>Zero-shot inference on knowledge graph:</strong></p><p>Zero-shot with graph + foundation model: Use Case: Predict Customer Churn</p><pre>Steps:<br>1. Query knowledge graph (already exists)<br>2. Pass graph to foundation model (Kumo, PGN, TabPFN)<br>3. Get prediction with reasoning<br><br>Timeline: Same day<br>Result: Infinite use cases from one graph<br><br>Total: Same day</pre><h4>Why it works?</h4><p><strong>Key insight:</strong> Relational foundation models are pre-trained on millions of relational datasets across industries. They’ve learned <strong>how relationships predict outcomes</strong>, not just how features correlate.</p><p><strong>Example:</strong></p><ul><li>Traditional ML: “Balance &lt; £1000 correlates with churn (70% accuracy)”</li><li>Relational FM: “Customer with decreasing balance + no recent deposits + owns single account + no linked external accounts = high churn risk (89% accuracy + reasoning path)”</li></ul><p>The foundation model <strong>reasons over graph structure</strong> (nodes, edges, paths, neighborhoods) instead of flat features.</p><h4>Can we do Zero-shot on top of graph structure?</h4><ul><li><strong>Kumo AI</strong> — Enterprise relational foundation model</li><li><strong>PGN (Predictive Graph Networks)</strong> — Graph-based predictions</li><li><strong>TabPFN</strong> — Tabular data foundation model (can query from graph)</li><li><strong>PyTorch Frame</strong> — open relational deep learning</li><li><strong>PyTorch Geometric (PyG)</strong> — open GNN library</li><li><strong>RelBench</strong> — open benchmark + framework</li><li><strong>XGBoost, LightGBM, CatBoost</strong> — all open baselines</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*afWfY6MKx1lzt2isTgXExA.gif" /></figure><h3>Part 1: The Zero-Shot Promise</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Pxa-bVT3Jw-l-qKeGj4xyA.gif" /></figure><h4>What Is Zero-Shot Inference?</h4><p><strong>Traditional supervised ML:</strong></p><pre>1. Define use case (churn prediction)<br>2. Engineer features (30-50 columns)<br>3. Label historical data (churned vs retained)<br>4. Train model (XGBoost, neural nets)<br>5. Validate, tune hyperparameters<br>6. Deploy to production<br>7. Monitor, retrain quarterly<br><br>Timeline: 12-16 weeks<br>Result: One model for one use case</pre><p><strong>Zero-shot inference on knowledge graph:</strong></p><pre>1. Query knowledge graph<br>2. Pass graph structure to foundation model<br>3. Get prediction with reasoning path<br><br>Timeline: Same day<br>Result: Infinite use cases from one graph</pre><h4>Why It Works</h4><p><strong>Key insight:</strong> Relational foundation models are pre-trained on millions of relational datasets across industries. They’ve learned <strong>how relationships predict outcomes</strong>, not just how features correlate.</p><p><strong>Example:</strong></p><ul><li>Traditional ML: “Balance &lt; £1000 correlates with churn (70% accuracy)”</li><li>Relational FM: “Customer with decreasing balance + no recent deposits + owns single account + no linked external accounts = high churn risk (89% accuracy + reasoning path)”</li></ul><p>The foundation model <strong>reasons over graph structure</strong> (nodes, edges, paths, neighborhoods) instead of flat features.</p><h3>Part 2: Knowledge Graphs in Open Banking</h3><h4>Why Graphs, Not Tables?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*6LTZc78nP2-X2pjt5oxhsQ.gif" /></figure><p><strong>The problem with tabular data:</strong></p><p>Banks store customer data in separate tables:</p><pre>customers_table:<br>  customer_id | name | dob | segment<br><br>accounts_table:<br>  account_id | customer_id | balance | type<br><br>transactions_table:<br>  txn_id | account_id | amount | timestamp<br><br>portfolios_table:<br>  portfolio_id | customer_id | holdings | value</pre><p><strong>To answer “What’s Customer X’s total liquid assets?”:</strong></p><pre>-- Traditional approach: 5 joins<br>SELECT SUM(a.balance) + SUM(p.liquid_value)<br>FROM customers c<br>JOIN accounts a ON c.customer_id = a.customer_id<br>JOIN portfolios p ON c.customer_id = p.customer_id<br>WHERE c.customer_id = &#39;X&#39;<br>  AND a.type IN (&#39;current&#39;, &#39;savings&#39;)<br>  AND p.liquidity = &#39;high&#39;</pre><p><strong>With knowledge graph:</strong></p><pre>// Neo4j Cypher<br>MATCH (c:Customer {id: &#39;X&#39;})-[:OWNS]-&gt;(asset)<br>WHERE asset:Account OR asset:Portfolio<br>  AND asset.liquid = true<br>RETURN sum(asset.value)</pre><p><strong>One query. No joins. Natural.</strong></p><h4>Graph Schema for Open Banking</h4><p><strong>Core entities (nodes):</strong></p><pre>Customer<br>  - id (UUID)<br>  - name<br>  - segment (retail, corporate, private)<br>  - risk_profile (low, medium, high)<br><br>Account<br>  - id (IBAN or internal)<br>  - balance_pence (normalized to minor units)<br>  - type (current, savings, ISA, business)<br>  - liquid (boolean)<br>  - source_bank (internal, external_bank_a, external_bank_b)<br>  - contract_id (which contract guarantees this data)<br><br>Portfolio<br>  - id<br>  - strategy (growth, income, balanced)<br>  - total_value_pence<br>  - liquid_value_pence<br><br>Transaction<br>  - id<br>  - amount_pence<br>  - timestamp<br>  - category (retail, utilities, entertainment, etc)<br><br>ExternalAccount<br>  - id (IBAN)<br>  - bank_identifier<br>  - consent_status (active, expired, revoked)<br>  - consent_expiry (timestamp)<br><br>Goal<br>  - id<br>  - type (house_deposit, retirement, education)<br>  - target_amount_pence<br>  - target_date</pre><p><strong>Relationships (edges):</strong></p><pre>Customer -[OWNS]-&gt; Account<br>Customer -[OWNS]-&gt; Portfolio<br>Customer -[HAS_GOAL]-&gt; Goal<br>Customer -[PART_OF]-&gt; Household</pre><pre>Account -[LINKED_TO]-&gt; ExternalAccount<br>Account -[HAS_TRANSACTION]-&gt; Transaction</pre><pre>Portfolio -[CONTAINS]-&gt; Holding<br>Portfolio -[PART_OF]-&gt; Account</pre><pre>Transaction -[BENEFICIARY]-&gt; Entity<br>Transaction -[CATEGORY]-&gt; TransactionCategory</pre><pre>Goal -[FUNDED_BY]-&gt; Account</pre><h4>Building the Graph from Contracts</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*pM0bj59UwZ9OkcV489secg.gif" /></figure><p>Contracts declare entities and relationships.</p><p><strong>Contract excerpt:</strong></p><pre># account_balance_v2.yaml<br>entities:<br>  Account:<br>    identifier: &quot;accountId&quot;<br>    properties:<br>      balance_pence: &quot;integer&quot;<br>      type: &quot;enum[current, savings, ISA, business]&quot;<br>      liquid: &quot;boolean&quot;<br>      <br>    relationships:<br>      - name: &quot;ownedBy&quot;<br>        target: &quot;Customer&quot;<br>        cardinality: &quot;many-to-one&quot;<br>        <br>      - name: &quot;linkedTo&quot;<br>        target: &quot;ExternalAccount&quot;<br>        cardinality: &quot;many-to-many&quot;<br>        description: &quot;External accounts linked via Open Banking consent&quot;</pre><p><strong>Graph ingestion pipeline:</strong></p><pre># Step 1: Read contracts<br>contracts = load_all_contracts()<br><br># Step 2: Generate graph schema<br>for contract in contracts:<br>    for entity_name, entity_def in contract.entities.items():<br>        graph.create_node_label(entity_name, entity_def.properties)<br>        <br>    for relationship in entity_def.relationships:<br>        graph.create_relationship_type(<br>            name=relationship.name,<br>            source=entity_name,<br>            target=relationship.target<br>        )<br><br># Step 3: Populate from APIs (internal + external)<br>for customer in all_customers():<br>    graph.create_node(&quot;Customer&quot;, customer.id, customer.data)<br>    <br>    # Internal accounts<br>    internal_accounts = internal_api.get_accounts(customer.id)<br>    for account in internal_accounts:<br>        graph.create_node(&quot;Account&quot;, account.id, normalize(account))<br>        graph.create_edge(&quot;Customer&quot;, customer.id, &quot;OWNS&quot;, &quot;Account&quot;, account.id)<br>    <br>    # External accounts (Open Banking)<br>    external_accounts = open_banking_api.get_accounts(customer.id, consent_token)<br>    for account in external_accounts:<br>        graph.create_node(&quot;ExternalAccount&quot;, account.id, normalize(account))<br>        graph.create_edge(&quot;Customer&quot;, customer.id, &quot;OWNS&quot;, &quot;ExternalAccount&quot;, account.id)</pre><p><strong>Result:</strong> Unified graph with semantic consistency guaranteed by contracts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*pM0bj59UwZ9OkcV489secg.gif" /></figure><h3>Part 3: Ontologies &amp; Business Rules</h3><h4>What Is an Ontology?</h4><p><strong>Ontology</strong> = formal specification of concepts and their relationships in a domain.</p><p>For Open Banking, an ontology defines:</p><ul><li><strong>Concepts:</strong> What is an “Account”? What is “liquidity”?</li><li><strong>Hierarchies:</strong> ISA is a type of Account; Account is a type of Asset</li><li><strong>Constraints:</strong> An Account must have exactly one owner</li><li><strong>Rules:</strong> If withdrawal_penalty &gt; 0, then liquid = false</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HKGI3xzs1zHOOyBbKAtnOg.gif" /></figure><h4>Ontology Example: Account Taxonomy</h4><pre># OWL (Web Ontology Language) example</pre><pre>:Account rdf:type owl:Class ;<br>  rdfs:label &quot;Financial Account&quot; ;<br>  rdfs:comment &quot;A financial account held at a banking institution&quot; .</pre><pre>:CurrentAccount rdf:type owl:Class ;<br>  rdfs:subClassOf :Account ;<br>  owl:hasProperty :liquid &quot;true&quot;^^xsd:boolean .</pre><pre>:SavingsAccount rdf:type owl:Class ;<br>  rdfs:subClassOf :Account ;<br>  owl:hasProperty :interest_bearing &quot;true&quot;^^xsd:boolean .</pre><pre>:ISAAccount rdf:type owl:Class ;<br>  rdfs:subClassOf :SavingsAccount ;<br>  owl:hasProperty :tax_free &quot;true&quot;^^xsd:boolean ;<br>  owl:hasProperty :withdrawal_penalty_pence xsd:integer .</pre><pre># Constraint: Accounts must have owner<br>:Account owl:hasProperty :owner ;<br>  owl:cardinality &quot;1&quot;^^xsd:integer .</pre><pre># Rule: If withdrawal penalty exists, not liquid<br>:ISAAccount owl:hasRule [<br>  a :BusinessRule ;<br>  :condition &quot;withdrawal_penalty_pence &gt; 0&quot; ;<br>  :implication &quot;liquid = false&quot;<br>] .</pre><h4>Business Rules on the Graph</h4><p><strong>Business rules</strong> = executable logic applied at query time or ingestion time.</p><p><strong>Example 1: Liquidity classification</strong></p><pre># Rule: Classify accounts by liquidity<br>def classify_liquidity(account):<br>    &quot;&quot;&quot;<br>    Liquid = can access funds within 24h without penalty<br>    &quot;&quot;&quot;<br>    if account.type == &quot;current&quot;:<br>        return True<br>    <br>    if account.type == &quot;savings&quot;:<br>        if account.withdrawal_penalty &gt; 0:<br>            return False<br>        if account.notice_period_days &lt;= 1:<br>            return True<br>        return False<br>    <br>    if account.type == &quot;ISA&quot;:<br>        # ISAs have tax benefits but withdrawal penalties<br>        return False<br>    <br>    if account.type == &quot;business&quot;:<br>        # Business accounts may have restrictions<br>        return account.get(&quot;unrestricted&quot;, False)<br>    <br>    return False<br><br># Apply rule during graph ingestion<br>for account in accounts:<br>    account.liquid = classify_liquidity(account)<br>    graph.create_node(&quot;Account&quot;, account.id, account)</pre><p><strong>Example 2: Cross-sell eligibility</strong></p><pre># Rule: Determine mortgage eligibility from graph<br>def check_mortgage_eligibility(customer_id):<br>    &quot;&quot;&quot;<br>    Eligibility criteria:<br>    - Income &gt; £30K/year<br>    - No missed payments in 12 months<br>    - Deposit available &gt;= 10% of property value<br>    &quot;&quot;&quot;<br>    # Query graph for customer subgraph<br>    result = graph.query(f&quot;&quot;&quot;<br>        MATCH (c:Customer {{id: &#39;{customer_id}&#39;}})<br>        MATCH (c)-[:OWNS]-&gt;(a:Account)<br>        MATCH (c)-[:HAS_TRANSACTION]-&gt;(t:Transaction)<br>        WHERE t.timestamp &gt; datetime() - duration({{months: 12}})<br>        RETURN <br>            sum(t.amount) as annual_income,<br>            sum(CASE WHEN t.missed_payment THEN 1 ELSE 0 END) as missed_count,<br>            sum(a.balance_pence) as total_savings<br>    &quot;&quot;&quot;)<br>    <br>    eligible = (<br>        result.annual_income &gt;= 3000000  # £30K in pence<br>        and result.missed_count == 0<br>        and result.total_savings &gt;= 20000000  # £200K deposit for £2M property<br>    )<br>    <br>    return {<br>        &quot;eligible&quot;: eligible,<br>        &quot;income&quot;: result.annual_income / 100,<br>        &quot;savings&quot;: result.total_savings / 100,<br>        &quot;missed_payments&quot;: result.missed_count<br>    }</pre><p><strong>Example 3: Fraud detection rules</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*shhza8XwRZzjHmTT-YOKtQ.gif" /></figure><pre># Rule: Flag suspicious transactions<br>def detect_suspicious_transaction(txn_id):<br>    &quot;&quot;&quot;<br>    Suspicious if:<br>    - Amount &gt; 10x average for this customer<br>    - Location != home country<br>    - Merchant category = high-risk<br>    - Time = unusual hours (2-5am)<br>    &quot;&quot;&quot;<br>    result = graph.query(f&quot;&quot;&quot;<br>        MATCH (t:Transaction {{id: &#39;{txn_id}&#39;}})&lt;-[:HAS_TRANSACTION]-(a:Account)&lt;-[:OWNS]-(c:Customer)<br>        MATCH (c)-[:HAS_TRANSACTION]-&gt;(other:Transaction)<br>        WHERE other.timestamp &gt; datetime() - duration({{months: 6}})<br>        RETURN<br>            t.amount as txn_amount,<br>            avg(other.amount) as avg_amount,<br>            t.merchant_country as country,<br>            c.home_country as home_country,<br>            t.merchant_category as category,<br>            t.timestamp.hour as hour<br>    &quot;&quot;&quot;)<br>    <br>    flags = []<br>    <br>    if result.txn_amount &gt; result.avg_amount * 10:<br>        flags.append(&quot;amount_spike&quot;)<br>    <br>    if result.country != result.home_country:<br>        flags.append(&quot;foreign_transaction&quot;)<br>    <br>    if result.category in [&quot;gambling&quot;, &quot;crypto&quot;, &quot;wire_transfer&quot;]:<br>        flags.append(&quot;high_risk_category&quot;)<br>    <br>    if 2 &lt;= result.hour &lt;= 5:<br>        flags.append(&quot;unusual_hours&quot;)<br>    <br>    suspicious = len(flags) &gt;= 2<br>    <br>    return {<br>        &quot;suspicious&quot;: suspicious,<br>        &quot;flags&quot;: flags,<br>        &quot;risk_score&quot;: len(flags) * 0.25<br>    }</pre><h4>Semantic Layer: Ontology + Rules + Graph</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xt4jR-JF8tW4Mz7L8GuKpQ.gif" /></figure><h3>Part 4: Relational Foundation Models</h3><h4>1. Kumo AI — Enterprise Relational Foundation Model</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*EY_uXENgYrovIa5xySZvYQ.gif" /></figure><p><strong>What it is:</strong> Commercial foundation model trained on billions of relational datasets (customer graphs, supply chains, financial networks).</p><p><strong>How it works:</strong></p><ol><li><strong>Accepts knowledge graph</strong> as input (nodes, edges, properties)</li><li><strong>Identifies relevant subgraph</strong> for the query</li><li><strong>Traverses relationships</strong> using attention mechanisms</li><li><strong>Reasons over paths</strong> (multi-hop reasoning)</li><li><strong>Returns prediction</strong> with confidence score and reasoning path</li></ol><p><strong>Example: House Deposit Funding</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*cuwSk91s0MKAtgwm3oLXnA.gif" /></figure><pre>from kumo import KumoClient<br>kumo = KumoClient(api_key=&quot;...&quot;)<br><br># Query graph for customer<br>subgraph = knowledge_graph.get_subgraph(&quot;Customer&quot;, customer_id=&quot;X&quot;)<br># Ask Kumo for prediction<br>prediction = kumo.predict(<br>    graph=subgraph,<br>    query=&quot;Optimal mix to fund £200K house deposit minimizing tax and penalties&quot;,<br>    constraints=[<br>        &quot;Use only liquid assets or assets with low tax impact&quot;,<br>        &quot;Minimize total cost (taxes + penalties + opportunity cost)&quot;,<br>        &quot;Maintain emergency fund of £10K&quot;<br>    ],<br>    context={<br>        &quot;target_amount_pence&quot;: 20000000,<br>        &quot;target_date&quot;: &quot;2025-06-01&quot;,<br>        &quot;risk_tolerance&quot;: &quot;moderate&quot;<br>    }<br>)<br>print(prediction)</pre><p><strong>Output:</strong></p><pre>{<br>  &quot;recommendation&quot;: {<br>    &quot;sources&quot;: [<br>      {<br>        &quot;account_id&quot;: &quot;ACC_RETAIL_123&quot;,<br>        &quot;amount_pence&quot;: 5000000,  # £50K<br>        &quot;cost_pence&quot;: 0,<br>        &quot;reason&quot;: &quot;Current account - fully liquid, no penalty&quot;<br>      },<br>      {<br>        &quot;account_id&quot;: &quot;ACC_EXTERNAL_BANK_B&quot;,<br>        &quot;amount_pence&quot;: 8000000,  # £80K<br>        &quot;cost_pence&quot;: 210000,  # £2.1K opportunity cost (lost interest)<br>        &quot;reason&quot;: &quot;External savings - liquid, but lose 4.2% interest for 6 months&quot;<br>      },<br>      {<br>        &quot;account_id&quot;: &quot;PORT_ABC&quot;,<br>        &quot;amount_pence&quot;: 7000000,  # £70K<br>        &quot;cost_pence&quot;: 420000,  # £4.2K capital gains tax<br>        &quot;reason&quot;: &quot;Investment portfolio - sell low-gain stocks to minimize CGT&quot;<br>      }<br>    ],<br>    &quot;total_funded_pence&quot;: 20000000,<br>    &quot;total_cost_pence&quot;: 630000,  # £6,300<br>    &quot;emergency_fund_remaining_pence&quot;: 1500000  # £15K<br>  },<br>  <br>  &quot;reasoning_path&quot;: [<br>    &quot;Excluded ACC_ISA_456: £15K withdrawal penalty (not cost-effective)&quot;,<br>    &quot;Excluded ACC_CORPORATE_789: Business account restrictions&quot;,<br>    &quot;Prioritized external savings: highest interest rate (4.2%), but liquid&quot;,<br>    &quot;Tax-optimized portfolio sale: selected stocks with £70K value and £4.2K CGT&quot;,<br>    &quot;Alternative considered: Use ISA (£15K penalty) → Total cost £15K vs £6.3K (chosen)&quot;<br>  ],<br>  <br>  &quot;graph_traversal&quot;: [<br>    &quot;Customer_X -[OWNS]-&gt; ACC_RETAIL_123&quot;,<br>    &quot;Customer_X -[OWNS]-&gt; ACC_EXTERNAL_BANK_B&quot;,<br>    &quot;Customer_X -[OWNS]-&gt; PORT_ABC&quot;,<br>    &quot;PORT_ABC -[CONTAINS]-&gt; Stock_Set_LowGain&quot;,<br>    &quot;Stock_Set_LowGain -[AGGREGATE_CGT]-&gt; £4,200&quot;<br>  ],<br>  <br>  &quot;confidence&quot;: 0.89,<br>  &quot;alternatives&quot;: 2,<br>  &quot;savings_vs_baseline&quot;: {<br>    &quot;baseline_strategy&quot;: &quot;Use ISA for full £200K&quot;,<br>    &quot;baseline_cost&quot;: 1500000,  # £15K penalty<br>    &quot;chosen_cost&quot;: 630000,     # £6.3K<br>    &quot;savings&quot;: 870000          # £8.7K saved<br>  }<br>}</pre><p><strong>Key capabilities:</strong></p><ul><li><strong>Multi-hop reasoning:</strong> Traverses Customer → Account → Portfolio → Holdings → Tax implications</li><li><strong>Constraint satisfaction:</strong> Respects liquidity, cost minimization, emergency fund</li><li><strong>Explainability:</strong> Full reasoning path + graph traversal shown</li><li><strong>Confidence scoring:</strong> 0.89 indicates high confidence</li><li><strong>Alternative evaluation:</strong> Considered ISA option, rejected due to cost</li></ul><h4>2. PGN (Predictive Graph Networks)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*tbV9CUJgXbaDvkeKvJ3csg.gif" /></figure><p><strong>What it is:</strong> Research-grade graph neural network architecture for predictions on property graphs.</p><p><strong>How it works:</strong></p><pre>import torch<br>from pgn import PredictiveGraphNetwork<br><br># Load graph<br>graph = load_property_graph(&quot;customer_graph.gpickle&quot;)<br># Initialize PGN<br>model = PredictiveGraphNetwork(<br>    node_features_dim=128,<br>    edge_features_dim=64,<br>    num_layers=5,<br>    prediction_type=&quot;regression&quot;<br>)<br># Query: Predict customer lifetime value<br>customer_nodes = graph.nodes_by_label(&quot;Customer&quot;)<br>predictions = model.predict(<br>    graph=graph,<br>    target_nodes=customer_nodes,<br>    task=&quot;predict_ltv&quot;<br>)<br>for customer_id, ltv_pred in predictions.items():<br>    print(f&quot;Customer {customer_id}: £{ltv_pred:.2f} LTV (next 5 years)&quot;)</pre><p><strong>Output:</strong></p><pre>Customer X: £47,320.00 LTV (next 5 years)<br>Customer Y: £12,890.00 LTV (next 5 years)<br>Customer Z: £89,450.00 LTV (next 5 years)</pre><p><strong>Use cases:</strong></p><ul><li>Customer lifetime value prediction</li><li>Churn risk scoring</li><li>Default probability estimation</li><li>Cross-sell propensity</li><li>Fraud likelihood</li></ul><h4>TabPFN — Tabular Foundation Model</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*7Pvfj0nxXGXaQURvY72C-A.gif" /></figure><p><strong>What it is:</strong> Foundation model for tabular data that can query from knowledge graphs.</p><p><strong>How it works:</strong></p><pre>from tabpfn import TabPFNClassifier<br>import pandas as pd<br><br># Extract tabular features from graph<br>features = graph.query(&quot;&quot;&quot;<br>    MATCH (c:Customer)-[:OWNS]-&gt;(a:Account)<br>    RETURN<br>        c.id as customer_id,<br>        c.age as age,<br>        c.income as income,<br>        count(a) as num_accounts,<br>        sum(a.balance_pence) as total_balance,<br>        avg(a.balance_pence) as avg_balance<br>&quot;&quot;&quot;)<br>df = pd.DataFrame(features)<br># Initialize TabPFN (zero-shot, no training)<br>model = TabPFNClassifier()<br># Predict churn (zero-shot)<br>X = df[[&quot;age&quot;, &quot;income&quot;, &quot;num_accounts&quot;, &quot;total_balance&quot;, &quot;avg_balance&quot;]]<br>y_pred = model.predict(X)<br>df[&quot;churn_probability&quot;] = y_pred<br># High-risk customers<br>high_risk = df[df.churn_probability &gt; 0.7]<br>print(high_risk[[&quot;customer_id&quot;, &quot;churn_probability&quot;]])</pre><p><strong>Output:</strong></p><pre>customer_id  churn_probability<br>0   CUST_001             0.84<br>3   CUST_004             0.76<br>7   CUST_008             0.92</pre><p><strong>Advantages:</strong></p><ul><li>No training required</li><li>Works with small datasets</li><li>Fast inference (&lt;100ms per customer)</li><li>Interpretable feature importance</li></ul><h3>Part 5: Open-Source Alternatives</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*z2Nux252PsUXr7SKqgmOMQ.gif" /></figure><h4>3. PyTorch Frame — Relational Deep Learning</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*4nRGnDtKGxCZLYo9C698AQ.gif" /></figure><p><strong>What it is:</strong> Open-source framework for deep learning on relational/tabular data from PyTorch team.</p><p><strong>Installation:</strong></p><pre>pip install torch-frame</pre><p><strong>Example: Customer churn prediction</strong></p><pre>import torch<br>import torch_frame<br>from torch_frame.data import DataFrame<br>from torch_frame.nn import ResNet<br><br># Load graph data as relational DataFrame<br>customer_data = graph.query(&quot;&quot;&quot;<br>    MATCH (c:Customer)<br>    OPTIONAL MATCH (c)-[:OWNS]-&gt;(a:Account)<br>    OPTIONAL MATCH (c)-[:HAS_TRANSACTION]-&gt;(t:Transaction)<br>    WHERE t.timestamp &gt; datetime() - duration({months: 6})<br>    RETURN<br>        c.id as customer_id,<br>        c.age as age,<br>        c.segment as segment,<br>        count(DISTINCT a) as num_accounts,<br>        sum(a.balance_pence) as total_balance,<br>        count(t) as txn_count_6m,<br>        avg(t.amount_pence) as avg_txn_amount<br>&quot;&quot;&quot;)<br># Convert to torch_frame DataFrame<br>df = DataFrame(customer_data)<br># Define model<br>model = ResNet(<br>    in_channels=df.num_features,<br>    hidden_channels=128,<br>    out_channels=2,  # Binary classification: churn vs retain<br>    num_layers=4<br>)<br># Zero-shot inference (using pre-trained weights)<br>model.load_pretrained(&quot;torch_frame_foundation_model.pth&quot;)<br># Predict<br>with torch.no_grad():<br>    predictions = model(df.x)<br>    churn_probs = torch.softmax(predictions, dim=1)[:, 1]<br># High-risk customers<br>high_risk_mask = churn_probs &gt; 0.75<br>high_risk_customers = customer_data[high_risk_mask]<br>print(f&quot;Found {len(high_risk_customers)} high-risk customers&quot;)</pre><h4>4. PyTorch Geometric (PyG) — Graph Neural Networks</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*hijbNike-_03LrrQj6BzPg.gif" /></figure><p><strong>What it is:</strong> Industry-standard open-source library for graph neural networks.</p><p><strong>Installation:</strong></p><pre>pip install torch-geometric</pre><p><strong>Example: Fraud detection on transaction graph</strong></p><pre>import torch<br>from torch_geometric.data import Data<br>from torch_geometric.nn import GCNConv, global_mean_pool<br><br># Build transaction graph from knowledge graph<br>edges = graph.query(&quot;&quot;&quot;<br>    MATCH (t1:Transaction)-[:SAME_ACCOUNT]-&gt;(t2:Transaction)<br>    RETURN t1.id as source, t2.id as target<br>&quot;&quot;&quot;)<br>edge_index = torch.tensor([[e.source for e in edges], <br>                           [e.target for e in edges]], dtype=torch.long)<br># Node features<br>transactions = graph.query(&quot;&quot;&quot;<br>    MATCH (t:Transaction)<br>    RETURN <br>        t.id as txn_id,<br>        t.amount_pence as amount,<br>        t.merchant_category as category,<br>        t.timestamp.hour as hour,<br>        t.merchant_country as country<br>&quot;&quot;&quot;)<br>x = torch.tensor([<br>    [t.amount, encode_category(t.category), t.hour, encode_country(t.country)]<br>    for t in transactions<br>], dtype=torch.float)<br># Labels (if training)<br>y = torch.tensor([t.is_fraud for t in transactions], dtype=torch.long)<br># Create PyG graph<br>data = Data(x=x, edge_index=edge_index, y=y)<br># Define GNN model<br>class FraudDetectionGNN(torch.nn.Module):<br>    def __init__(self):<br>        super().__init__()<br>        self.conv1 = GCNConv(4, 64)<br>        self.conv2 = GCNConv(64, 64)<br>        self.conv3 = GCNConv(64, 2)  # Binary: fraud vs legitimate<br>        <br>    def forward(self, data):<br>        x, edge_index = data.x, data.edge_index<br>        <br>        x = self.conv1(x, edge_index).relu()<br>        x = self.conv2(x, edge_index).relu()<br>        x = self.conv3(x, edge_index)<br>        <br>        return torch.softmax(x, dim=1)<br>model = FraudDetectionGNN()<br># Zero-shot (load pre-trained)<br>model.load_state_dict(torch.load(&quot;fraud_detection_pretrained.pth&quot;))<br># Predict<br>with torch.no_grad():<br>    predictions = model(data)<br>    fraud_probs = predictions[:, 1]<br># Flag suspicious transactions<br>suspicious_mask = fraud_probs &gt; 0.8<br>suspicious_txns = [transactions[i].txn_id for i in suspicious_mask.nonzero()]<br>print(f&quot;Flagged {len(suspicious_txns)} suspicious transactions&quot;)</pre><h4>5. RelBench — Benchmark Framework</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*QTDuu0xxWAE2raZ4HUc0sQ.gif" /></figure><p><strong>What it is:</strong> Open benchmark for evaluating relational learning models on real-world datasets.</p><p><strong>Installation:</strong></p><pre>pip install relbench</pre><p><strong>Example: Benchmark zero-shot models</strong></p><pre>from relbench.datasets import get_dataset<br>from relbench.modeling import Graph2Tabular<br>from relbench.evaluation import evaluate<br><br># Load banking dataset<br>dataset = get_dataset(&quot;retail_banking&quot;)<br># Test multiple zero-shot approaches<br>models = {<br>    &quot;kumo&quot;: KumoZeroShot(),<br>    &quot;tabpfn&quot;: TabPFNZeroShot(),<br>    &quot;pytorch_frame&quot;: PyTorchFrameZeroShot(),<br>    &quot;gnn_pretrained&quot;: PretrainedGNN()<br>}<br>results = {}<br>for name, model in models.items():<br>    predictions = model.predict(dataset.test_data)<br>    metrics = evaluate(predictions, dataset.test_labels)<br>    results[name] = metrics<br># Compare<br>print(&quot;Zero-Shot Model Comparison:&quot;)<br>print(f&quot;{&#39;Model&#39;:&lt;20} {&#39;Accuracy&#39;:&gt;10} {&#39;F1-Score&#39;:&gt;10} {&#39;Latency (ms)&#39;:&gt;15}&quot;)<br>print(&quot;-&quot; * 60)<br>for name, metrics in results.items():<br>    print(f&quot;{name:&lt;20} {metrics.accuracy:&gt;10.2%} {metrics.f1:&gt;10.2f} {metrics.latency_ms:&gt;15.1f}&quot;)</pre><p><strong>Output:</strong></p><pre>Zero-Shot Model Comparison:<br>Model                  Accuracy   F1-Score   Latency (ms)<br>------------------------------------------------------------<br>kumo                      89.2%       0.87           145.3<br>tabpfn                    84.5%       0.81            67.2<br>pytorch_frame             86.1%       0.83            98.4<br>gnn_pretrained            87.3%       0.85           112.7</pre><h4>6. Traditional ML Baselines: XGBoost, LightGBM, CatBoost</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*fyzUUckGm3RECmPetGZO5Q.gif" /></figure><p><strong>When to use:</strong> When you have labeled training data and can afford the training time.</p><p><strong>XGBoost example:</strong></p><pre>import xgboost as xgb<br>from sklearn.model_selection import train_test_split<br><br># Extract features from graph<br>features = graph.query(&quot;&quot;&quot;<br>    MATCH (c:Customer)<br>    OPTIONAL MATCH (c)-[:OWNS]-&gt;(a:Account)<br>    OPTIONAL MATCH (c)-[:HAS_TRANSACTION]-&gt;(t:Transaction)<br>    WHERE t.timestamp &gt; datetime() - duration({months: 12})<br>    RETURN<br>        c.id,<br>        c.age,<br>        c.income,<br>        count(DISTINCT a) as num_accounts,<br>        sum(a.balance_pence) as total_balance,<br>        count(t) as txn_count,<br>        avg(t.amount_pence) as avg_txn<br>&quot;&quot;&quot;)<br>X = features[[&quot;age&quot;, &quot;income&quot;, &quot;num_accounts&quot;, &quot;total_balance&quot;, &quot;txn_count&quot;, &quot;avg_txn&quot;]]<br>y = features[&quot;churned&quot;]  # Requires historical labels<br># Train/test split<br>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)<br># Train XGBoost<br>model = xgb.XGBClassifier(<br>    max_depth=6,<br>    learning_rate=0.1,<br>    n_estimators=100<br>)<br>model.fit(X_train, y_train)<br># Evaluate<br>accuracy = model.score(X_test, y_test)<br>print(f&quot;XGBoost Accuracy: {accuracy:.2%}&quot;)<br># Predict<br>y_pred = model.predict_proba(X)[:, 1]</pre><p><strong>Comparison: Zero-Shot vs Traditional ML</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mX5gwZ1eqX7adFJNanol0Q.png" /></figure><h3>Part 6: Complete Implementation Example</h3><h4>End-to-End Implementation</h4><pre># Step 1: Define ontology<br>from rdflib import Graph, Namespace, RDF, RDFS, OWL<br><br>ontology = Graph()<br>BANK = Namespace(&quot;http://openbanking.example.com/ontology#&quot;)<br># Define Account class hierarchy<br>ontology.add((BANK.Account, RDF.type, OWL.Class))<br>ontology.add((BANK.CurrentAccount, RDFS.subClassOf, BANK.Account))<br>ontology.add((BANK.SavingsAccount, RDFS.subClassOf, BANK.Account))<br>ontology.add((BANK.ISAAccount, RDFS.subClassOf, BANK.SavingsAccount))<br># Define properties<br>ontology.add((BANK.hasOwner, RDF.type, OWL.ObjectProperty))<br>ontology.add((BANK.hasBalance, RDF.type, OWL.DatatypeProperty))<br>ontology.add((BANK.isLiquid, RDF.type, OWL.DatatypeProperty))<br># Save ontology<br>ontology.serialize(destination=&quot;banking_ontology.owl&quot;, format=&quot;xml&quot;)<br># Step 2: Build knowledge graph from contracts<br>import neo4j<br>driver = neo4j.GraphDatabase.driver(&quot;bolt://localhost:7687&quot;)<br>def build_graph_from_contracts():<br>    contracts = load_all_contracts()<br>    <br>    with driver.session() as session:<br>        # Create constraints<br>        session.run(&quot;&quot;&quot;<br>            CREATE CONSTRAINT customer_id IF NOT EXISTS<br>            FOR (c:Customer) REQUIRE c.id IS UNIQUE<br>        &quot;&quot;&quot;)<br>        <br>        # Ingest customers<br>        customers = api.get_customers()<br>        for customer in customers:<br>            session.run(&quot;&quot;&quot;<br>                MERGE (c:Customer {id: $id})<br>                SET c.name = $name,<br>                    c.segment = $segment,<br>                    c.risk_profile = $risk_profile<br>            &quot;&quot;&quot;, **customer)<br>        <br>        # Ingest accounts (internal + external)<br>        for customer in customers:<br>            accounts = get_all_accounts(customer.id)<br>            <br>            for account in accounts:<br>                # Normalize using contract<br>                contract = get_contract(account.source_bank, &quot;account_balance&quot;)<br>                normalized = normalize_account(account, contract)<br>                <br>                # Apply business rules<br>                normalized[&#39;liquid&#39;] = classify_liquidity(normalized)<br>                <br>                # Create node<br>                session.run(&quot;&quot;&quot;<br>                    MERGE (a:Account {id: $id})<br>                    SET a += $properties<br>                &quot;&quot;&quot;, id=account.id, properties=normalized)<br>                <br>                # Create relationship<br>                session.run(&quot;&quot;&quot;<br>                    MATCH (c:Customer {id: $customer_id})<br>                    MATCH (a:Account {id: $account_id})<br>                    MERGE (c)-[:OWNS]-&gt;(a)<br>                &quot;&quot;&quot;, customer_id=customer.id, account_id=account.id)<br># Step 3: Query graph<br>def query_customer_assets(customer_id):<br>    with driver.session() as session:<br>        result = session.run(&quot;&quot;&quot;<br>            MATCH (c:Customer {id: $customer_id})-[:OWNS]-&gt;(a:Account)<br>            RETURN<br>                c.id as customer_id,<br>                collect({<br>                    id: a.id,<br>                    balance: a.balance_pence,<br>                    type: a.type,<br>                    liquid: a.liquid,<br>                    source: a.source_bank<br>                }) as accounts<br>        &quot;&quot;&quot;, customer_id=customer_id)<br>        <br>        return result.single()<br># Step 4: Zero-shot prediction<br>from kumo import KumoClient<br>kumo = KumoClient(api_key=os.getenv(&quot;KUMO_API_KEY&quot;))<br>def predict_optimal_funding(customer_id, target_amount):<br>    # Get customer subgraph<br>    assets = query_customer_assets(customer_id)<br>    <br>    # Convert to Kumo format<br>    graph_data = {<br>        &quot;nodes&quot;: [<br>            {&quot;id&quot;: customer_id, &quot;type&quot;: &quot;Customer&quot;}<br>        ],<br>        &quot;edges&quot;: []<br>    }<br>    <br>    for account in assets[&#39;accounts&#39;]:<br>        graph_data[&quot;nodes&quot;].append({<br>            &quot;id&quot;: account[&#39;id&#39;],<br>            &quot;type&quot;: &quot;Account&quot;,<br>            &quot;properties&quot;: account<br>        })<br>        graph_data[&quot;edges&quot;].append({<br>            &quot;source&quot;: customer_id,<br>            &quot;target&quot;: account[&#39;id&#39;],<br>            &quot;type&quot;: &quot;OWNS&quot;<br>        })<br>    <br>    # Query Kumo<br>    prediction = kumo.predict(<br>        graph=graph_data,<br>        query=f&quot;Optimal mix to fund {target_amount/100}K minimizing tax and penalties&quot;,<br>        constraints=[<br>            &quot;Maintain emergency fund of £10K&quot;,<br>            &quot;Minimize total cost (taxes + penalties + opportunity cost)&quot;<br>        ]<br>    )<br>    <br>    return prediction<br># Step 5: Execute recommendation<br>result = predict_optimal_funding(&quot;CUST_X&quot;, 20000000)  # £200K<br>print(&quot;Recommendation:&quot;)<br>for source in result[&#39;recommendation&#39;][&#39;sources&#39;]:<br>    print(f&quot;  {source[&#39;account_id&#39;]}: £{source[&#39;amount_pence&#39;]/100:.2f}&quot;)<br>    print(f&quot;    Cost: £{source[&#39;cost_pence&#39;]/100:.2f}&quot;)<br>    print(f&quot;    Reason: {source[&#39;reason&#39;]}\n&quot;)<br>print(f&quot;Total funded: £{result[&#39;recommendation&#39;][&#39;total_funded_pence&#39;]/100:.2f}&quot;)<br>print(f&quot;Total cost: £{result[&#39;recommendation&#39;][&#39;total_cost_pence&#39;]/100:.2f}&quot;)</pre><h3>Part 7: Use Cases Beyond House Deposits</h3><h4>Churn Prediction</h4><p><strong>Query:</strong></p><pre>prediction = kumo.predict(<br>    graph=knowledge_graph,<br>    query=&quot;Which customers are likely to churn in next 90 days?&quot;,<br>    return_top_k=100<br>)</pre><p><strong>What Kumo analyzes:</strong></p><ul><li>Decreasing balance trend over 6 months</li><li>Reduced transaction frequency</li><li>No recent deposits</li><li>Single account (no cross-sell)</li><li>No external accounts linked (low engagement)</li><li>Complaints or service issues in transaction notes</li></ul><p><strong>Output:</strong></p><pre>{<br>  &quot;high_risk_customers&quot;: [<br>    {<br>      &quot;customer_id&quot;: &quot;CUST_001&quot;,<br>      &quot;churn_probability&quot;: 0.87,<br>      &quot;reason&quot;: &quot;Balance decreased 60% in 6 months, no deposits since March, single account&quot;<br>    },<br>    {<br>      &quot;customer_id&quot;: &quot;CUST_042&quot;,<br>      &quot;churn_probability&quot;: 0.81,<br>      &quot;reason&quot;: &quot;Transaction frequency dropped 75%, opened external account at competitor&quot;<br>    }<br>  ]<br>}</pre><h4>Fraud Detection</h4><p><strong>Query:</strong></p><pre>prediction = kumo.predict(<br>    graph=knowledge_graph,<br>    query=&quot;Is transaction TXN_12345 fraudulent?&quot;,<br>    context={<br>        &quot;txn_id&quot;: &quot;TXN_12345&quot;,<br>        &quot;threshold&quot;: 0.75<br>    }<br>)</pre><p><strong>What Kumo analyzes:</strong></p><ul><li>Transaction amount vs customer’s historical average</li><li>Merchant location vs customer’s home country</li><li>Transaction time vs customer’s typical hours</li><li>Merchant category (high-risk: gambling, crypto, wire transfers)</li><li>Recent pattern changes (velocity, geography, category)</li><li>Graph neighborhood (similar customers’ fraud history)</li></ul><p><strong>Output:</strong></p><pre>{<br>  &quot;fraud_probability&quot;: 0.92,<br>  &quot;flags&quot;: [<br>    &quot;amount_10x_average&quot;,<br>    &quot;foreign_country&quot;,<br>    &quot;unusual_hours&quot;,<br>    &quot;high_risk_category&quot;<br>  ],<br>  &quot;recommendation&quot;: &quot;Block and request customer verification&quot;<br>}</pre><h4>Cross-Sell Optimization</h4><p><strong>Query:</strong></p><pre>prediction = kumo.predict(<br>    graph=knowledge_graph,<br>    query=&quot;Which customers should receive mortgage offers?&quot;,<br>    constraints=[<br>        &quot;Income &gt; £30K/year&quot;,<br>        &quot;No missed payments 12 months&quot;,<br>        &quot;Age 25-45&quot;<br>    ],<br>    return_top_k=500<br>)</pre><p><strong>What Kumo analyzes:</strong></p><ul><li>Income deposits (salary patterns)</li><li>Savings balance (deposit availability)</li><li>Payment history (creditworthiness)</li><li>Life stage (age, household structure)</li><li>Recent major purchases (furniture, appliances = moving?)</li><li>Rent payments (looking to buy?)</li></ul><p><strong>Output:</strong></p><pre>{<br>  &quot;qualified_customers&quot;: [<br>    {<br>      &quot;customer_id&quot;: &quot;CUST_078&quot;,<br>      &quot;propensity_score&quot;: 0.89,<br>      &quot;estimated_mortgage_amount&quot;: 250000,<br>      &quot;reason&quot;: &quot;£45K income, £60K savings, rent £1200/mo, recent furniture purchases&quot;<br>    }<br>  ]<br>}</pre><h3>Part 8: Comparison: Traditional ML vs Zero-Shot</h3><p><strong>See animated GIF above for visual comparison.</strong></p><h4>When to Use Zero-Shot</h4><p><strong>Best for:</strong></p><ul><li><strong>New use cases:</strong> No historical data yet (new product launch, new fraud pattern)</li><li><strong>Rare events:</strong> Insufficient training examples (AML, rare diseases)</li><li><strong>Rapid prototyping:</strong> Need answer today, not in 3 months</li><li><strong>Dynamic domains:</strong> Relationships change frequently (customer behavior shifts)</li><li><strong>Explainability requirements:</strong> Regulators want reasoning paths</li><li><strong>Multiple use cases:</strong> One graph enables infinite predictions</li></ul><p><strong>Examples:</strong></p><ul><li>Launch new credit card → predict uptake (no historical data)</li><li>Detect new fraud pattern → flag suspicious (no labeled examples)</li><li>Cross-sell campaign → find best prospects (need results this week)</li></ul><h4>When to Use Traditional ML</h4><p><strong>Best for:</strong></p><ul><li><strong>Maximum accuracy:</strong> 2–3% gain justifies 12–16 week timeline</li><li><strong>Static predictions:</strong> Problem well-defined, data plentiful, patterns stable</li><li><strong>High-frequency inference:</strong> Millions of predictions per second</li><li><strong>Limited graph structure:</strong> Tabular data with few relationships</li><li><strong>Regulatory constraints:</strong> Must use approved models (some regulators lag on foundation models)</li></ul><p><strong>Examples:</strong></p><ul><li>Credit scoring (well-established, stable, heavily regulated)</li><li>Transaction categorization (millions per day, simple features)</li><li>ATM cash optimization (stationary time series)</li></ul><h3>Part 9: Implementation Roadmap</h3><h4>Phase 1: Ontology &amp; Schema (Weeks 1–2)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*uldALqfKFsMNNyq7jbZHrg.gif" /></figure><p><strong>Deliverables:</strong></p><ol><li>Banking ontology (OWL format)</li><li>Business rules documentation</li><li>Graph schema design</li><li>Contract-to-graph mapping</li></ol><p><strong>Tools:</strong></p><ul><li>Protégé (ontology editor)</li><li>Neo4j Desktop (graph visualization)</li><li>GitHub (version control)</li></ul><h4>Phase 2: Graph Construction (Weeks 3–6)</h4><p><strong>Deliverables:</strong></p><ol><li>Neo4j database setup</li><li>Ingestion pipeline (contracts → graph)</li><li>Data normalization layer</li><li>Quality validation suite</li></ol><p><strong>Code:</strong></p><pre># Install Neo4j<br>docker run -p 7474:7474 -p 7687:7687 \<br>  -v $HOME/neo4j/data:/data \<br>  neo4j:latest<br><br># Install Python client<br>pip install neo4j rdflib<br># Run ingestion<br>python ingest_graph.py --contracts ./contracts/ --graph bolt://localhost:7687</pre><h3>Phase 3: Zero-Shot Integration (Weeks 7–10)</h3><p><strong>Option A: Commercial (Kumo AI)</strong></p><pre># Sign up: https://kumo.ai<br># Get API key<br>export KUMO_API_KEY=&quot;your-key-here&quot;<br><br>pip install kumo-client<br>python test_kumo.py --graph bolt://localhost:7687 --query &quot;churn prediction&quot;</pre><p><strong>Option B: Open Source (PyTorch Frame)</strong></p><pre>pip install torch torch-frame<br><br>python test_pytorch_frame.py --graph bolt://localhost:7687 --model pretrained</pre><p><strong>Deliverables:</strong></p><ol><li>Model integration (Kumo or PyTorch Frame)</li><li>Query templates (churn, fraud, cross-sell)</li><li>Evaluation metrics (accuracy, latency, cost)</li><li>A/B test vs baseline (if traditional ML exists)</li></ol><h4>Phase 4: Production Deployment (Weeks 11–14)</h4><p><strong>Deliverables:</strong></p><ol><li>REST API for predictions</li><li>Monitoring dashboard (latency, accuracy, cost)</li><li>Explainability UI (reasoning paths)</li><li>Regulatory documentation (audit trail)</li></ol><p><strong>API example:</strong></p><pre>from fastapi import FastAPI<br>from kumo import KumoClient<br><br>app = FastAPI()<br>kumo = KumoClient(api_key=os.getenv(&quot;KUMO_API_KEY&quot;))<br>@app.post(&quot;/predict/churn&quot;)<br>def predict_churn(customer_id: str):<br>    subgraph = graph.get_subgraph(&quot;Customer&quot;, customer_id)<br>    prediction = kumo.predict(<br>        graph=subgraph,<br>        query=&quot;Churn risk in next 90 days&quot;<br>    )<br>    return prediction<br>@app.post(&quot;/predict/fraud&quot;)<br>def predict_fraud(txn_id: str):<br>    subgraph = graph.get_subgraph(&quot;Transaction&quot;, txn_id)<br>    prediction = kumo.predict(<br>        graph=subgraph,<br>        query=&quot;Is this transaction fraudulent?&quot;<br>    )<br>    return prediction</pre><h3>Part 10: Key Takeaways</h3><h4>The Zero-Shot Advantage</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*6UtptHa_lR7NQRaL1CX4ag.gif" /></figure><p><strong>Traditional ML:</strong></p><pre>Use Case 1: Churn Prediction<br>- Feature engineering: 4 weeks<br>- Training: 2 weeks<br>- Validation: 2 weeks<br>- Deployment: 2 weeks<br>= 10 weeks<br><br>Use Case 2: Fraud Detection<br>- Feature engineering: 4 weeks<br>- Training: 2 weeks<br>... (repeat)<br>= 10 weeks<br><br>Use Case 3: Cross-Sell<br>= 10 weeks<br><br><br>Total: 30 weeks for 3 use cases</pre><p><strong>Zero-Shot:</strong></p><pre>Build knowledge graph once: 6 weeks<br><br>Use Case 1: Query graph<br>= Same day<br><br>Use Case 2: Query graph<br>= Same day<br>Use Case 3: Query graph<br>= Same day<br>Total: 6 weeks for infinite use cases</pre><h4>The Ontology Foundation</h4><p><strong>Without ontology:</strong></p><ul><li>“What is liquidity?” → Different definitions across teams</li><li>Account types inconsistent</li><li>Business rules embedded in code</li><li>No semantic validation</li></ul><p><strong>With ontology:</strong></p><ul><li>Formal definition: “Liquid = accessible within 24h without penalty”</li><li>Account taxonomy: CurrentAccount → liquid = true (by definition)</li><li>Business rules declarative and testable</li><li>Semantic validation at ingestion time</li></ul><h4>Open vs Commercial</h4><p><strong>Commercial (Kumo AI):</strong></p><ul><li>✅ Highest accuracy (89–92%)</li><li>✅ Production-ready, enterprise support</li><li>✅ Pre-trained on financial datasets</li><li>❌ Cost: Enterprise pricing</li><li>❌ Vendor lock-in</li></ul><p><strong>Open Source (PyTorch Frame, PyG):</strong></p><ul><li>✅ Free, no vendor lock-in</li><li>✅ Full control, customizable</li><li>✅ Active community, rapid innovation</li><li>❌ Lower accuracy (86–88%)</li><li>❌ Requires ML expertise</li><li>❌ Self-hosted infrastructure</li></ul><p><strong>Recommendation:</strong> Start with <strong>PyTorch Frame</strong> (open source) to prove concept. If 2–3% accuracy gain justifies enterprise cost, migrate to <strong>Kumo AI</strong>.</p><h3>Conclusion</h3><p><strong>Zero-shot inference on knowledge graphs is the missing link for agentic AI in Open Banking.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*VDd06gMLUPIZ5pk-Or2aOg.gif" /></figure><p>The combination of:</p><ol><li><strong>Ontologies</strong> (formal concepts and constraints)</li><li><strong>Business rules</strong> (executable logic)</li><li><strong>Knowledge graphs</strong> (unified relational data)</li><li><strong>Relational foundation models</strong> (zero-shot predictions)</li></ol><p>…eliminates the 12–16 week ML cycle while delivering 85–90% accuracy.</p><p><strong>For banks:</strong></p><ul><li>Deploy new use cases same-day instead of quarterly</li><li>Reduce ML infrastructure costs 10x</li><li>Maintain explainability for regulators</li><li>Enable true agentic decision-making</li></ul><p><strong>For agents:</strong></p><ul><li>Reason over relationships, not just features</li><li>Traverse multi-hop paths (Customer → Account → Transaction → Merchant → Risk)</li><li>Return predictions with full reasoning paths</li><li>Operate on semantic guarantees from contracts</li></ul><p><strong>The future is not feature engineering. It’s graph traversal.</strong></p><p>Build your knowledge graph. Query with Kumo or PyTorch Frame. Deploy agentic intelligence today, not next quarter.</p><h3>References</h3><ul><li><strong>Open Data Contract Standard (ODCS):</strong> <a href="https://github.com/bitol-io/open-data-contract-standard">https://github.com/bitol-io/open-data-contract-standard</a></li><li><strong>Kumo AI:</strong> <a href="https://kumo.ai/">https://kumo.ai</a></li><li><strong>PyTorch Frame:</strong> <a href="https://pytorch.org/frame">https://pytorch.org/frame</a></li><li><strong>PyTorch Geometric:</strong> <a href="https://pytorch-geometric.readthedocs.io/">https://pytorch-geometric.readthedocs.io</a></li><li><strong>RelBench:</strong> <a href="https://relbench.stanford.edu/">https://relbench.stanford.edu</a></li><li><strong>Neo4j Graph Database:</strong> <a href="https://neo4j.com/">https://neo4j.com</a></li><li><strong>Web Ontology Language (OWL):</strong> <a href="https://www.w3.org/OWL">https://www.w3.org/OWL</a></li><li><strong>Open Banking UK:</strong> <a href="https://www.openbanking.org.uk/">https://www.openbanking.org.uk</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a1ef9ea1e02" width="1" height="1" alt=""><hr><p><a href="https://medium.com/youme-technology/day-71-1-6-agentic-ai-in-open-banking-zero-shot-ml-inference-on-knowledge-graph-7a1ef9ea1e02">Day 71 1.6: Agentic AI in Open Banking — Zero-shot ML inference on Knowledge Graph</a> was originally published in <a href="https://medium.com/youme-technology">AI Smart</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Last Six Months in LLMs in Five Minutes — Finance Edition]]></title>
            <link>https://medium.com/youme-technology/the-last-six-months-in-llms-in-five-minutes-finance-edition-635006a566c5?source=rss----9f2a2586502---4</link>
            <guid isPermaLink="false">https://medium.com/p/635006a566c5</guid>
            <category><![CDATA[banking]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[LAKSHMI VENKATESH]]></dc:creator>
            <pubDate>Tue, 19 May 2026 12:48:16 GMT</pubDate>
            <atom:updated>2026-05-19T13:34:59.923Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Last Six Months in LLMs in Five Minutes — Finance Edition</h3><p><em>A lightning talk for the BFSI architect in the room.</em></p><h3><strong>1 — The November 2025 inflection point</strong></h3><p>Six months is a convenient window because it brackets what’s now being called the November 2025 inflection point… In the consumer world, that’s when coding agents crossed from “often works” to “daily-driver.” In banking, it’s when the <em>agentic</em> conversation stopped being a slide and started becoming a procurement decision. Every tier-1 I know has a live agentic pilot now. Six months ago they had a Centre of Excellence and a PowerPoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*NyaRgQ88904rKzAckX7cvw.gif" /></figure><h3><strong>2 — The “best model” changed hands five times</strong></h3><p>The frontier crown moved between Anthropic, OpenAI, and Google five times in six months: Sonnet 4.5 → GPT-5.1 → Gemini 3 → GPT-5.1 Codex Max → Opus 4.5, and then Gemini 3.1 Pro and Opus 4.7 in the spring. The architectural lesson for a bank is unambiguous: <strong>never single-vendor your model layer</strong>. Build a thin abstraction (LiteLLM, your own gateway, whatever) so model swaps cost a config change, not a quarter. Your Model Risk Management framework should treat the model as a <em>replaceable component</em>, not an embedded dependency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*8VwOIL1iRl7Q72sg6DVP9g.gif" /></figure><h3><strong>3 —No lab would optimize for it</strong></h3><p>The finance been running on every new release is: <em>“Given this 47-page ISDA Master Agreement and a 12-page CSA, extract every threshold, MTA, independent amount, and eligible collateral schedule into a structured JSON that matches our internal schema, and flag any clauses that deviate from ISDA 2002 standard.”</em></p><p>In September, Sonnet 4.5 got about 70% of the fields right and hallucinated counterparty names in the edge cases. By April, Opus 4.7 and Gemini 3.1 Pro were both pushing 95%+ on a held-out set of 200 agreements, with calibrated uncertainty on the remaining 5%. That delta — in six months — is the entire business case for a collateral-ops modernisation programme.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*xw2P0mEfZ4S2nK1HuWYaeQ.gif" /></figure><h3><strong>4 — Theme 1: Coding agents got really good</strong></h3><p>For banks: <strong>internal developer productivity is the first defensible ROI line for GenAI</strong>, ahead of any client-facing use case. Claude Code, Codex, and Cursor crossed the line where a senior engineer can delegate a Jira ticket and review a PR instead of writing it. The architecture implication is unglamorous and important — your developer environment is now a regulated surface. Code generated by an agent touches your golden-source repos. That means SAST/DAST on agent output, signed commits attributed to the human reviewer, and audit trails that satisfy a SOX or MAS TRM auditor. The control perimeter moved from “what runs in prod” to “what the agent proposes.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*dqJo9gVQVlcAN1dc3sQgMA.gif" /></figure><h3><strong>5 — Theme 2: Reasoning models broke the cost-of-thought curve</strong></h3><p>Reasoning models (o-series, Claude’s extended thinking, Gemini’s thinking mode) made it economically viable to spend $0.50–$2 of inference compute on a <em>single</em> decision. For a chatbot answering “where’s my statement,” that’s absurd. For a credit memo synthesis, an AML narrative, a model-validation review, a regulatory horizon-scan? It’s a rounding error against the analyst hour it replaces. The mental model has flipped from “tokens are cheap, use them everywhere” to <strong>“reasoning is expensive, route it deliberately.”</strong> Cheap models for retrieval and extraction, reasoning models for judgment, deterministic tools for math. That routing layer is the new architecture diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*jYQPTRXTzT7wqbXDruxKGw.gif" /></figure><h3><strong>6 — Theme 3 (the finance-specific one): Regulators caught up</strong></h3><p>In the last six months: the EU AI Act’s general-purpose AI obligations kicked in (August 2025), MAS issued the FEAT-Agentic supplementary guidance, the UK FCA published its AI Live Testing framework, and the US OCC released its agentic-AI third-party risk bulletin. The compliance perimeter is now codified. If you’re building agents that touch a customer or a position, you need: a model inventory, a documented evaluation regime, human-in-the-loop at material decision points, and a kill switch. That’s not optional any more — it’s auditable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*9RytEZD7puKMPZRac3mCDg.gif" /></figure><p><strong>7 — Theme 4: Local and open-weight models got serious</strong></p><p>Gemma 4, GLM-5.1, Qwen3.6 — open-weight models are now within striking distance of frontier on narrow tasks. For BFSI this matters for one specific reason: <strong>data residency and air-gapped inference</strong>. Singapore, EU, Switzerland, and a growing list of jurisdictions have desks where customer data cannot leave the perimeter. A 30B-parameter Qwen running in your own VPC, fine-tuned on your taxonomy, is now a credible alternative to a frontier API call for extraction, classification, and summarisation workloads. Your inference strategy needs a <em>tiered</em> shape: frontier API for reasoning, mid-tier hosted for general workloads, local open-weight for sovereign and high-volume.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*40fqvPfDRoRLPtF3QYVKTw.gif" /></figure><h3><strong>8 — The takeaway</strong></h3><p>Two consumer themes (agents got good, local models surprised), two finance-specific ones (regulators codified the perimeter, reasoning models broke the cost curve). The architectural job for the next six months is to stop treating LLMs as a model-selection problem and start treating them as a <strong>routing, control, and evaluation problem</strong>. The model will change again in November. Your routing, governance, and eval harness shouldn’t.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*18wO7F_QZFO9bkNDCIZf0Q.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=635006a566c5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/youme-technology/the-last-six-months-in-llms-in-five-minutes-finance-edition-635006a566c5">The Last Six Months in LLMs in Five Minutes — Finance Edition</a> was originally published in <a href="https://medium.com/youme-technology">AI Smart</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 71 1.3: Agentic AI in Open Banking: Building on Open Data Contracts(semantic guarantees)]]></title>
            <link>https://medium.com/youme-technology/day-71-1-3-agentic-ai-in-open-banking-building-on-open-data-contracts-semantic-guarantees-de5f3d0579a4?source=rss----9f2a2586502---4</link>
            <guid isPermaLink="false">https://medium.com/p/de5f3d0579a4</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[odc]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[LAKSHMI VENKATESH]]></dc:creator>
            <pubDate>Mon, 11 May 2026 05:38:42 GMT</pubDate>
            <atom:updated>2026-05-11T08:30:02.192Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hceTxdQy1rx4gmKY8unrXQ.gif" /></figure><h3>Agentic AI in Open Banking: Building on Open Data Contracts</h3><p><strong>The architecture that makes agents trustworthy at ecosystem scale</strong></p><h3>Executive Summary</h3><p>Open Banking created standardized APIs. Agentic AI creates autonomous intelligence. <strong>Open Data Contracts</strong> make that intelligence trustworthy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*fiPTEF2cBtR6uUs0SG1qqw.gif" /></figure><p>This article explains why Open Data Contracts — inspired by ODCS (Open Data Contract Standard) — are the missing semantic layer between Open Banking APIs and agentic systems, and how to build the complete architecture from knowledge graphs to zero-shot predictions to MCP-federated execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*MHAcDYHSafWpQYss2AHGHQ.gif" /></figure><p><strong>What we will discuss:</strong></p><ul><li>Why Open Banking APIs need semantic contracts (not just schemas)</li><li>How ODCS principles translate to financial services</li><li>The complete architecture: Contracts → Knowledge Graph → Zero-Shot ML → MCP</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*rN0jwDdwS0lV6P_sLlMHQQ.gif" /></figure><ul><li>Implementation patterns with real examples</li><li>The regulatory and audit advantages</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*ut2X0qHIOiSjE_cYdPEhVg.gif" /></figure><h3>Part 1: The Problem — APIs Without Semantics</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*kqhA86_-YRqiFwVCKr0FrQ.gif" /></figure><h4>What Open Banking Gave Us</h4><p>Open Banking (PSD2 in Europe, CMA in UK, similar frameworks globally) mandated that banks expose standardized APIs for:</p><ul><li>Account information (/accounts/{id}/balance, /accounts/{id}/transactions)</li><li>Payment initiation (/payments/domestic, /payments/international)</li><li>Confirmation of funds (/funds-confirmations)</li></ul><p><strong>The promise:</strong> Third parties can build services on top of a unified financial data layer.</p><p><strong>The reality:</strong> Each bank’s API returns different semantics under the same endpoint.</p><h4>The Semantic Gap:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cSAGMBuWY0ayOWC3LDJbOw.png" /></figure><p><strong>Questions an agent can’t answer:</strong></p><ul><li>Is balance: 5000 in pounds or pence? (£50 vs £5,000)</li><li>Is this available balance or ledger balance?</li><li>How fresh is this data? (Real-time or cached?)</li><li>What’s the data source? (Core banking ledger, cache, warehouse?)</li><li>What happens if this data is wrong?</li><li>Can I rely on this for a £10K transfer decision?</li></ul><p><strong>At human speed:</strong> A developer catches this in testing, hardcodes exceptions per bank.</p><p><strong>At machine speed:</strong> An agent executes 1,000 transactions on malformed data before anyone notices.</p><h4>Why JSON Schema Isn’t Enough</h4><h4>JSON Schema validates <strong>structure</strong>, not <strong>meaning</strong>:</h4><pre># JSON Schema tells you:<br>balance:<br>  type: integer<br>  <br># JSON Schema does NOT tell you:<br>- Units: minor (pence) or major (pounds)?<br>- Semantics: available, ledger, or pending?<br>- Freshness: real-time or cached?<br>- Source: which system?<br>- SLA: what uptime guarantee?</pre><p>For human developers building CRUD apps, this is manageable.</p><p>For <strong>agentic AI making autonomous financial decisions</strong>, this is catastrophic.</p><h3>Part 2: The Solution — Open Data Contracts</h3><h4><strong>The Open Data Contracts Structure</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DedqeB5Ktz3564J_jkuFug.gif" /></figure><h4>What Are Open Data Contracts?</h4><p><strong>Open Data Contract Standard (ODCS)</strong> is a specification for machine-readable data contracts that declare:</p><ul><li><strong>Schema</strong> — Shape of the data (JSON Schema)</li><li><strong>Semantics</strong> — Meaning of the data (business logic)</li><li><strong>Quality</strong> — SLA, accuracy, completeness</li><li><strong>Lineage</strong> — Source system, ownership, refresh rate</li><li><strong>Compliance</strong> — Regulatory standards met</li></ul><p><strong>Originally designed for:</strong> Data lakes, analytics pipelines, data governance.</p><p><strong>We’re adapting it for:</strong> Open Banking APIs consumed by agentic AI systems.</p><h4>ODCS Principles Applied to Open Banking</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IxzC7ajbyL-h8sBDjngFHA.png" /></figure><h4>Example: Open Data Contract for /accounts/balance</h4><pre># Open Banking API Contract v2.0<br>contract_id: &quot;account_balance_v2&quot;<br>version: &quot;2.0.0&quot;<br>published_date: &quot;2024-06-15T00:00:00Z&quot;<br>status: &quot;active&quot;<br><br>publisher:<br>  organization: &quot;Retail Banking Division&quot;<br>  team: &quot;Treasury Operations&quot;<br>  contact: &quot;api-support@example.com&quot;<br><br>api_endpoint:<br>  path: &quot;/accounts/{accountId}/balance&quot;<br>  method: &quot;GET&quot;<br>  base_url: &quot;https://api.openbanking.example.com/v2&quot;<br>  <br>schema:<br>  response:<br>    type: &quot;object&quot;<br>    properties:<br>      balance:<br>        type: &quot;integer&quot;<br>        description: &quot;Account balance in minor currency units&quot;<br>        example: 500000<br>        <br>      currency:<br>        type: &quot;string&quot;<br>        format: &quot;ISO_4217&quot;<br>        description: &quot;Three-letter currency code&quot;<br>        example: &quot;GBP&quot;<br>        <br>      balanceType:<br>        type: &quot;string&quot;<br>        enum: [&quot;available&quot;, &quot;ledger&quot;, &quot;pending&quot;]<br>        description: &quot;Type of balance returned&quot;<br>        example: &quot;available&quot;<br>        <br>      lastUpdated:<br>        type: &quot;string&quot;<br>        format: &quot;date-time&quot;<br>        description: &quot;Timestamp of last balance update&quot;<br>        <br>    required: [&quot;balance&quot;, &quot;currency&quot;, &quot;balanceType&quot;, &quot;lastUpdated&quot;]<br><br>semantics:<br>  balance_units: &quot;minor_currency&quot;  # Always pence/cents<br>  balance_calculation: &quot;Real-time query to core banking ledger&quot;<br>  includes_pending_transactions: false<br>  available_vs_ledger: &quot;available = ledger - holds - pending debits&quot;<br>  <br>quality:<br>  sla:<br>    uptime: &quot;99.9%&quot;<br>    p95_latency_ms: 200<br>    p99_latency_ms: 500<br>    <br>  accuracy:<br>    tolerance: &quot;£0.01&quot;<br>    reconciliation_frequency: &quot;real-time&quot;<br>    <br>  rate_limits:<br>    per_customer: &quot;100 requests/minute&quot;<br>    per_application: &quot;10000 requests/minute&quot;<br><br>lineage:<br>  source_system: &quot;Core Banking Ledger v3.2&quot;<br>  source_table: &quot;accounts.current_balance&quot;<br>  refresh_mechanism: &quot;Event-driven (transaction posting)&quot;<br>  data_owner: &quot;Treasury Operations&quot;<br>  steward: &quot;Head of Digital Banking&quot;<br>  <br>  data_flow:<br>    - system: &quot;Core Banking&quot;<br>      update_frequency: &quot;real-time&quot;<br>    - system: &quot;API Gateway Cache&quot;<br>      ttl_seconds: 5<br>      <br>compliance:<br>  regulations:<br>    - name: &quot;PSD2&quot;<br>      article: &quot;Article 36 - Access to payment account&quot;<br>      jurisdiction: &quot;EU&quot;<br>      <br>    - name: &quot;GDPR&quot;<br>      article: &quot;Article 6(1)(b) - Contract&quot;<br>      lawful_basis: &quot;Customer consent via OAuth 2.0&quot;<br>      <br>    - name: &quot;UK CMA Open Banking&quot;<br>      version: &quot;3.1.10&quot;<br>      specification_url: &quot;https://standards.openbanking.org.uk/&quot;<br>      <br>  data_classification: &quot;PII - Personal Financial Information&quot;<br>  retention_policy: &quot;7 years per financial regulation&quot;<br>  <br>changelog:<br>  - version: &quot;2.0.0&quot;<br>    date: &quot;2024-06-15&quot;<br>    changes:<br>      - &quot;Added balanceType field to distinguish available vs ledger&quot;<br>      - &quot;Added lastUpdated timestamp&quot;<br>      - &quot;Changed balance to always be minor units (breaking change)&quot;<br>    breaking: true<br>    migration_guide: &quot;https://docs.example.com/migration-v2&quot;<br>    <br>  - version: &quot;1.0.0&quot;<br>    date: &quot;2023-01-10&quot;<br>    changes:<br>      - &quot;Initial release&quot;<br>    breaking: false</pre><h4>What This Contract Guarantees</h4><p><strong>For Agents:</strong></p><ul><li>balance: 500000 = £5,000.00 (guaranteed minor units)</li><li>balanceType: &quot;available&quot; = ledger minus holds/pending</li><li>Data is ≤5 seconds old (cache TTL)</li><li>Source is real-time ledger, not warehouse</li><li>99.9% uptime SLA</li><li>&lt;200ms response time (p95)</li></ul><p><strong>For Regulators:</strong></p><ul><li>PSD2 Article 36 compliant</li><li>GDPR lawful basis: customer consent</li><li>UK CMA Open Banking 3.1.10 specification</li><li>Full lineage from core banking to API</li><li>7-year retention as required</li></ul><p><strong>For Governance:</strong></p><ul><li>Data owner: Treasury Operations</li><li>Breaking changes tracked with migration guides</li><li>Version 2.0.0 published 2024–06–15</li><li>Contact: <a href="/service/mailto:api-support@example.com">api-support@example.com</a></li></ul><h3>Part 3: Architecture Layer 1 — Contract-Validated Middleware</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*AARNwuJXFhQ_yvx4A-jgww.gif" /></figure><h4>Where Contracts Fit in the Stack</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WMR0LsC9VkYeyqFGhRZiAw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YhnxHsIL5XftZcLos9_WFg.gif" /></figure><h4>Contract Validation Flow</h4><p><strong>Step 1: Agent makes API call via MCP</strong></p><pre># Agent calls MCP tool<br>result = mcp.call(&quot;banking.get_balance&quot;, {<br>    &quot;account_id&quot;: &quot;ACC123&quot;<br>})</pre><p><strong>Step 2: Middleware intercepts</strong></p><pre># Middleware loads published contract<br>contract = load_contract(&quot;account_balance_v2&quot;)<br><br># Makes actual API call<br>response = http.get(f&quot;{bank_api_url}/accounts/ACC123/balance&quot;)<br><br># Validates response against contract<br>validation_result = validate_response(response, contract)<br><br>if not validation_result.valid:<br>    # Circuit breaker fires<br>    log_violation(contract, response, validation_result.errors)<br>    raise ContractViolationError(<br>        f&quot;API response violated contract: {validation_result.errors}&quot;<br>    )</pre><p><strong>Step 3: Semantic validation</strong></p><pre># Schema validation (JSON Schema)<br>if response.balance is not int:<br>    raise SchemaViolation(&quot;balance must be integer&quot;)<br><br># Semantic validation (contract guarantees)<br>if response.balance_units != &quot;minor_currency&quot;:<br>    raise SemanticViolation(&quot;balance must be in minor units per contract&quot;)<br>    <br># SLA validation<br>if response_time_ms &gt; contract.quality.sla.p95_latency_ms:<br>    log_sla_breach(contract, response_time_ms)<br>    <br># Freshness validation<br>age_seconds = now() - response.lastUpdated<br>if age_seconds &gt; contract.lineage.cache_ttl:<br>    raise FreshnessViolation(f&quot;Data is {age_seconds}s old, max allowed: 5s&quot;)</pre><p><strong>Step 4: Return validated data to agent</strong></p><pre># Agent receives data with contract guarantees<br># Can now trust:<br># - balance is in pence<br># - balanceType tells available vs ledger<br># - data is ≤5s old<br># - source is real-time ledger</pre><h4>Contract Repository Architecture</h4><p><strong>Centralized contract registry:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*4LIiZkhrBbu5YR7YIUE9Ig.gif" /></figure><pre>/contracts<br>  /banking<br>    /accounts<br>      - balance_v1.yaml<br>      - balance_v2.yaml (current)<br>      - transactions_v1.yaml<br>    /payments<br>      - domestic_v1.yaml<br>      - international_v1.yaml<br>  /wealth<br>    /portfolio<br>      - holdings_v1.yaml<br>      - performance_v1.yaml</pre><p><strong>Contract discovery:</strong></p><pre># Agent asks: &quot;What contracts are available for accounts?&quot;<br>contracts = registry.list_contracts(domain=&quot;banking.accounts&quot;)<br><br># Returns:<br>[<br>  {<br>    &quot;contract_id&quot;: &quot;account_balance_v2&quot;,<br>    &quot;version&quot;: &quot;2.0.0&quot;,<br>    &quot;endpoint&quot;: &quot;/accounts/{id}/balance&quot;,<br>    &quot;status&quot;: &quot;active&quot;<br>  },<br>  {<br>    &quot;contract_id&quot;: &quot;account_transactions_v1&quot;,<br>    &quot;version&quot;: &quot;1.0.0&quot;,<br>    &quot;endpoint&quot;: &quot;/accounts/{id}/transactions&quot;,<br>    &quot;status&quot;: &quot;active&quot;<br>  }<br>]</pre><p><strong>Middleware loads contract on first call, caches:</strong></p><pre># First call: load and cache<br>contract = registry.get_contract(&quot;account_balance_v2&quot;)<br>cache.set(f&quot;contract:{contract_id}&quot;, contract, ttl=3600)<br><br># Subsequent calls: use cached contract<br>contract = cache.get(f&quot;contract:{contract_id}&quot;)</pre><h3>Part 4: Architecture Layer 2 — Knowledge Graph from Contracts</h3><h4>Why Agents Need a Graph, Not Just APIs</h4><p><strong>The problem with API-first:</strong></p><pre>Agent needs: &quot;All accounts belonging to Customer X&quot;<br><br>Without graph:<br>1. Call /customers/X → get customer details<br>2. Parse response, find account_ids list<br>3. For each account_id:<br>   4. Call /accounts/{id}/balance<br>   5. Call /accounts/{id}/details<br>   <br>Result: N+1 queries, slow, no relationships</pre><p><strong>With Knowledge Graph:</strong></p><pre>Agent queries graph:<br>MATCH (c:Customer {id: &quot;X&quot;})-[:OWNS]-&gt;(a:Account)<br>RETURN a<br><br>Result: One query, instant, includes all relationships</pre><h4>Building the Graph from Contracts</h4><p><strong>Contracts declare entities and relationships:</strong></p><pre># Contract: account_balance_v2.yaml<br>entities:<br>  Account:<br>    identifier: &quot;accountId&quot;<br>    properties:<br>      - balance (integer, minor units)<br>      - currency (ISO 4217)<br>      - balanceType (enum)<br>      <br>    relationships:<br>      - name: &quot;ownedBy&quot;<br>        target: &quot;Customer&quot;<br>        cardinality: &quot;many-to-one&quot;<br>        inverse: &quot;owns&quot;<br>        <br>      - name: &quot;partOf&quot;<br>        target: &quot;Portfolio&quot;<br>        cardinality: &quot;many-to-many&quot;<br>        description: &quot;Accounts can belong to investment portfolios&quot;<br>        <br>      - name: &quot;linkedTo&quot;<br>        target: &quot;ExternalAccount&quot;<br>        cardinality: &quot;many-to-many&quot;<br>        description: &quot;Accounts linked via Open Banking consent&quot;</pre><p><strong>Graph ingestion pipeline:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zry1FcI2IwzgZpUEtBSnRA.gif" /></figure><pre># 1. Read all published contracts<br>contracts = registry.list_all_contracts()<br><br># 2. Extract entity schemas<br>for contract in contracts:<br>    for entity_name, entity_schema in contract.entities.items():<br>        graph.create_node_type(<br>            name=entity_name,<br>            properties=entity_schema.properties,<br>            identifier=entity_schema.identifier<br>        )<br><br># 3. Extract relationships<br>for contract in contracts:<br>    for entity in contract.entities:<br>        for relationship in entity.relationships:<br>            graph.create_edge_type(<br>                name=relationship.name,<br>                source=entity.name,<br>                target=relationship.target,<br>                cardinality=relationship.cardinality<br>            )<br><br># 4. Populate graph from APIs<br>for customer in all_customers():<br>    # Create customer node<br>    graph.create_node(&quot;Customer&quot;, customer.id, customer.data)<br>    <br>    # Get accounts via API<br>    accounts = api.get_accounts(customer.id)<br>    <br>    for account in accounts:<br>        # Create account node<br>        graph.create_node(&quot;Account&quot;, account.id, account.data)<br>        <br>        # Create relationship<br>        graph.create_edge(&quot;Customer&quot;, customer.id, &quot;owns&quot;, &quot;Account&quot;, account.id)</pre><h4>Multi-Bank Graph Unification</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dtlRtugY-9fr7Xj1LmANSg.gif" /></figure><p><strong>The challenge:</strong> Customer has accounts at multiple banks.</p><p><strong>Without contracts:</strong></p><pre>Internal Bank: balance field = minor units (pence)<br>External Bank A: balance field = major units (pounds)<br>External Bank B: accountBalance.amount = string &quot;50.00&quot;<br><br>Graph contains semantically inconsistent data</pre><p><strong>With contracts:</strong></p><pre># Load contracts for all banks<br>internal_contract = load_contract(&quot;internal&quot;, &quot;account_balance_v2&quot;)<br>external_a_contract = load_contract(&quot;bank_a&quot;, &quot;account_balance_v1&quot;)<br>external_b_contract = load_contract(&quot;bank_b&quot;, &quot;account_balance_v2&quot;)<br><br># Normalize based on contract semantics<br>def normalize_balance(bank, raw_response):<br>    contract = load_contract(bank, &quot;account_balance&quot;)<br>    <br>    if contract.semantics.balance_units == &quot;minor_currency&quot;:<br>        # Already in pence<br>        return raw_response.balance<br>        <br>    elif contract.semantics.balance_units == &quot;major_currency&quot;:<br>        # Convert pounds to pence<br>        return int(raw_response.balance * 100)<br>        <br>    elif contract.schema.response.balance.type == &quot;string&quot;:<br>        # Parse string, convert to pence<br>        pounds = float(raw_response.accountBalance.amount)<br>        return int(pounds * 100)<br>        <br># Store normalized data in graph<br>graph.create_node(&quot;Account&quot;, {<br>    &quot;id&quot;: account_id,<br>    &quot;balance_pence&quot;: normalize_balance(bank, response),  # Always pence<br>    &quot;currency&quot;: &quot;GBP&quot;,<br>    &quot;source_bank&quot;: bank,<br>    &quot;source_contract&quot;: contract.contract_id<br>})</pre><p><strong>Result:</strong> Graph contains semantically consistent data regardless of source bank.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Fxj-nCGhs2UgJizVCfPtRw.gif" /></figure><h4>Graph Schema Example</h4><pre>Nodes:<br>  Customer<br>    - id (UUID)<br>    - name<br>    - type (retail, corporate, private)<br>    <br>  Account<br>    - id (IBAN or internal ID)<br>    - balance_pence (integer, normalized)<br>    - currency (ISO 4217)<br>    - balance_type (available, ledger)<br>    - source_bank (internal, bank_a, bank_b)<br>    - source_contract (contract version)<br>    <br>  Portfolio<br>    - id<br>    - name<br>    - strategy (growth, income, balanced)<br>    <br>  ExternalAccount<br>    - id<br>    - bank_identifier<br>    - consent_status (active, revoked)<br>    - consent_expiry<br>    <br>Edges:<br>  Customer -[owns]-&gt; Account<br>  Customer -[partOf]-&gt; Household<br>  Account -[partOf]-&gt; Portfolio<br>  Account -[linkedTo]-&gt; ExternalAccount<br>  Account -[hasTransaction]-&gt; Transaction<br>  Transaction -[beneficiary]-&gt; Entity</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*0CPsIS5cgapYILXwOlo92w.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de5f3d0579a4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/youme-technology/day-71-1-3-agentic-ai-in-open-banking-building-on-open-data-contracts-semantic-guarantees-de5f3d0579a4">Day 71 1.3: Agentic AI in Open Banking: Building on Open Data Contracts(semantic guarantees)</a> was originally published in <a href="https://medium.com/youme-technology">AI Smart</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 71 1.1: Agentic ai + Open Banking Architecture for Internal Banking Businesses and External]]></title>
            <link>https://medium.com/youme-technology/day-71-1-1-agentic-ai-open-banking-architecture-for-internal-banking-businesses-and-external-9da1504a874d?source=rss----9f2a2586502---4</link>
            <guid isPermaLink="false">https://medium.com/p/9da1504a874d</guid>
            <category><![CDATA[open-banking]]></category>
            <category><![CDATA[banking]]></category>
            <category><![CDATA[agentic-ai-architecture]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[LAKSHMI VENKATESH]]></dc:creator>
            <pubDate>Sun, 10 May 2026 09:29:25 GMT</pubDate>
            <atom:updated>2026-05-10T09:29:26.933Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Build Internal Open Banking FIRST, then External</strong></p><p><strong>Why?</strong></p><ol><li><strong>You control both sides</strong> — both internal and extenral. That way, it is easier to standardize, machine readable and put Observability on top of it</li><li><strong>Higher ROI</strong> — most customer value is cross-business-line (retail + wealth + corporate)</li><li><strong>Proves the pattern</strong> — once internal works, external is the same architecture</li><li><strong>Regulatory ready</strong> — when external Open Banking mandate hits, you’re already compliant</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ugT8_wfSg8jjBIZTMPetNg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8bQTOmJjwcUsyt4zSZCfbA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y6AMyjSn6XUT6gNxCvHnyQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9da1504a874d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/youme-technology/day-71-1-1-agentic-ai-open-banking-architecture-for-internal-banking-businesses-and-external-9da1504a874d">Day 71 1.1: Agentic ai + Open Banking Architecture for Internal Banking Businesses and External</a> was originally published in <a href="https://medium.com/youme-technology">AI Smart</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>