<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Chia Jeng Yang on Medium]]></title>
        <description><![CDATA[Stories by Chia Jeng Yang on Medium]]></description>
        <link>https://medium.com/@chiajy?source=rss-6975d2c42b25------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*93LozG419VJY8XaqrTstnw.jpeg</url>
            <title>Stories by Chia Jeng Yang on Medium</title>
            <link>https://medium.com/@chiajy?source=rss-6975d2c42b25------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 02:34:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chiajy/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Best Legal AI Tool Might Be a Legal Auditor]]></title>
            <link>https://medium.com/foremark-legal/the-best-legal-ai-tool-might-be-a-legal-auditor-ce42b32de057?source=rss-6975d2c42b25------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce42b32de057</guid>
            <category><![CDATA[legaltech]]></category>
            <category><![CDATA[audit]]></category>
            <category><![CDATA[law]]></category>
            <dc:creator><![CDATA[Chia Jeng Yang]]></dc:creator>
            <pubDate>Thu, 22 Oct 2026 15:36:40 GMT</pubDate>
            <atom:updated>2026-10-22T15:36:40.955Z</atom:updated>
            <content:encoded><![CDATA[<p>By: <a href="https://www.linkedin.com/in/chia-jeng-yang/">Chia Jeng Yang</a> (Co-Founder, Foremark Legal) &amp; <a href="https://www.linkedin.com/in/ryanconnerlaw/">Ryan Connor</a> (Ex-Managing Counsel @ Atrium, Advisory Board @ Spellbook, Angel @ Foremark Legal)</p><p>AI initially evolved as the ultimate tool to generate and develop code for software developers. Like the software development industry, the legal industry has also focused heavily on AI’s ability to produce work, specifically around drafting contracts or briefs — a crucial part of the legal workflow . However, its most consequential use may be to check whether that work (human or AI), and every step behind it, has been done correctly.</p><p>Speed alone does not establish value. As <a href="https://www.artificiallawyer.com/2025/04/28/if-we-achieve-legal-ai-perfection-everything-changes/">Richard Tromans</a> points out, saving half an hour with AI achieves little if a lawyer then spends half an hour checking the result. <a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5621550">Joshua Yuvaraj</a> calls this the “verification-value paradox”. AI can produce legal work faster, but lawyers remain responsible for checking that it is accurate, complete and relevant. The more work AI generates, the more there is to verify. He argues that this checking can consume much of the promised efficiency gain, leaving little net value once the cost of verification is counted.</p><p>That raises a different question: Are we overlooking the part of the legal value chain where AI could have its greatest impact? Furthermore, rather than producing more legal documents, should legal AI focus on delivering higher quality results — more precision and accuracy for attorneys?</p><h3>AI’s greatest value may be as an auditor</h3><p>The dynamics and economics of the legal AI industry have made drafting a natural starting point. Its outputs are visible, and time savings are readily measured. The value of auditing is harder to demonstrate in a product demo: it lies in errors prevented and failures that never happen.</p><p>What if the most valuable application of AI is checking the work that humans already do?</p><p>An AI-native firm’s advantage lies in its ability to invest in long-term auditing capabilities whose return comes through better service, even when these investments and product features are not directly revenue generating.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*9QAWtfcCWmTUGEkyyRuJjg.png" /><figcaption>Source: <a href="https://x.com/HoffProf/status/2112138745256517762?s=20">https://x.com/HoffProf/status/2112138745256517762?s=20</a></figcaption></figure><p>In his analysis of 9,241 merger agreements,<a href="https://x.com/HoffProf/status/2112138745256517762"> Dave Hoffman</a> reported that typo patterns are more strongly associated with particular lawyer teams than with the firm itself. That strengthens the case for making quality control part of a firm’s infrastructure. An AI auditing system could apply the firm’s required checks across teams and matters, making the standard of checking less dependent on which lawyers handle the file.</p><h3>A good draft does not prove a properly completed process</h3><p>The distinction I am making is between evaluating an AI-generated draft and recognizing the value of AI as a general auditor in legal processes. As <a href="https://www.artificiallawyer.com/2025/04/28/if-we-achieve-legal-ai-perfection-everything-changes/">Richard Tromans</a> puts it: “A law firm is not just an economic pyramid of legal labour, it is a pyramid of quality control.”</p><p>The idea of legal “evaluations” has frequently been applied in the context of evaluating outputs. However, checking an output does not establish that every required step in the matter was completed.</p><p>A good draft is not proof of a properly completed process. A demand letter may read as complete while leaving out the client’s MRI entirely. The client mentioned it at intake and the firm requested the report, but it never arrived and nobody followed up. Nothing in the letter reveals the gap; it only shows up when the draft is checked against the intake notes and the records log. An AI auditor could check the file against the evidence required for the matter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xFogLpewVyoEkNsts2bqNg.png" /></figure><p>A point many engineers miss is that much of the work in a law firm involves running processes that sit outside a Word Document, including developing and executing legal strategies and processes across high-volume personal injury, e-discovery or complex, multifaceted due diligence.</p><p>Auditing should therefore cover people, processes and outputs. Were all the required procedural steps completed? Did information get lost between teams? Is a legal conclusion adequately supported, or was material evidence overlooked?</p><p>The auditing task starts with defined checks and evidence, then identifies departures requiring attention. In law, each step matters even when the answer seems obvious and checking feels pointless. Triple-checking that a legal process has crossed the t’s and dotted the i’s is part of the work itself.</p><p>This audit task represents the work of a junior- and mid-level associate. The attention to detail that lawyers require develops from lengthy, time-tested checklists of specific items to verify. This work, unlike the more complex nuances of swaying judicial opinion based on caselaw, can easily be verified and improved with AI.</p><p>Secondly, much of this audit work is where human error occurs. Attorneys burning the midnight oil often wait to verify citations or triple-check for typos at the last minute when they are simply too tired to function effectively. An audit function well defined with AI does not make those errors.</p><h3>AI can make comprehensive quality control affordable</h3><p>Comprehensive auditing was historically constrained by the cost of expertise. A more experienced lawyer had to check a junior person’s work. Trust was the currency of the realm, because it was one of the highest leverage tools for a senior partner to grow their business without being constrained by the time required in quality control.</p><p>Writing down the checks did not remove the cost of performing them, but AI changes the economics of running those checks. We can separate the expertise required to design an audit from the effort required to run it across thousands of matters.</p><h3>Errors prevented matter more than hours saved</h3><p>The economic case depends on catching more errors than existing supervision at an acceptable cost of human review. Each finding should point to evidence, and the audit itself should be tested against known failures.</p><p>Success should be measured through errors prevented, missing evidence identified, incorrectly rejected cases recovered and process failures caught before harm occurs. Hours saved and documents generated tell only part of the story.</p><p>Applied to quality control, AI could improve the reliability of the whole legal value chain. We can now build audits designed by humans but run by machines.</p><h3>The winning firm will turn legal expertise into auditing infrastructure</h3><p>The AI-native law firm that wins will build the best infrastructure to lower the friction in turning the legal expertise trapped in lawyers’ heads into automated AI auditing systems.</p><p>The friction in extracting that expertise is the hard part. As <a href="https://thebrainyacts.beehiiv.com/p/271-the-ai-test-law-firms-aren-t-running-but-should-be">Josh Kubicki</a> puts it, “Most law firms rolled out AI without ever defining the exam it needs to pass.” We need to take the checks experienced lawyers carry out in their heads and build them into an AI auditing system that performs those checks automatically across matters. That means asking lawyers what they check and why, then translating their answers into instructions the system can follow: which documents to examine, what evidence to look for, which procedural steps to verify and when to alert a lawyer.</p><p>Human oversight remains essential, but the opportunity is to make expert supervision more consistent and scalable. <a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6762198">Thomas Potter</a> proposes using AI for structured verification, with lawyers concentrating their judgment on the issues those checks flag. Lawyers must review significant findings, resolve ambiguity and take responsibility for decisions.</p><p>Law firms have long rationed quality control because experienced lawyers have limited time. AI gives us a way to apply their expertise across every matter through audits they design and oversee. The value lies in making that level of care routine. A single material error caught can be worth more than hundreds of hours saved drafting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*prMntRIjGys8P08vfW8vDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HpUs2i7RFzZ7q9hp2i2AtQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce42b32de057" width="1" height="1" alt=""><hr><p><a href="https://medium.com/foremark-legal/the-best-legal-ai-tool-might-be-a-legal-auditor-ce42b32de057">The Best Legal AI Tool Might Be a Legal Auditor</a> was originally published in <a href="https://medium.com/foremark-legal">Foremark Legal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architecture for the Outcome-Based, AI-Native Law Firm]]></title>
            <link>https://medium.com/foremark-legal/architecture-for-the-outcome-based-ai-native-law-firm-c6d8917d7957?source=rss-6975d2c42b25------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6d8917d7957</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[future-of-work]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[legaltech]]></category>
            <category><![CDATA[law]]></category>
            <dc:creator><![CDATA[Chia Jeng Yang]]></dc:creator>
            <pubDate>Sun, 06 Sep 2026 17:56:51 GMT</pubDate>
            <atom:updated>2026-09-08T19:31:19.984Z</atom:updated>
            <content:encoded><![CDATA[<p>For a century, the law firm has been built on three personas. The finder wins the business, the minder manages the client and runs the matter, and the grinder produces the underlying legal work. Most partnership fights, compensation disputes, and failed mergers are downstream of the tension between these three functions. The framework endured because it matched the constraints of running a law practice. Business was generated through personal relationships, a matter ran only as well as the lawyer minding it, and legal work was by and large manual.</p><p>An AI-native firm is not a traditional firm that bought AI tools. It is a firm designed from the ground up around new capabilities, the way Amazon was not just a bookstore with a website.</p><p>The AI-native firm changes the form of the three functions of finding the business, minding the matter, and grinding out the work. The finder industrializes into a firm-owned acquisition engine, because as AI expands capacity the bottleneck moves from lawyer hours to quality clients. The minder’s craft, which cases to take, when to escalate, when to settle, is written down and encoded into systems, run by a small self-contained unit (“Pod”). The grinder’s production is absorbed by machines, and the lawyer moves up to developing the legal theories that open new case types.</p><p>As you cannot bill an agent’s hour, the economics must change with the business of law and the organization of the law firm. The firm shifts from selling time to underwriting outcomes. It evaluates a case up front the way an insurer evaluates a policy and ties its fee to the result instead of the clock.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PGnDxTWLVQqM_wvllSbtzg.png" /></figure><h4><strong>Organizational</strong></h4><ul><li>Empowering Practice Heads with <strong>Quant Fund style Pod teams</strong>: The AI-native firm runs each practice area as a pod with dedicated engineering and marketing resources with its own P&amp;L.</li><li><strong>Decentralizing Ops</strong> to the Practice Area level: The traditional firm only has a firm-level COO, with operations as overhead nobody owns. The AI-native firm additionally gives practice area heads dedicated biz ops leads inside the pod, to ensure that each practice-area gets adoption right.</li><li>Measuring <strong>Client NPS</strong>: The traditional firm leaves the client experience unmeasured. The AI-native firm measures NPS per matter, like every other consumer industry.</li></ul><h4><strong>Technological</strong></h4><ul><li><strong>Case Data Infrastructure</strong>: The AI-native firm automatically collects data on market terms and counterparty behavior, compounding with volume, answering questions on ‘How X company reacts to Y’, or ‘Is a $500,000 settlement the average amount for cases with similar facts’.</li><li><strong>Legal Knowledge Infrastructure</strong> to augment the Apprenticeship model: The traditional firm transfers judgment by manual apprenticeship. The AI-native firm builds a living knowledge base based on matter correspondence model training, queryable by every lawyer in the firm.</li></ul><h4><strong>Commercial</strong></h4><ul><li><strong>Demand-Generation Engine</strong>: Client acquisition engines that are commonplace for your typical consumer or SMB tech startups become increasingly adopted by AI-native law firms, competing with legacy law firms whose client engagement strategy is manual.</li><li><strong>Outcome-based Business Model</strong>: The traditional firm is paid for time regardless of result. The AI-native firm acts like a case underwriting, forever changing the customer expectation, promoting contingency and flat-fee businesses that earn only when the client wins.</li><li><strong>Compensation structure</strong>: The traditional firm pays hours-based comp with some origination. The AI-native firm pays flat salary plus bonus plus equity, with no hourly billing. As in every other industry, good lawyers work hard because they are motivated, not because their hours are tracked. All lawyers, junior and senior, are given MSO equity, making long-term investment rational.</li><li><strong>Management credit</strong>: At the traditional firm, management is a tax the best lawyers avoid. At the AI-native firm, building the firm, improving processes, and expanding new practice areas is the highest-credited work in it.</li></ul><h3>The finder becomes an industrialized marketing engine</h3><p>In the traditional firm, business arrives through the charisma and networks of individual rainmakers, which makes the finder the most powerful and expensive person in a firm.</p><p>In contrast, the new Finder of the AI-native firm is a consumer growth operator or a B2B sales talent. Modern startups and enterprise software companies treat client acquisition as a repeatable operating function, investing heavily in market intelligence to identify opportunities before competitors do. Consumer law and SMB companies are obvious areas of first adoption for modern client acquisition.</p><p>To give a flavor:</p><ul><li><strong>Consumer law:</strong> <strong>Reimagine the client experience</strong> by replacing traditional advertising and consultations with product-led experiences that deliver immediate legal guidance, transparent case tracking, proactive communication, and self-service, setting the standard against Apple, Amazon, and Uber rather than other law firms.</li><li><strong>SMB law:</strong> <strong>Become the legal operating system</strong> by integrating with payroll, accounting, HR, CRM, and banking platforms to continuously monitor legal risks, automate compliance, and provide proactive guidance as businesses grow. This is similar to how traditional relationship-based SMB sales, like insurance, moved into more automated online partnership-heavy GTM motions.</li><li><strong>High-end transactional:</strong> <strong>Build an AI-powered opportunity engine</strong> by continuously monitoring market signals such as M&amp;A, fundraising, litigation, regulations, executive changes, and industry news to identify emerging client needs and enable highly personalized business development.</li></ul><p>In my conversation with <a href="https://www.linkedin.com/in/ryanwalkerdata"><strong>Ryan Walker</strong></a>, ex-CTO of Casetext and CEO of <a href="https://general.legal/"><strong>General Legal</strong></a>, an AI-native firm focused on serving startups, he puts the constraint on the commercial rather than the technical side.</p><p>Traditional law firms generally have no GTM function, and have the expectation that business arrives inbound on reputation, with none of the machinery every tech startup built to scale a sales process.</p><p>He notes that replicating basic sales excellence techniques and the more innovative SMB sales motions that tech startups pioneer every single day, and applying them to a traditional industry like the legal industry will likely be the needle-mover to bring a tremendous advantage.</p><p>Rainmaker-only economics are deprioritized because the book of business belongs to the platform rather than to any partner. Retention inverts for the same reason: at traditional firms partners leave because their clients follow them, and the firm adds little beyond a brand and office space. At the AI-native firm, a departing lawyer walks away from a client acquisition engine, case-scoring models, and accumulated outcome data that are difficult to replicate solo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rp0h4dXK2JmwBPxjW0iuRw.png" /></figure><h3>The minder becomes the pod</h3><p>The Minder is the workhorse of a traditional law firm. In litigation, this is the lawyer who keeps dozens of deadlines from slipping, decides when to push and when to settle, and deals with the client. In deal work, it is the lawyer who knows what is market in a venture financing, which terms the other side will trade and which they will fight for, and how to sequence a closing so it actually closes. In the traditional firm, all of that lives in one person’s head, which is why a matter runs only as well as the lawyer minding it, and why quality collapses the moment volume outruns the supply of careful people.</p><p>In the AI-native firm, that craft leaves the lawyer’s head and gets embedded in the machinery itself. Each practice area operates as its own decentralized Pod with a practice lead, dedicated engineers, and a dedicated business operating officer, and each pod carries its own profit and loss on top of a shared platform built on institutionalizing the Pod’s workflow. The business operations officer sits at the practice level, not only at the firm-level. Practice areas differ too much in their operations for a firm-level executive to be anything but firm-level ops management (payroll, CRM, etc).</p><p>In the AI-native firm, quality is observable per pod, per lawyer, and per case type. The client experience gets the same treatment, with NPS measured per matter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w8Xr4rm5jzRkQ63jXg1pvQ.png" /></figure><h3>The grinder becomes the strategic thought partner</h3><p>Nobody applies to law school dreaming of document review. They apply to become the person in the room when the company’s future is being decided. The AI-native firm builds its technology stack around institutionalizing this thought leader to create the 100x Lawyer.</p><p>Theory development is this person’s highest-leverage work. The grinder develops new legal theories to pursue litigation on, and in the AI-native firm this is a research and development function with direct commercial consequence: a validated theory opens a new case type, and a case type at sufficient volume seeds a new pod. The grinder also gets involved in matters where legal creativity matters — theory selection, negotiation posture, and courtroom judgment do not resolve to pattern matching.</p><p>Research becomes quantitative. The grinder’s agents sweep case law, dockets, verdicts, and the firm’s own outcome data so that a hypothesis is tested against the whole corpus at once rather than against whatever an associate could read in a week. The lawyer directs inquiry instead of performing it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V24T9AmjeKqfCneZ9Mosng.png" /></figure><h3>The people model that results</h3><p>Partnership comes through apprenticeship, because the old pipeline is dead. The associate model trained lawyers by burying them in production work under an apprenticeship structure, and that has not diminished significantly as laterals are prioritized in the AI-age.</p><p>The apprenticeship runs on a living knowledge base. Agents capture the firm’s emails and case correspondence, and structure them into an institutional agent memory. A young lawyer queries the knowledge base with the questions a prior generation asked a senior attorney, and gets answers drawn from how the firm’s best lawyers actually handled the situation rather than from how one mentor happened to remember it.</p><p>In my conversation with <a href="https://www.linkedin.com/in/eddie-nasser"><strong>Eddie Nasser</strong></a>, Head of AI at <a href="https://www.kellerpostman.com/"><strong>Keller Postman</strong></a> / ex-Head of AI at <a href="https://crosby.ai/"><strong>Crosby</strong></a>, frames the progression in three stages:</p><p>“The traditional law firm apprenticeship model is single-player: one junior learns from one partner through repeated drafts and feedback.</p><p>[My] framework for AI adoption evolves that model in three stages: first, <strong>single-player querying,</strong> where a lawyer asks an AI system for help; then <strong>multiplayer querying</strong>, where an AI system can draw on the collective context and judgment of many lawyers across the firm; and finally <strong>multiplayer proactive suggestions</strong>, where agents understand what the team is doing and start surfacing the next action themselves.”</p><p>For example, noticing you are working on a particular workflow and proactively scheduling and suggesting certain actions, just like a very helpful senior partner who has desktop access to your computer.</p><p>Compensation follows a more systematic platform approach. Lawyers earn a flat salary plus bonus plus equity. Most industries, except manufacturing floors and lawyers, do not track the hours worked internally as a measure of productivity. Motivated people work hard because they are motivated and incentivized well, not because their hours are tracked.</p><p>Credit flows to the work that builds the firm in the same way it works in other industries: launching a new pod, building the systems a pod runs on, developing apprentices into partners, and lifting pod-level economics. At traditional firms, management is a tax: time spent running the firm is time not billing, so the best lawyers avoid it and firms are run by whoever could not say no. The AI-native firm credits building the firm as the highest-value work in it, and rewards the culture accordingly.</p><p>Every lawyer, senior or junior, holds equity in the management services organization. Traditional partnerships are annual profit-distribution machines with little in retained earnings, so no partner has a reason to invest in anything that pays off after retirement. Equity makes long-term investment rational, and justifies the management credit.</p><h3>The Data Infrastructure difference</h3><p>The shared platform rests on two data infrastructures, and they collect different data for different reasons.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xRehXxJzzRw0Js21TCNbvw.png" /></figure><p><strong>The Case Data infrastructure is the firm’s Commercial Record</strong>: settlement values, case outcomes, counterparty behavior, and the negotiation patterns of counterparties like insurers.</p><p>The questions this case data infrastructure answers include:</p><ul><li>Based on our historical case data, if a client has X type of injuries in Georgia, what is the typical range of settlements that are offered?</li><li>Based on our historical case data, are MFNs more common or market standard for startups investments over $50m?</li><li>Based on our historical case data, when we deal with this insurer, what elements are they typically more sensitive to than others?</li></ul><p>The firm collects this data because underwriting requires it; an insurer cannot price risk without actuarial history, and a contingency firm cannot decide which cases to take, what they are worth, or when to settle without an outcome history of its own.</p><p>In my conversation with <a href="https://www.linkedin.com/in/kylecanchola/"><strong>Kyle Canchola</strong></a>, Partner at <a href="https://www.vectorlegal.com/"><strong>Vector Legal</strong></a>, an AI-native firm focused on serving investors and startups, he notes that “AI can make negotiation memory institutional: lawyers can see which positions were taken, where counterparties moved, and what tradeoffs worked across prior deals.”</p><p><strong>The Legal Knowledge infrastructure is the firm’s Intellectual Record</strong>: the research, briefs, arguments, and case correspondence in which the firm’s lawyers actually reason.</p><p>The questions this legal knowledge infrastructure answers include:</p><ul><li>What fact patterns and arguments survived federal preemption in pharmaceutical warning-label cases?</li><li>For personal injury cases, what are the different ways we have creatively tied the demands of their job to the injury at hand?</li><li>Does Judge X favor First Amendment arguments in commercial advertising cases?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*u9OUYIkZv08amNXiipndPQ.png" /><figcaption>Quote from <a href="https://x.com/theNickBerk/status/2075595381526733031">Nick Berk</a></figcaption></figure><p>The firm collects this because judgment has always been its scarcest asset, and the one it could never store.</p><p>Eddie Nasser describes the mechanics: “The interesting question is how you actually capture legal judgment. We compare early drafts against the final drafts that went out, identify the feedback that consistently changed them, and we even have Supreme Court litigators review briefs and articulate what they would change.</p><p>Over time, that becomes a set of skills and evals that lets a junior lawyer get something closer to expert-level feedback before a draft ever reaches a partner.”</p><h3>Conclusion</h3><p>The traditional firm’s partner leaves and takes the clients; the AI-native firm’s lawyer leaves and takes nothing, because the acquisition engine, the scoring models, and the accumulated judgment stay.</p><p>That accumulated judgment is also what rebuilds the pipeline, now that the production work that used to train juniors is gone. The firm that builds this gets a defensible asset and a training system out of the same infrastructure; the firm that does not will find it has no seniors left to lose.</p><p>Disclaimer: Quotes / individuals mentioned do not suggest endorsement with some or all ideas in this article, and reflect the personal, not company, opinions of those quoted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V57bjROBzNgXCfINJKBe7w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6d8917d7957" width="1" height="1" alt=""><hr><p><a href="https://medium.com/foremark-legal/architecture-for-the-outcome-based-ai-native-law-firm-c6d8917d7957">Architecture for the Outcome-Based, AI-Native Law Firm</a> was originally published in <a href="https://medium.com/foremark-legal">Foremark Legal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Forget Flat Billing — AI-Native firms will transform the Right to Contingency Fees]]></title>
            <link>https://medium.com/messy-problems-original-concepts/forget-flat-billing-ai-native-firms-will-transform-the-right-to-contingency-fees-67fa9c06b1a9?source=rss-6975d2c42b25------2</link>
            <guid isPermaLink="false">https://medium.com/p/67fa9c06b1a9</guid>
            <category><![CDATA[legaltech]]></category>
            <category><![CDATA[business-of-law]]></category>
            <category><![CDATA[ai-and-law]]></category>
            <category><![CDATA[law]]></category>
            <dc:creator><![CDATA[Chia Jeng Yang]]></dc:creator>
            <pubDate>Thu, 28 May 2026 16:30:56 GMT</pubDate>
            <atom:updated>2026-06-08T17:38:52.358Z</atom:updated>
            <content:encoded><![CDATA[<h3>Forget Flat Billing — AI-Native firms will transform the Right to Contingency Fees</h3><p>The legal system is inaccessible because legal help must be purchased before anyone knows whether a case will succeed. Rights exist on paper, but exercising them requires paying upfront for an outcome no one can guarantee.</p><p>Hourly billing forces ordinary people to absorb that uncertainty themselves. A client pays to investigate, to understand the options, to draft documents, to pursue enforcement, and plenty of valid claims are not worth pursuing once the math is done.</p><p>The next generation AI-native law firm is not a firm that uses AI. It is a firm whose economics only make sense because of AI. Contingency is the most natural expression of those economics. Contingency fees solved part of this problem by inverting who carries the risk. Lawyers took a percentage of recovery if they won and nothing if they lost, which became one of the most important access-to-justice innovations in modern legal history.</p><p>The reason contingency stayed confined to a narrow set of practice areas was generally economic. Understanding a legal problem used to require hundreds of hours on documents, damages, and procedural risk before anyone could decide if a case was viable, making contingency dangerous outside categories with very large expected recoveries.</p><p>AI breaks the constraint that kept contingency narrow. Systems can now summarize records, spot legal issues, compare claims against historical outcomes, estimate damages, and draft initial filings in minutes. The bottleneck was never appetite for risk but the cost of evaluating it, and that cost is collapsing.</p><p>The consequences of cheap evaluation extend well beyond personal injury. Wage theft alone costs American workers an estimated $50B+ a year, yet most incidents never produce a claim because damages are too small relative to legal cost. The same arithmetic kills landlord disputes, junk fees, denied benefits, and small-dollar fraud, so lowering intake and triage costs by an order of magnitude makes a huge population of real injuries viable for the first time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*pI_nAokWFtZyJQxJCmPulw.png" /></figure><p>Transactional work is starting to move toward contingency too. Formation, licensing, immigration, and contract negotiation have measurable outcomes that can anchor success-based fees once servicing costs fall. <a href="https://x.com/chiajy2000/status/2057565031412424760">Eli Albrecht, an M&amp;A lawyer, recently posted</a> that his firm took on the largest deal in its history “mostly on contingency” after vetting the sponsor. “We are bullish on our clients,” he wrote. Operationally flexible boutiques are running these deals now, and client expectations about negotiable fees shift with every one.</p><p>Lawyers already know how to design outcome-aligned structures; they have simply built them for the wrong clients. Bankruptcy practice runs on preference stacks, success fees, litigation trusts, and structured settlements, and corporate lawyers engineer outcome-aligned deals routinely for sophisticated parties. The creativity exists; it has just been pointed at clients who could already afford lawyers.</p><p>Portfolio-based law is what this combination of capabilities makes possible. A firm can run thousands of smaller matters as a diversified book instead of placing concentrated bets on a few expensive cases, with AI compressing variance, sharpening prediction, and letting firms model legal risk the way insurers and lenders model their own. Contingency stops looking like an exception and starts looking like infrastructure.</p><p>Two objections to broader contingency come up regularly, and neither holds. The first is that it will flood courts with frivolous claims, but contingency lawyers already eat the cost of weak cases. The second, that AI cannot replace legal judgment, is true but beside the point: the argument is not that lawyers disappear, but that the cost of understanding a legal problem falls far enough to change what is worth taking on.</p><p>Outcome-based pricing is the default almost everywhere else in the economy for knowledge workers: medicine, venture capital, recruiting, asset management, and sales all run on it. Legal services have stayed anchored to hourly billing even as the marginal cost of legal work has compressed, and the profession still frames contingency as a special exception when it may be the most rational model for a system in which understanding a legal problem is cheap. The right to a contingency fee, ultimately, is the right to transfer risk from the person least able to bear it to the institution best equipped to evaluate it.</p><p>The most interesting category in legal tech is therefore not software sold to law firms but the firm itself, rebuilt around contingency economics AI has made tractable. Personal injury is the natural wedge: contingency already works there, intake volume is enormous, and the gap between marketing spend and case quality is wide enough for an AI-native operator to compound advantages quickly. US TAM is roughly $800B in resolved claim value annually, most of it priced by firms whose intake runs on rules of thumb.</p><p>From that wedge, the same operating system extends into adjacent contingency-eligible verticals and eventually into non-litigation work transactional categories where outcomes can be priced and estimated by AI systems.</p><p>The firms that win this will look less like traditional law firms with AI bolted on and more like underwriters: closed-loop systems that source claims, score them, price risk, and feed every outcome back into the model that picks the next case. That is what the next generation AI-native law firms would look like.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67fa9c06b1a9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/messy-problems-original-concepts/forget-flat-billing-ai-native-firms-will-transform-the-right-to-contingency-fees-67fa9c06b1a9">Forget Flat Billing — AI-Native firms will transform the Right to Contingency Fees</a> was originally published in <a href="https://medium.com/messy-problems-original-concepts">Messy Problems</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The bottleneck in Legal AI: Asking the right questions with Question / Context Databases]]></title>
            <link>https://medium.com/messy-problems-original-concepts/the-bottleneck-in-legal-ai-asking-the-right-questions-with-question-context-databases-d10100a58123?source=rss-6975d2c42b25------2</link>
            <guid isPermaLink="false">https://medium.com/p/d10100a58123</guid>
            <category><![CDATA[legal-ai]]></category>
            <dc:creator><![CDATA[Chia Jeng Yang]]></dc:creator>
            <pubDate>Sun, 08 Feb 2026 22:09:39 GMT</pubDate>
            <atom:updated>2026-02-08T22:09:39.440Z</atom:updated>
            <content:encoded><![CDATA[<h3>The bottleneck in Legal AI: Asking the right questions with Question / Context databases</h3><p>The bottleneck in Legal AI is not generating better answers. It is identifying which questions need to be asked, when they should be asked, and whether they are being asked at all.</p><p>The law is unique as a field in that there is a categorical difference between getting a question wrong and failing to ask the question that would have revealed the correct framing in the first place.</p><p>The reason lawyers are famously always saying ‘it depends’ is because giving an answer to a question is straightforward, but finding out whether the client actually fits another scenario (outside what the client knows applies to them) is what lawyers are trained to do. Clients obviously do not know the right context to give for a particular legal question, so lawyers are trained to dig up the appropriate context on their behalf. Clients may easily walk away satisfied with a surface level answer, which may not be applicable to them at all.</p><p>At the highest level, we can break legal work into 3 categories — transactional, consultative, and creative.</p><p>Transactional: This includes finding standard information, drafting paperwork to fit known scenarios, and executing predefined processes. Regulatory filings, deal documentation, and immigration forms fall squarely into this bucket. This category is the most automatable, and Legal AI has made real progress here.</p><p>Consultative: This is where a lawyer’s value comes from asking questions that materially improve a client’s legal position. It is not about executing a known path, but about discovering a better one. For example, someone may approach a lawyer asking for help with an H-1B visa. A consultative lawyer might, through questioning, realize that the person is actually better suited for a different immigration pathway they were not aware of and never asked about. The value lies entirely in the question that reframed the problem.</p><p>Creative: This involves creative interpretations of the law, novel arguments, and untested strategies. It is the least structured and most judgment-intensive form of legal work. While AI can assist here, it is also the furthest from checklist automation.</p><p>Most AI developers implicitly assume that all legal work is transactional. They are optimized for answering questions, summarizing documents, or drafting text once the problem has already been defined. It fails when the real work is figuring out what the problem actually is.</p><p>This is why lawyers are paid what they are paid. They are not primarily compensated for recall, drafting speed, or access to information. They are paid to notice what is missing, to challenge assumptions, and to ask the right question at the right moment.</p><p>Today’s Legal AI is fundamentally reactive. It waits for a prompt, a document, or a task definition. Even the most advanced systems inherit the user’s framing. If the human does not know what to ask, the system does not either.</p><p>The real inflection point comes when systems become proactive in a very specific sense: not by listing generic unknowns or abstract gaps, but by using contextual clues to determine whether alternative scenarios should be considered and which questions must be asked to confirm or rule them out.</p><p>A meaningful system is one that could interrupt a workflow to say, in effect:</p><p>“This is the wrong question for this situation. Here is the question that actually matters.” OR</p><p>“Based on our previous conversation, if you are generally less concerned with downside risk, this other thing is what you should be more concerned with.”</p><p>That is a much harder problem than it sounds, because good questions are not just about missing information. They are about assessing the probability of relevance and leverage, and asking the minimum number of relevant questions at the right time. Consider an immigration example.</p><p>A junior lawyer might ask, “It appears you are interested in applying for a H1B visa. Please show me evidence of a non-immigration intent. These are some examples”.</p><p>A more experienced lawyer might instead ask, “You have an Australian accent. Did you know it’s easier to apply for Australians to apply for an EB1 visa?”</p><p>Both are questions, but only one meaningfully shapes strategy. The difference is not access to information, but judgment about what inquiry moves the case forward.</p><p>This is also why existing legal knowledge systems fall short. Internal matter search focuses on final work product: briefs, contracts, memos. It tells you what was answered, not what was asked. It does not capture the questions that changed direction, the questions that came too late, or the questions that were never asked but should have been. As a result, firms systematically lose their most valuable form of institutional knowledge.</p><h4>What progress looks like — the Question / Context Dataset</h4><p>A real solution here does not look like a better answer engine. It focuses on a different dataset entirely.</p><p>Meaningful progress would require capturing how questions are actually asked inside a law firm. That means scraping internal communication at scale: emails, chat threads, document comments, and notes. This is where legal judgment lives. Not in final briefs, but in the questions lawyers ask while a matter is unfolding. Internal historical matter search is insufficient because it ignores how judgment is formed in motion.</p><p>What matters is not just the question, but when it was asked and in what scenario. The same question asked at intake, during discovery, or on the eve of a deadline carries very different weight. Each question would need to be mapped to its context, including why it was asked at that moment. Not the answer it produced, but the reasoning that made the question relevant.</p><p>This produces a fundamentally different dataset. Instead of questions paired with golden answers, it is a dataset of questions paired with intent, timing, and scenario. It captures how lawyers decide what to ask, not what they ultimately conclude.</p><p>In the immigration example used earlier, it is incredibly tedious to hard-code every possible relevant factor that could potentially be relevant (i.e. accent, etc). As such, a more practical approach would be to categorize and train on the questions that get asked more frequently in practice, and the context that triggered it.</p><p>A system trained on this kind of data would not wait to be prompted with “what are relevant questions to ask?”. It would proactively surface questions based on the probability that a given question matters in the user’s current situation, inferred from contextual clues like matter type, stage, facts, and prior decisions. Its value comes from asking the right question unprompted, early enough to change outcomes.</p><p>Until Legal AI is trained on questions rather than answers, it will remain strongest where legal judgment matters least. The real opportunity is not to automate execution, but to encode the decision-making that determines which execution path is worth pursuing in the first place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lYX1Yizsm1Io4ZP0tsyC1A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d10100a58123" width="1" height="1" alt=""><hr><p><a href="https://medium.com/messy-problems-original-concepts/the-bottleneck-in-legal-ai-asking-the-right-questions-with-question-context-databases-d10100a58123">The bottleneck in Legal AI: Asking the right questions with Question / Context Databases</a> was originally published in <a href="https://medium.com/messy-problems-original-concepts">Messy Problems</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Embedded Legal: How Embedded Fintech principles will disrupt the business of Law]]></title>
            <link>https://medium.com/messy-problems-original-concepts/embedded-legal-how-embedded-fintech-principles-will-disrupt-the-business-of-law-a6327b2d96e9?source=rss-6975d2c42b25------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6327b2d96e9</guid>
            <category><![CDATA[embedded-legal]]></category>
            <category><![CDATA[embedded-fintech]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[legal]]></category>
            <dc:creator><![CDATA[Chia Jeng Yang]]></dc:creator>
            <pubDate>Sat, 24 Jan 2026 19:53:50 GMT</pubDate>
            <atom:updated>2026-01-24T19:53:50.977Z</atom:updated>
            <content:encoded><![CDATA[<h3>Embedded Legal and the Primacy of Distribution</h3><p>Legal services are beginning to follow a pattern that fintech went through a decade ago with <a href="https://medium.com/swlh/an-introduction-to-embedded-finance-a4d64302757d">Embedded Finance</a>. Once underlying legal services become standardized and repeatable, the primary differentiator stops being the service itself and becomes distribution.</p><p>This dynamic is well established in embedded finance. Banking, payments, and card issuance are now offered by companies that are not banks, but that already own the customer relationship. Ride-sharing platforms, payroll providers, and accounting software embed financial products at the moment they are needed, while regulated institutions remain responsible for the underlying financial activity.</p><p>This shift is already happening. Certain legal services are already product-like: incorporation, routine filings, standardized compliance reviews, and repeatable enforcement actions. Incorporation is the clearest existing example. Through <strong>Stripe Atlas</strong>, founders can form a company as part of setting up payments. The legal service is not discovered through a law firm search; it is initiated inside a payments workflow at the exact moment it becomes necessary.</p><p>Lexington Law is an example of a law firm that has built a credit reports software product as a way to generate leads for the underlying law firm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*krprtnaSykcrYCp_T1UDVQ.png" /></figure><p>Lexington Law firm is the counterparty to the consumer, and offers credit repair and credit monitoring solutions in a way that does not appear like a traditional law firm. This solo law firm apparently made approximately ~$300m in revenue in 2024, before undergoing bankruptcy due to unauthorized billing practices and robo-dialing.</p><p>Another example is the Rocket Lawyer and Covéa <a href="https://www.rocketlawyer.com/newsroom/rocket-lawyer-covea-deliver-legal-benefits-to-insurance-customers">partnership</a>.</p><p>Covéa is a large insurance group that offers consumer insurance products, and it used Rocket Lawyer as a way to embed “legal benefits” inside an insurance relationship, rather than forcing customers to separately shop for legal services. The model is described as Covéa integrating Rocket Lawyer’s digital legal documents, legal information, and related services into Covéa’s product suite so policyholders can access legal tools through a co-branded, integrated experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*ZxRNM2T5y1ZHMS8r4prokA.png" /><figcaption>Product flow can be found <a href="https://middleton.io/casestudies/case-study-rocketlawyer-covea.html">here</a></figcaption></figure><p>This is the same embedded distribution logic: the insurer owns the customer relationship and embeds legal help at the moment of need, while Rocket Lawyer supplies the legal platform and access to lawyers where appropriate.</p><p>Tax law offers another signal. Legal outcomes related to tax are increasingly delivered through accounting platforms and affiliated professional services structures. From the user’s perspective, legal services appear embedded within an accounting or finance workflow rather than accessed as a standalone legal engagement.</p><p>As software mediates more economic activity, these platforms are increasingly becoming the first point of contact for initiating legal services. In some cases, software acts purely as a distribution layer. In others, the software itself is the environment where the legal issue arises. In these articulated cases, users begin their legal journey inside software systems they already rely on.</p><h3>Concrete examples of embedded legal initiation</h3><ul><li><strong>Accounting software → letters of demand:<br></strong>When an invoice becomes delinquent, a business initiates a lawyer-issued letter of demand directly from its accounting platform. The software provides timing, documentation, and access; licensed lawyers draft and issue the demand.</li><li><strong>HR / payroll software → labor law counsel:<br></strong>An HR or payroll platform becomes the place where an employer engages labor counsel following events such as termination, reclassification, or expansion into new jurisdictions. The platform routes context; lawyers conduct audits, provide advice, and manage remediation.</li><li><strong>Vendor or procurement platforms → contract enforcement:<br></strong>A vendor-management system initiates legal escalation when contractual milestones are missed or performance thresholds are breached. The platform tracks obligations and evidence; legal interpretation and enforcement remain lawyer-driven.</li></ul><h3>Distinction from Aggregators</h3><p>This is different from the general trend of law services aggregators like Avvo or Rocket Lawyer, or their more modern version like Morgan &amp; Morgan, Atticus, LawHive, Off the Record, etc. Aggregators are analogous to the NerdWallet’s of the Fintech world.</p><p>While fundamentally an interesting business model innovation, their core thesis is distinct:</p><ul><li>Aggregate legal services / lawyers under a consumer-facing marketplace or backend marketplace</li><li>For a consumer-facing marketplace like Avvo, generate revenue through advertisements (similar to Amazon Ads) and a pay per lead model. Regulations typically do not allow non-lawyers to take on a fee split or % of the lawsuit or make specific recommendations of lawyers.</li><li>For a backend marketplace like Atticus or LawHive, you create a law firm that deals with the customer intake and then makes specific lawyer recommendations and introductions. This bypasses restrictions around fee splits, and attorney recommendations.</li></ul><p>While these aggregator models are good business models, they are fundamentally a continuation of the idea that services, and not software, are the first port of call for a customer.</p><p>Embedded legal is focused on the idea of a software flow-first approach that leads into legal services, as opposed to a legal service router. It is the difference between NerdWallet versus Shopify Capital. One aggregates customer demand, the other embeds financial services onto an initially unrelated core offering.</p><p>With AI, more custom user journeys through software can be designed to help attract customers with a problem, and triage between those who subsequently need to speak to a lawyer, and those who are satisfied with the self-help tools.</p><h3>The distribution gap in law firms</h3><p>Most law firms do not think in terms of scalable distribution, even as many of their underlying services become increasingly standardized. Firms remain optimized for bespoke delivery and reputation-driven sourcing. As legal services become more productized, this gap between how services are delivered and how demand is captured becomes increasingly visible.</p><p>The impact is likely to be huge, but why now?</p><p>If we think about the ratio between the number of fintechs that own the customer relationship and initial customer demand generation over their underlying banks, we can see the potential for embedded legal driven disruption to rise dramatically, especially with the ease of building tools to give initial context for the legal problem (i.e. credit monitoring tools as a segue into credit repair services), and the ability for LLMs to help with providing initial triaging and direction.</p><h3>Why embedded legal could fail — and where MSO / PLLC &amp; Alternative Business Structures helps</h3><p>There are a number of business structures that either already allow ways to construct businesses mentioned above (i.e. MSO / PLLC), and/or to additionally allow non-lawyers direct equity in such structures (i.e. Arizona ABS). This is beside the fact that a group of lawyers could have always executed such a structure. There is primarily an education gap in combining demand generation, technology, capital, and business structures together in a unified direction.</p><ul><li><strong>Referral and fee-sharing restrictions constrain the core examples:</strong></li></ul><p>In models like accounting platforms initiating demand letters, HR systems routing labor counsel, or procurement software triggering enforcement, law firms are often restricted from paying platforms for leads or sharing fees tied to individual matters. This directly limits how embedded distribution layers can monetize, even when they originate demand.</p><ul><li><strong>Platforms cannot freely price legal initiation:</strong></li></ul><p>Unlike other software marketplaces, legal platforms generally cannot charge per letter sent, per audit triggered, or per enforcement action initiated. This makes it difficult to align incentives between software platforms and law firms using conventional SaaS or usage-based pricing.</p><ul><li><strong>ABS structures can realign incentives at the entity level:</strong></li></ul><p>Where permitted, MSO/PLLC and Alternative Business Structures may allow software platforms and legal service providers to jointly own or participate in integrated service entities. This makes it possible to generate revenue at the business level rather than on a per-referral basis, reducing reliance on prohibited fee-splitting.</p><p>ABS enables subscription-based labor compliance offerings that bundle access to counsel into ongoing HR workflows. Lawyers retain responsibility for advice and remediation, while platforms support continuous monitoring and engagement, allowing recurring revenue without per-event referrals.</p><h3>Closing</h3><p>Embedded legal is not about replacing lawyers or turning legal advice into software. It is about recognizing that software platforms are increasingly where legal journeys begin, even when lawyers remain responsible for the legal work itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YwttCYz9rc_KFT9zEh4hMw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6327b2d96e9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/messy-problems-original-concepts/embedded-legal-how-embedded-fintech-principles-will-disrupt-the-business-of-law-a6327b2d96e9">Embedded Legal: How Embedded Fintech principles will disrupt the business of Law</a> was originally published in <a href="https://medium.com/messy-problems-original-concepts">Messy Problems</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The AI-enabled 100x Lawyer.]]></title>
            <link>https://chiajy.medium.com/the-ai-enabled-100x-lawyer-a001c835ff3e?source=rss-6975d2c42b25------2</link>
            <guid isPermaLink="false">https://medium.com/p/a001c835ff3e</guid>
            <category><![CDATA[law]]></category>
            <category><![CDATA[legaltech]]></category>
            <category><![CDATA[law-firm]]></category>
            <dc:creator><![CDATA[Chia Jeng Yang]]></dc:creator>
            <pubDate>Mon, 05 May 2025 18:12:14 GMT</pubDate>
            <atom:updated>2025-05-05T18:12:14.261Z</atom:updated>
            <content:encoded><![CDATA[<p>Lawyers are commandos. Lawyers are artisans. Software is about standardizing the common denominator. This doesn’t make sense when lawyers are about how you handle edge cases.</p><p>AI can now be used to map out how lawyers handle edge cases. But I am uninterested in finding out the most common denominator workflow for handling edge cases. Instead, I want to use AI like a Spartan’s armor. I find the best high-performance lawyers who want to use technology, build<strong> custom, individualized software</strong> for individual lawyers that reflects the way they specifically think and work. I don’t care (and almost prefer) if they have a more unique way of doing things, and have the performance to show for it.</p><p>Selling SaaS to law firms is painful. Law firms are basically a collection of independent contractors, each individual with their own way of doing things. Let’s lean into this! Do not sell technology to 1,000 people and increase their efficiency by 30%. Instead, sell technology to 1 person, increase their efficiency by 10,000%, and capture a clip of their efficiency gain. One exception is any software or process that directly leads to revenue gains, and not cost-savings. You can imagine the best case scenario is custom revenue-generation technology.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/0*e1Y225jjwORSW60U" /></figure><p>Simply put — the way experts look to automate themselves is different from how software companies are traditionally built, especially before AI. To be clear, a law firm is going to need both general and specialized software. Just like generalized software is going to be helpful for a lot of general work, a specialized software tool is specifically going to be helpful for extending work that not many others are doing — which basically describes a lot of a lawyers job.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*isYzTQ3CD6LhJNVD" /></figure><p>How does this make sense economically?</p><ul><li><strong>Cost and Flexibility of Development</strong>: AI has drastically lowered the barrier of code generation and natural language processing. Software that took millions to build before can be built in hours and for thousands of dollars.</li><li><strong>Lawyer Adoption</strong>: This is the hardest bit because you need to completely understand one lawyer’s idiosyncratic workflow in extreme detail, and they need to be both patient enough and willing to share. However, in this model, one does not need to convince 10,000 lawyers that automation makes sense. One just needs to convince 1 high-performing lawyer per business sector / specific valuable workflow that this is the future. This business model can take 9,999 no’s.</li></ul><h4><strong>Is there a precedent for this?</strong></h4><p>Yes! This is how some quant funds are run. My cofounder, Tom, who briefly worked at Optiver, shares some of his experience in the industry:</p><p><strong>Small Cross-Functional “Pod” Teams</strong>: Many quant funds use small, cross-functional teams (often called pods) that include a portfolio manager/trader plus quantitative researchers, data scientists, and software engineers​</p><p>For example, Citadel embeds engineers directly into trading teams, allowing technologists to build and iterate on solutions side by side with portfolio managers​. This real-time partnership means a researcher can devise a model, an engineer can code it, and a trader can deploy it quickly, all in sync</p><p>Quant funds heavily customize technology for each trading strategy or team. Over 50% of employees at a firm like Two Sigma are engineers, building internal systems and tools to solve “problems unique to financial services”​. Rather than one-size-fits-all software, these firms develop proprietary analytics platforms, data pipelines, and execution algorithms that fit the needs of specific traders or strategies.</p><p>Quantitative developers often tailor the software to their portfolio manager’s trading style, providing bespoke analytics, risk models, and automation</p><p>Imagine if quant funds were run as a partnership of individual traders that had a barely functioning centralized software procurement function. That’s basically the current state of law firms.</p><p>What would be reasons this could work for quant funds but not for lawyers? The main reason is that each trader can make tens to hundreds of millions of dollars, while a lawyer might only be able to bill say up to 5m. This also doesn’t apply to specific areas of non-contingency legal practices like plaintiff litigation where individual lawyers can make 9 figure incomes. Furthermore, this is the old model of a lawyer without leverage. With technology, and the ability to refer cases to other lawyers, it is possible to imagine a 100x lawyer.</p><h3>A New Playbook for AI-First Law Firms</h3><p>Most importantly, this approach <strong>breaks the false trade-off between quality and scale</strong>. In the current system, the best lawyers are expensive, limited in capacity, and reliant on inefficient firm structures. In this new model, they are empowered with AI and automation, allowing them to maintain elite quality while expanding their reach at an unprecedented scale.</p><p>This is where the legal industry is headed — whether existing firms recognize it or not. Just as finance was transformed by quant trading and manufacturing was reshaped by automation, law will be redefined by AI-augmented professionals who leverage technology not as a tool, but as a fundamental extension of their expertise.</p><p>The first AI-native legal platform will not be built by selling software to firms. It will be built by <strong>identifying and equipping the best individual lawyers</strong> with an infrastructure that turns them into <strong>100x lawyers</strong>.</p><p>This is the future of law firms.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a001c835ff3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Emerging Product considerations for LLM Systems: Reasoning Architectures]]></title>
            <link>https://chiajy.medium.com/emerging-product-considerations-for-llm-systems-reasoning-architectures-66604ee9773a?source=rss-6975d2c42b25------2</link>
            <guid isPermaLink="false">https://medium.com/p/66604ee9773a</guid>
            <category><![CDATA[reasoning-architecture]]></category>
            <category><![CDATA[legaltech]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Chia Jeng Yang]]></dc:creator>
            <pubDate>Thu, 20 Mar 2025 21:19:38 GMT</pubDate>
            <atom:updated>2025-05-20T22:09:39.174Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Emerging product considerations for LLM systems: Reasoning Architectures</strong></h3><p>LLMs and AI systems are reshaping the way we think about product development. As LLMs introduce a level of reasoning into previously workflow-only systems, we see a rise of “Reasoning Architecture” that lies on top of traditional underlying “Technical Architecture.</p><h3>What Has Changed?</h3><h4>The Reasoning Architecture</h4><p>Unlike traditional product design, AI-driven systems must explicitly manage a new conceptual layer: the Reasoning Architecture. This layer captures expert judgment, domain-specific logic, and nuanced decision-making criteria, especially critical in subjective scenarios and edge cases where ambiguity reigns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*khxK2K9ymBQ_rM7S" /></figure><p>Reasoning Architecture is distinctly different from Technical Architecture, which remains responsible for data storage, retrieval systems (like vector databases), infrastructure, APIs, and overall system performance. While engineers maintain the Technical Architecture, domain experts — often non-technical — directly shape the Reasoning Architecture. This is because we now have an element in AI systems that directly looks at and reasons across natural language. These LLM systems are design to mimic how humans and experts in specific workflows think and automate the way the system thinks about unstructured information.</p><p>The Reasoning Planning infrastructure is essentially advanced Chain of Thought reasoning that reflects the ability for specific human experts to, in a no-code way, easily load and edit their reasoning about information in different situations.</p><h4>An example of Reasoning Architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vej8oa4AQolPB08P" /><figcaption>At WhyHow.AI, we use internal tools like these to map expert reasoning flows and enhance LLM retrieval accuracy.</figcaption></figure><p>Reasoning architecture is essentially the mapping of how the system reasons through specific information and comes to specific types of conclusions, categorizations, or decisions based on the information at hand. It essentially acts almost like a checklist or an SOP of how to think about specific information.</p><p>This answers questions and assessments like ‘What should I spot and consider in the information given?’ or ‘I should give this category a score unless there is this other fact.’</p><p>This is different from technical questions like ‘Where is the information going to come from?’ or ‘How is this information stored?’</p><p>Reasoning Planning is different from Technical Planning as the former is focused on how to think about and categorize information versus taking actions and steps (i.e. to retrieve information, to access a website, to send an email, etc).</p><h4><strong>An example of Technical Architecture</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XCmwMeYrXOgc_jmY" /><figcaption>An example of a Technical Architecture flowchart of ACTIONS that are taken within an automated workflow</figcaption></figure><p>You can see major differences in the Technical and Reasoning Architecture simply by looking at the type of nodes being represented in these graphs. Technical Architecture focuses a lot on performing actions (Doing things) versus Reasoning Architecture focuses on evaluating information (Reasoning through things).</p><p>All types of technical processes include some assumption of a Reasoning Process, but there are certain workflows, especially for highly technical white-collar knowledge-intensive fields (law, healthcare, manufacturing) where there are specific steps which are pure information reasoning, without any new external data or action being taken throughout the entire reasoning process (i.e. no Technical Workflow).</p><p>We believe reasoning architectures and reasoning maps will become more popular as people begin to focus on encoding more complex context and custom expert workflows into systems. As AI is increasingly used to map out custom workflows that are highly specialized, we believe platforms specifically designed for mapping expert reasoning processes will become increasingly useful. Most tools out there are more focused on workflows because that is the vast majority of what is a known process to developers (i.e. retrieve customer information, retrieve name and search LinkedIn for their CV, extract title &amp; interests).</p><h4>The Role of Domain Experts</h4><p>To effectively manage Reasoning Architecture, new user interfaces and workflows are required. Domain experts need specialized UX tools allowing them to audit, adjust, and refine the logic and decisions made by LLMs. This approach transforms previously implicit judgments by experts (“you know it when you see it”) into clearly documented and operational guidelines, improving transparency and accountability.</p><p>There are a few ways to ensure your AI system is reasoning the way you want it to — Fine-tuning a model with reasoning capabilities or a Multi-Agent System with Chained Prompts.</p><p>In many scenarios, where you want auditability of systems, frequent changes to the reasoning flow, and most importantly, some level of deterministic reasoning that is not a black box model, without having to use millions of training examples, a Multi-Agent System is what people prefer to turn to.</p><h4><strong>Understanding Product Development</strong></h4><p>The emergence of a distinct Reasoning Architecture shifts our understanding of product development. At their core, successful products continue to revolve around clear user outcomes. Engineers still need to prioritize a deep understanding of what Users want and their pain points. Users still prioritize the ease and intuitiveness of the final product rather than understanding the complex processes running behind the scenes. Continuous iteration and user feedback loops remain essential to refining and improving products, ensuring they meet evolving user needs. Product development is obviously still centered on ideas of engineering efficient technical solutions, and delivering intuitive and seamless user experiences.</p><p>However, product development teams must explicitly manage and operationalize nuanced human judgment and expert reasoning as core elements of the product itself. How the LLM thinks about information is now as important as to how the system gets information. This requires teams to be conscious of how the LLM is navigating and reasoning through information where domain experts are no longer passive advisors but active collaborators who shape product logic directly.</p><p>Further, the explicit separation of reasoning and technical architectures elevates the importance of explainability, transparency, and accountability. Products must now clearly document and justify the logic behind their decisions, changing how teams approach both product design and iteration. Instead of purely technical feedback loops, there are parallel processes:</p><ul><li>Engineers optimizing performance</li><li>Experts refining logical decision-making</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hT4Ty78KF4sMlvcZ" /></figure><p>Such audit-ability of reasoning steps may also go beyond essential Reasoning Development work, but also for legal explainability purposes.</p><h3>Why This Distinction Matters for Product Developers &amp; Managers:</h3><p><strong>Clearer Explainability &amp; Accountability</strong></p><ul><li>Simplifies understanding and communicating how AI-driven decisions are made, essential for compliance and user trust.</li></ul><p><strong>Efficient Auditing Workflows:</strong></p><ul><li>Enables faster tracing and validation of the reasoning logic, speeding up troubleshooting and reducing downtime.</li></ul><p><strong>New Expert-Centric Workflow:</strong></p><ul><li>Requires adopting specialized interfaces and iterative workflows that actively involve domain experts in continuously defining, refining, and auditing reasoning logic separately from technical iterations.</li></ul><p>A point I find interesting is that just like how traditional product managers would have a deep understanding of the workflows of their users, to the point that they can act as consultants on best practice workflows, AI product managers are likely going to have to essentially upskill on the reasoning of their users, to the point that they can act as consultants on the specific reasoning employed by their users. From this perspective, you can see how you are likely going to have more lawyers as legal-tech AI PMs, or accountants as accounting-tech AI PMs, etc.</p><h3>The Future of Product Teams</h3><p>This shift necessitates evolving roles within product teams. Domain experts become integral participants, actively shaping product logic alongside engineers and product designers. Ultimately, clearly distinguishing Reasoning Architecture from Technical Architecture ensures AI-driven products remain transparent, accountable, and reliably aligned with human expertise and ethical standards.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66604ee9773a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Lawyers Are Uniquely Suited to Work with LLMs]]></title>
            <link>https://chiajy.medium.com/why-lawyers-are-uniquely-suited-to-work-with-llms-bcc66d3dce98?source=rss-6975d2c42b25------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcc66d3dce98</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[legaltech]]></category>
            <category><![CDATA[lawyers]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Chia Jeng Yang]]></dc:creator>
            <pubDate>Tue, 04 Mar 2025 22:42:40 GMT</pubDate>
            <atom:updated>2025-05-20T22:10:04.412Z</atom:updated>
            <content:encoded><![CDATA[<h4>What This Article Covers:</h4><ul><li><strong>Why</strong> lawyers have a unique advantage when working with LLMs</li><li><strong>How</strong> LLM information retrieval works — and how to spot failures</li><li><strong>Practical examples </strong>(including a “Mock LSAT”) to debug LLM outputs</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/0*7F2qd_PIFMsnkV3P" /></figure><p>This article discusses how, despite the fact that lawyers are not engineers, a legally trained mind — when equipped with basic technical knowledge of Large Language Models (LLMs) — can uniquely contribute to their deployment and coordination. Many LLM failures stem from the way AI systems handle language. While impressive, LLMs do not think like humans.</p><p>Law is one of the few professions built on structuring reasoning and maintaining consistency through language. Lawyers, with the right technical foundation can collaborate with engineers to create expert reasoning and retrieval workflows — charting processes for how LLMs should reason about specific types of legal information.</p><p>AI offers lawyers the potential to create a programmatic version of themselves — one that retains their expertise but never tires or retires. By understanding LLM search processes like Retrieval Augmented Generation (RAG), lawyers can pinpoint why an LLM fails to retrieve relevant answers and use their semantic expertise to refine its output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FhkAZwDY5NOhpoaV" /><figcaption>At WhyHow.AI, we use internal tools like these to map expert reasoning flows and enhance LLM retrieval accuracy.</figcaption></figure><p>Most LLM systems use <strong>Retrieval-Augmented Generation (RAG)</strong> to pull in external information beyond their training data. This includes searching documents, websites, and other sources before generating an answer.</p><p>I think of LLMs like an intern. They can follow instructions literally, lack intuitive reasoning, and struggle to connect implicit concepts. They also have a tendency to forget information between interactions.Besides all of these, like an intern with a particular quirk in the way they think, LLMs rely on a single method — semantic similarity — to interpret questions and retrieve relevant information. Knowing this, this approach can be reverse engineered to identify failures.</p><p>For example, when searching a 300-page contract for “consequential damages,” a lawyer knows:</p><ul><li>Searching for “damages” via Ctrl+F won’t work since the term may appear as “indirect losses.”</li><li>Context matters — if “consequential damages” appears in definitions, it expands the scope of relevant terms.</li><li>Certain standard documents (e.g., side letters in partnership agreements) must be checked, even if not explicitly referenced.</li></ul><p>Similarly, LLMs struggle when retrieving conceptually related but substantively material terms. If asked, <em>“What liabilities does the contract impose?”</em>, an LLM may overlook relevant sections if “consequential damages” and “indirect losses” are regarded as non-semantically similar. Lawyers, trained to be sensitive to conceptual equivalencies, can help address these gaps.</p><p>Let us go in depth into how LLMs retrieve and answer questions in a RAG system so we can start looking at more complex scenarios (and more likely scenarios you may have come across).</p><p>The basics of RAG that a lawyer would need to know: Chunking, Semantic Similarity, Chunk Filtering</p><p>Retrieval Augmented Generation (RAG) operates in three critical stages:</p><ul><li><strong>Chunking</strong>: Take a document, break it into pieces called chunks, and turn each chunk into numbers</li><li><strong>Semantic Similarity</strong>: Take a question, turn it into numbers and see which document chunks are semantically similar to each question mathematically. In semantic similarity, words like “dog” and “animal” are mathematically close because they share meaning, whereas unrelated terms like “horseshoe” and “quantum mechanics” are distant.</li><li><strong>Chunk Filtering/ Top-K</strong>: Take the top few document chunks (scored by semantic similarity), give them to an LLM, and let the LLM construct the answer from that subset of document chunks, given the question.</li></ul><p>That’s it — that’s essentially all a simple RAG system does. If I have learnt anything between building developer infrastructure and going through law school, it is that developers, like lawyers, use highly technical terms that belie relatively simple concepts to help enhance job security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i5m75eZdSHW6qJtB" /></figure><p>In the below image, you can see what a chunk looks like, and you can program the size of the chunks to use. The larger the chunks, the more the information. The smaller the chunks, the smaller the information. Only a certain amount of words can fit into the LLMs context window when they construct the answer. Therefore, the larger the chunks, the less chunks you can fit into the LLM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xNQ9byKu9U6RKyoK" /></figure><p><strong><em>Variable: Chunk size</em></strong><em><br>Large chunks: Better for extracting generalized meaning and insight<br>Small chunks: Better for extracting specific facts, figures, or statistics</em></p><p>The only other thing to know is something called the Top-K filter. This is just a fancy way of saying ‘What is the top number of document chunks we will decide to select to give to the LLM to construct its answer’.</p><p>Top-K filtering determines how many document chunks an LLM uses to generate an answer. For example, if Top-K = 3, the system selects the three most relevant chunks. A higher Top-K captures more information but risks hallucinations, while a lower Top-K ensures focused answers but may miss key details.</p><p>One obvious limitation is imagining that you have a question which requires information that is spread across 10 document chunks (i.e. tell me the top 10 clauses that are related to this issue) and the top-k is set to 5, meaning only the top 5 document chunks are retrieved.</p><p><strong><em>Variable: Top-k</em></strong><em><br>Higher values: More complete responses that incorporate large amounts of information<br>Lower values: More focused, consistent answers</em></p><p>For example, consider the query: <em>“What is the recommended dosage of acetaminophen for an adult?”</em></p><ul><li>Document 1 contains the chunk: “Take 500 mg every 4–6 hours.”</li><li>Document 2 contains the chunk: “Do not exceed 3000 mg per day.”</li></ul><p>If the system retrieves only <strong>one chunk</strong>, the answer may be misleading. Even worse, if neither chunk explicitly mentions “acetaminophen,” they might not be retrieved at all.</p><p>One <a href="https://medium.com/@glorat/context-aware-chunking-for-enhanced-retrieval-augmented-generation-oct23-9dcd435d9cf1">common trick</a> is to ask the LLM to add metadata summaries to each chunk — a summary of the document itself (i.e. imagining that the 2 documents are “Dosage instructions for Acetaminophen” and “FDA warnings about Acetaminophen” and a similar summary is appended to each chunk). We can then imagine that the combination of each sentence with its document summary gives us a level of confidence that the chunks would be more semantically similar and be appropriately picked up.</p><h3>The LSATs of Debugging LLMs</h3><p>Let’s apply this to real-world examples. Debugging LLM retrieval is like taking the LSAT — spotting how subtle wording affects meaning and determining where retrieval goes wrong.</p><h4>Example A: Travel Itinerary Query</h4><ul><li>Query: “What are the optimal itineraries for experiencing authentic, under-the-radar cultural venues in Paris beyond the standard landmarks?”</li></ul><p>Underlying Sentences in the Knowledge Base:</p><ul><li><em>Sentence A:</em> “The Musée Jacquemart-André offers a rich collection of fine arts in a historic mansion setting.”</li><li><em>Sentence B:</em> “The Eiffel Tower and Louvre Museum remain the best attractions in Paris for experiencing authentic cultural venues in Paris.”</li><li><em>Sentence C:</em> “The Canal Saint-Martin area provides a vibrant, off-the-beaten-path experience with indie boutiques and local eateries.”</li><li><em>Sentence D:</em> “For those seeking indie cultural experiences, venues like the Maison de la Photographie and the Passage des Panoramas offer unique insights into Parisian art and history.”</li></ul><p>Intended Answer &amp; Limitations of Semantic Similarity: <br>The intended relevant sentences are sentences A, C &amp; D. However, despite the query’s focus on non-mainstream venues, the retrieval system might overweight Sentence B because of the mentions of ‘Paris’ and ‘authentic cultural venues’. In semantic similarity, the weight of ‘under-the-radar’ may not overcome the weight of the other variables mentioned, even though it is obvious to a human that that variable is the most important.</p><p>Potential Solutioning:<br>For queries involving travel recommendations, a knowledge graph can be established that tags locations with specific attributes — such as “under the radar,” “popular,” “nature,” or “cultural.” These attributes function as values by which conceptual similarities can be measured for the purposes of RAG retrieval.</p><p>Alongside this, an LLM dedicated to classifying the attributes can classify the question to determine the traveler’s desired experience (e.g., searching for nature-oriented venues versus cultural venues). This LLM double-checks the answer against the predefined categories, ensuring that the final output aligns with the traveler’s questions and excludes popular attractions and emphasizes under-the-radar experiences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ATl0trwSsKNOspZt" /><figcaption>A type of Knowledge Graph used by Airbnb</figcaption></figure><p>Similarly, another LLM can double-check the final answer and the original question to highlight any inconsistencies, and re-rank the chunks used.</p><h4><strong>Example B: Enterprise Device Management Query</strong></h4><ul><li>Query: “What are the best practices for remotely deploying security patches on company-owned smartphones to ensure strict regulatory compliance, minimal service disruption, and robust data integrity?”</li></ul><p>Underlying Sentences in the Knowledge Base:</p><ul><li><em>Sentence A:</em> “Enterprise-grade MDM solutions enable scheduled, phased rollouts of security patches, which helps minimize service disruption while maintaining oversight.”</li><li><em>Sentence B:</em> “Always make sure that your Device is receiving automatic, over-the-air updates to keep up to date with the latest in security” {This sentence was taken from a pamphlet titled ‘Consumer Device Best Practices’ where the title was many sentences away from Sentence B}</li><li><em>Sentence C:</em> “For corporate environments, it is essential to implement real-time monitoring and post-deployment audits as part of the remote patch deployment process to ensure data integrity and adherence to regulatory standards.”</li><li><em>Sentence D:</em> “Manual update procedures can sometimes be favored by organizations concerned with the stability of automated systems, but these often lead to inconsistent patch levels and increased downtime.”</li></ul><p>Intended Answer &amp; Limitations of Chunks:<br>The intended relevant sentences are sentences A, C, &amp; D. However, although the query is clearly enterprise-focused, a RAG system might mistakenly emphasize Sentence B because it looks only at the close semantic similarity to the ‘security’ related terms. This misprioritization could cause the system to blend in consumer-level automatic update methods — even though those are considered best practice for consumers — which do not meet the strict compliance and data integrity requirements of an enterprise scenario. Consequently, the final answer might inappropriately mention automatic updates, thereby diluting the enterprise-specific best practices.</p><p>Potential Solution:<br>Where the underlying document structure can give additional critical context, a document structure knowledge graph can help to tie information about each text chunks with the overall document structure and context.</p><p>An example of what a document structure looks like in practice is where we combined a <a href="https://medium.com/enterprise-rag/legal-document-rag-multi-graph-multi-agent-recursive-retrieval-through-legal-clauses-c90e073e0052">knowledge graph document structure of a legal contract</a> with a multi-agent system that specifically tracks references to other clauses (or even footnotes), and is able to use the document structure to refer to other clauses, the chunks that belong to it, and bring it to the LLM accordingly.</p><h4><strong>Conclusion</strong></h4><p>Effective LLM debugging isn’t about coding — it’s about understanding language precision and retrieval logic. Lawyers, with their expertise in structuring arguments and analyzing ambiguity, can play a pivotal role in refining AI reasoning and improving retrieval accuracy.</p><p>Arguably, auditable system architectures that help to inject context and reflect specific reasoning steps are essentially in shaping technology adoption in critical industries like law.</p><p>With the right foundational knowledge, lawyers don’t need to be engineers to contribute meaningfully to AI development. Their ability to map, critique, and structure information makes them valuable partners in the future of AI-driven legal work.</p><p>Thanks to Kyle, Jose, Connor, Kenneth, Tomas, Azfer, Matthew, Amol, Timothy, Marcel for comments and feedback. Comments do not imply endorsement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u5KTi2HTYa6BvniP" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VKWXLkjoJ19z1apEuRBgiA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcc66d3dce98" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Operator and Computer Use Will Disrupt Legacy ERP Moats]]></title>
            <link>https://chiajy.medium.com/how-operator-and-computer-use-will-disrupt-legacy-erp-moats-f25824c7952b?source=rss-6975d2c42b25------2</link>
            <guid isPermaLink="false">https://medium.com/p/f25824c7952b</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[erp-software]]></category>
            <category><![CDATA[erp]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[computer-use]]></category>
            <dc:creator><![CDATA[Chia Jeng Yang]]></dc:creator>
            <pubDate>Sun, 26 Jan 2025 16:26:07 GMT</pubDate>
            <atom:updated>2026-08-20T14:48:34.722Z</atom:updated>
            <content:encoded><![CDATA[<p>By: Chia Jeng Yang &amp; <a href="https://www.linkedin.com/in/amolshah06/">Amol Shah</a> (OpenAI)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QAGMKYKYe1KLpBuA" /></figure><p>This week’s launch of Operator by OpenAI, following the release of a similar tool called Computer Use from Anthropic, marks the beginnings of a shift in how legacy ERP moats are maintained, potentially signaling the end of traditional strategies like restrictive API/data access and selective integrations as a means to create a durable competitive advantage in software.</p><p>In OpenAI’s Operator release, the demo showcased mainly consumer use cases (shopping via Instacart, reserving a restaurant via OpenTable, or booking a trip on Booking). One critical reaction has been that a lot of what is possible with the Operator tool in the browser, could be made simpler with using APIs that provide the same experience in a more reliable way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*POXinjdqQG5F7hrq" /></figure><p>However, the consumer-facing nature of the demo (Instacart has a highly navigable consumer-facing website, plus it makes its APIs <a href="https://docs.instacart.com/connect/api/">freely available</a>) under-emphasizes the larger enterprise opportunity around pulling data and automating data extraction and transformation from more complex systems, which the Operator tool ultimately will enable. In fact, many observers expect these consumer-facing use cases are useful to gain initial adoption and help the technology mature, for enterprise use-cases where extraction is more complex or APIs do not exist, which can be noted from the progression of <a href="https://openai.com/index/computer-using-agent/">early benchmark data </a>along the spectrum of UX complexity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*EZ6g3UBStXvI9PVl" /></figure><h4>Operator-like Tools for Interfacing with Legacy System of Records</h4><p>Legacy ERP systems have served as a system of record and a critical backbone for businesses, integrating various processes and centralizing data. Think Salesforce for CRM, Workday for HR, NetSuite for Accounting. However they often lack modern APIs or standardized integration capabilities, making it difficult for their own customers or emerging solution providers seeking to build on top of or extend the functionalities of these systems. The net effect of these “data walls” created by ERP providers essentially entrenches their position within enterprises.</p><p>Many of these systems are still operational due to the high costs of migration and the critical functions they perform. However, Operator-like tools make it possible to unlock data trapped within these systems. Important capabilities include:</p><ul><li><strong>Simulating User Interactions</strong>: Operator-like tools simulate human interactions with ERP interfaces, automating tasks such as navigating menus, exporting reports, and retrieving specific data. These systems can be programmed in natural language and operate far faster and more consistently than manual processes, significantly enhancing efficiency.</li><li><strong>Scaling Legacy System Interactions</strong>: Automation allows businesses to perform high-volume data extraction from legacy systems, scaling operations that were once constrained by human effort. For instance, Operator-like tools in LLMs can extract thousands of transaction records overnight, a task that would take days for human operators, increasing friction for adopting and proving third party vendors.</li><li><strong>Breaking Exclusivity Barriers</strong>: By enabling access to legacy ERP data without requiring proprietary API access, enterprises reliant on traditional ERP systems can increase the value and useability of their own data. This challenges the lock-in and pricing power of their vendors, and lets businesses adopt the latest in AI technology without being locked in by slow and traditional vendors.</li></ul><p>Consider an organization using a decades-old ERP to manage payroll that does not provide APIs for easy data export. Instead of relying on costly integrations or manual data exports, Operator-like tools could simulate user actions to export payroll records. These records are then automatically formatted and used for modern LLM systems that require the data for context, bridging the gap between old and new technologies. It does not matter whether your ERP system has built APIs for one component of software to pull data for another program, because Operator-like tools can pull that data as a person would.</p><p>Another example of this use-case that is perhaps more relatable is LinkedIn data exporting. This process requires a number of steps including going into your LinkedIn account, pressing a few export buttons, waiting for an email, clicking on a link in the email inbox and downloading a ZIP file to your desktop. With Operator-like tools, all of these steps could be automated or running in the background on behalf of a networking tool a user wants to give their data to, creating new use cases across both business and personal domains.</p><p>The implications of these developments are that it may become harder for legacy companies to preserve a data moat if they are purely a system of record, and must deliver value-enhancing services on top of the data they hold.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FiWtuSStiztXyTD8" /></figure><h3>Investment / Building Opportunities</h3><h4><strong>Eroding System of Record Moats &amp; New Openings for AI-Native Software Solutions</strong></h4><p>One of the great debates for the evolution of software in the age of AI is whether legacy SaaS players have an advantage vs newer AI-native software companies. Legacy players have two main advantages: distribution (ie: an established user base, and relationships with stakeholders at a company) and data moats, as mentioned before.</p><p>The elimination of data moats as a default advantage that incumbent ERP players possess over newer entrants has significant implications:</p><ol><li><strong>Differentiation at the point of the user:</strong> Being the system of record no longer creates an automatic advantage for software. Expect increasingly that end user preferences — based on the ability of software to automate user workflows, or offering greater flexibility of features, will increase in importance</li><li><strong>Easier trial of new software providers: </strong>While still needing to overcome a distribution disadvantage (ie: no pre-existing relationship with a company), with lower switching costs it will be easier for companies to experiment with new software solutions outside of the traditional “stack” they were limited to before</li><li><strong>Downward pressure on ERP margins: </strong>Price increases aren’t automatic by default, and ability to switch providers is real</li></ol><p>This has implications for investors evaluating the startup landscape, and nascent AI-native players who are helping companies automate workflows, opening up the design space for solution providers and creating new opportunities to bypass legacy ERP providers.</p><h4><strong>‘Cloudflare/ Captcha for Operator-like tools for traditional ERPs’</strong></h4><p>We may see a very messy range of solutions pop up by enterprises to combat Operator-like tools in their ERP systems. The notion of Cloudflare for ERP SaaS may emerge. Just as bots were typically targeted against websites, Operator-like tools may be regarded as similarly undesirable botting actions against computer-based ERP systems, and we may see upcoming companies specialize in developing new techniques against Operator-like tools, to help ERP providers preserve their data moat for as long as possible.</p><h4><strong>Metadata generation and not data records as the new moats</strong></h4><p>In a traditional ERP system, data that is easily exportable can include things like customer contact details, sales pipelines, and other information that a human user would typically observe in the UI. Metadata could include things like ‘How much time a customer has spent in the Prospecting stage’. Metadata, and metadata generation, may be the more important data moat that ERP players would need to double down and focus on. Many ERP providers (and there are quite a few in niche industries who do nothing additional to the data they store) have not had good systems for metadata generation and this may change. Such ERP providers who are not providing additional metadata value addition may also represent good opportunities to disrupt.</p><p>Custom export automation and computer-driven interaction with legacy ERP systems are reshaping how businesses can access and use their data. By mimicking human workflows to overcome traditional API limitations, companies can unlock the full potential and flexibility of their system of records. As tools like Operator and Computer Use continue to improve, API moats for legacy systems of records may continue to erode.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f25824c7952b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Legal Document RAG: Multi-Graph Multi-Agent Recursive Retrieval through Legal Clauses]]></title>
            <link>https://chiajy.medium.com/legal-document-rag-multi-graph-multi-agent-recursive-retrieval-through-legal-clauses-c90e073e0052?source=rss-6975d2c42b25------2</link>
            <guid isPermaLink="false">https://medium.com/p/c90e073e0052</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[graphrag]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[knolwedge-graph]]></category>
            <dc:creator><![CDATA[Chia Jeng Yang]]></dc:creator>
            <pubDate>Sat, 07 Sep 2024 17:37:07 GMT</pubDate>
            <atom:updated>2026-08-20T14:40:20.100Z</atom:updated>
            <content:encoded><![CDATA[<p>Authored by: Timothy Chung, Chia Jeng Yang</p><p>In this article and open source repository, we wanted to demonstrate intelligent navigation of a legal document’s clauses done through a multi-agent system that leverages a lexical graph (document hierarchy) and chunk linking within a multi-graph multi-agent workflow for a regulatory document. The stack we used here was <a href="http://reducto.ai/">Reducto.AI</a>, <a href="https://langchain-ai.github.io/">Langgraph</a>, <a href="https://www.llamaindex.ai/">LlamaIndex</a>. You can find access to the open source repository <a href="https://github.com/whyhow-ai/recursive-retrieval"><strong>here</strong></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jZtN0NMc5TvzTdgO" /></figure><p>Some of the very specific problems that we have come across in documents, particularly legal documents, was the need to build a <a href="https://medium.com/enterprise-rag/deterministic-document-structure-based-retrieval-472682f9629a">document hierarchy</a> of the different clauses within the document. This is as clauses sometimes referred to other clauses to get the full meaning and context.</p><p>In order to gain the full context, you then had to <a href="https://medium.com/enterprise-rag/advanced-rag-and-the-3-types-of-recursive-retrieval-cdd0fa52e1ba?source=stats_homepage-------------------------------------">recursively navigate</a> and retrieve any mentioned clauses (and even footnotes!), navigate the document hierarchy graph to find the mentioned clause, see if any other clauses were mentioned, and to repeat. <a href="https://medium.com/enterprise-rag/advanced-rag-and-the-3-types-of-recursive-retrieval-cdd0fa52e1ba?source=stats_homepage-------------------------------------">Recursive retrieval</a> can be done on a range of other document elements outside legal documents including page numbers, multimodal data like images, hyperlinks to other documents or external data, etc.</p><p>Legal documents have always fascinated me when it comes to graph-based traversal and retrieval, given the structured nature of the documents. There is also a very specific structured retrieval step that must also always take place in the context of a legal document in the guise of the definitions page, where every specific important term has a very specific variable or fixed definition that can change depending on the nature of the document.</p><p>In this Notebook and example, we want to show how you can easily create a document hierarchy graph of the clauses within a legal document, a graph of the definitions in the legal document, and a multi-graph multi-agent recursive retrieval process that answers questions by intelligently navigating through both the document hierarchy graph and the definition graph to gain the full context for questions posed against it.</p><p>In this example, we take a simple regulatory document issued by the Malaysian Central Bank, specifically <a href="https://www.bnm.gov.my/documents/20124/938039/pd_compliance_Oct2015+%28Reissuance_May2016%29.pdf/6da52ca8-734a-d2fb-e214-093430ea8fb6?t=1592219195301"><strong>this document</strong></a> governing compliance rules in a variety of organizations.</p><p>The question we want to get an answer to is the question:- <strong>How can the Board and the CCO manage control functions?</strong></p><p>The ideal flow to answer this question would be:</p><ul><li>Gives me a definition of CCO from definition page</li><li>Retrieval of information from Clause 6.3 &amp; Clause 7.2.</li><li>Detection of “Refer to Para 7.3 and 7.4” in Clause 7.2.</li><li>Traverses to and retrieves Para 7.3 and 7.4</li><li>Detection of the mention of Para 9.1 and the retrieval of Para 9.1</li></ul><p>As a quick benchmark, when we run this through ChatGPT using GPT4o (which has embedded agentic reasoning), we get the following answer:</p><pre>The management of control functions by the Board and the Chief Compliance <br>Officer (CCO) involves several key responsibilities as outlined in the <br>compliance document:<br><br><strong>Responsibilities of the Board:</strong><br>1. Oversight of Compliance Risk Management: The Board is responsible for <br>overseeing the management of compliance risk within the financial institution. This includes approving the compliance policy, establishing the compliance function, and appointing the CCO.<br>2. Approval and Support for the Compliance Function: The Board must <br>ensure that the compliance function and the CCO have the appropriate standing, <br>authority, and independence to carry out their duties effectively. The Board <br>must also ensure that the compliance function is adequately resourced.<br>3.Engagement with the CCO: The Board should engage with the CCO regularly to <br>discuss issues faced by the compliance function and ensure the CCO has direct <br>access to the Board.<br>4. Annual Evaluation: The Board must evaluate the effectiveness of the <br>institution’s management of compliance risk at least annually, considering <br>assessments from senior management, internal audit, and the CCO.<br><br><strong>Responsibilities of the Chief Compliance Officer (CCO):</strong><br>1. Coordination and Management of Compliance Risk: The CCO is responsible for <br>coordinating the identification, management, and monitoring of compliance risk<br>across the institution. This includes ensuring compliance monitoring and <br>testing are consistent across the organization.<br>2. Reporting and Advising: The CCO must report regularly to senior management <br>on the findings and analysis of compliance risks and must ensure that reports <br>are readily available to internal audit and regulatory authorities. The CCO <br>also advises the Board and senior management on legal and regulatory <br>requirements, keeping them informed of developments and their implications.<br>3. Independence: The CCO must maintain independence from business lines to <br>effectively carry out the role of a control function. This includes ensuring <br>that there is no conflict of interest in their responsibilities, reporting <br>lines, or remuneration.<br>4. Resources and Training: The CCO must ensure that the compliance function <br>is sufficiently resourced with officers who have the necessary qualifications <br>and experience. The CCO is also responsible for ensuring that adequate training<br> is provided to officers on relevant legal and regulatory requirements.<br><br><strong>Interaction with Other Control Functions:</strong><br>The compliance function should be organized in a way that allows effective <br>management of compliance risk, considering the size, nature, and complexity of<br>the financial institution’s operations. Where responsibilities are shared <br>between a dedicated compliance unit and other control functions,<br>clear documentation and coordination are required to ensure that the CCO can <br>perform their duties effectively without impairing independence or focus.<br>By fulfilling these responsibilities, the Board and the CCO can ensure that <br>the institution&#39;s compliance risks are managed effectively, supporting the <br>overall safety and soundness of the financial institution.</pre><p>This answer is interesting but incomplete because it:</p><ul><li>Seems to specifically pick up on the keyword ‘compliance’ and highlights all the compliance obligations that are relevant to other clauses as opposed to specifically the board and the CCO. For example, coordination across jurisdictions (Para 8.2) was raised in the context of ‘compliance’, and remuneration independence (Para 7.8) was raised in the context of ‘compliance’.</li><li>Crucially, it seems to have missed the explicit references to Para 7.3, and 7.4 that explicitly state a key obligation between the Board and the CCO around Board approvals being required when the CCO shares control functions. It has also missed Para 9.1 about the separation between audit and compliance functions.</li></ul><p>This is understandable given that recursive retrieval of clauses, pages and footers are not explicitly part of the typical semantic similarity retrieval processes that govern RAG.</p><h3><strong>Summary of Multi-Graph Multi-Agent Workflow Developed</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I-ULV2KUEgZNI5ZuT9ApOg.png" /><figcaption>For those looking to understand what each agent does, we include code snippets for each agent in the Appendix</figcaption></figure><h4><strong>Creation of the Graphs</strong></h4><p>Within this Notebook, we first extract the document structure parsed by <a href="https://reducto.ai/">Reducto’s</a> document ingestion engine. The document structure breaks down every page into different elements, such as a Section Header, a List Item, or a Footer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rqge8YhCpZdAi7PV" /></figure><p>The elements are then combined based on the order they appear and their implied hierarchies, for example, a Section Header is a parent of a List Item. We then analyze the links in the document to identify connections between extracted elements that can be modeled in the lexical graph.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BcjSoFxrgE_RcBAT" /><figcaption><a href="https://whyhowai.netlify.app/public/graph/66d7eebbeda622fc957cc7a0">Link to Document Hierarchy/Lexical Graph</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oU24xJokx2eozjy8_COAig.png" /></figure><p>We then import the chunks and triples into the Knowledge Graph Studio using our SDK <a href="https://whyhow-ai.github.io/whyhow-sdk-docs/examples/create_graph_from_triples/">here</a> to create the Lexical Graph.</p><p>We also built a graph of the legal definitions for the document. Uniquely in legal documents, there is a definitions section for each document that helps to define the specific way certain terms must be interpreted. This can differ by document, use-case and client. In this case, the document contained definitions on pages 4–5. These texts were extracted and passed into GPT-4o with a prompt to extract the legal terms and their definitions verbatim and return them as structured output. The output was turned into a CSV file and uploaded as a separate graph using the SDK and a predefined schema. This Definition Graph is invoked by the Definition Agent when needed to augment the context with the specific relevant definitions. In this case, the Definition Agent is invoked after the initial clauses are retrieved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LEQpckUFmmnOG8SA" /><figcaption><a href="https://whyhowai.netlify.app/public/graph/66d7edbaeda622fc957cc73f">Link to Definition Graph</a></figcaption></figure><p>We then imported the nodes from Studio into the notebook, and used LlamaIndex to locally index the information of the nodes, preserving the embeddings generated with Studio. We use a combination of LlamaIndex’s Vector, BM25, and Keyword retrievers. The addition of the BM25 and keyword retrievers are helpful in a legal document use case where the query and retrieval process requires precision with terminology. BM25 helps to identify key terms in highly repetitive text, while the keyword retriever ensures that important terms, despite occurring infrequently, are retrieved as needed.</p><p>LangGraph was used to build a multi-agent workflow around the lexical graph with the Studio SDK and GPT-4o.Essentially, when a query is passed, the system first searches for the relevant vector chunks through the Initial Search Agent. In this case, the vector chunks are clauses or sub-clauses. The Definition Agent is subsequently called here to augment the clauses with the relevant definitions. The Router Agent then detects if there are additional linked sections or footers that it needs to refer to, and if so, to retrieve the appropriate sections and considers them. The Recursive Retrieval Agent will recursively do so if the subsequent retrieved clauses (as is the case here), refers to even more clauses.</p><p>The first clauses it retrieves are Paragraphs 6.3 and 7.2. The Definitions Graph is referenced to check if there is any additional context via the definitions section that should be included. The additional definitions for “CCO” and “Senior Management” are included.</p><p>Within Paragraph 6.3, there is the following sub-paragraph 6.3.f:</p><ul><li><strong>“where the CCO also carries out responsibilities in respect of other control functions3, be satisfied that a sound overall control environment will not be compromised by the combination of responsibilities performed by the CCO.”</strong></li></ul><p>Based on the information of the first clause it retrieves, a Router Agent then helps to detect if there are clauses or footers mentioned in the material. In this case, a Footer (Footnote 3) was associated with the first clause. The Router Agent then triggers the Footer Parsing Agent. The Footer Parsing agent identifies the relevant footer and returns the following Footer:</p><ul><li><strong>“Refer to paragraphs 7.3 and 7.4.”</strong></li></ul><p>Here, another traversal is required, and the Recursive Retrieval Agent is used to traverse the Lexical Graph and retrieve the chunks/clauses within Paragraphs 7.3 and 7.4.</p><p>This new information from Paragraphs 7.3 and 7.4 is combined together. Paragraph 7.4(b) contains a reference to Paragraph 9.1. here:</p><ul><li><strong>“compliance function responsibilities cannot be shared with, nor can the CCO assume responsibilities for, internal audit as such practices would render the independent review process described in paragraph 9.1 ineffective.”</strong></li></ul><p>Paragraph 7.4 contains a link to Paragraph 9.1, which the Router Agent detects, and instructs the Recursive Retrieval Agent to retrieve it on the next pass. An Answering Agent tracks all the incoming information to summarize and ultimately formulate the final answer to return to the user.</p><p>The final answer constructed reflects our ideal flow and takes in information from the Definitions page, Paragraph 6.3 &amp; 7.2, Footer Note 3, Paragraph 7.3, 7.4, 9.1 and is accurately summarized for the user with all the relevant information taken in with smart traversals.</p><p>To ensure we did not just get lucky, we ran the final query 3 times, which showed a successful retrieval of the relevant information.</p><pre>To manage control functions effectively, the Board and the Chief Compliance <br>Officer (CCO) have distinct responsibilities that they must exercise:<br><br><strong>Responsibilities of the Board:</strong><br>- Approve critical decisions regarding the CCO, including appointment, <br>remuneration, and termination (<strong>Section 6.3(a)</strong>).<br>- Ensure the CCO has sufficient stature to engage effectively with senior <br>management (<strong>Section 6.3(b)</strong>).<br>- Regularly engage with the CCO to discuss compliance issues and consider <br>interactions without senior management present (<strong>Section 6.3(c)</strong>).<br>- Provide the CCO with unimpeded access to communicate with the board directly<br>(<strong>Section 6.3(d)</strong>).<br>- Support the CCO with adequate resources to perform duties effectively, <br>including competent staff (<strong>Section 6.3(e)</strong>).<br>- Satisfy themselves that combined responsibilities, if any, do not compromise<br>the control environment (<strong>Section 6.3(f)</strong>).<br><br><strong>Responsibilities of the CCO:</strong><br>- Coordinate the identification and management of institution-wide compliance <br>risks (<strong>Section 7.2(b)</strong>).<br>- Ensure consistent conduct of compliance monitoring and testing across the <br>organization (<strong>Section 7.2(b)</strong>).<br>- Maintain independence and sufficient focus on compliance duties, even when <br>tasked with additional control functions (<strong>Section 7.3</strong>).<br><br><strong>Shared Responsibilities &amp; Coordination:</strong><br>- The board must approve any sharing of compliance function responsibilities <br>between the compliance unit and other control functions (<strong>Section 7.4(a)</strong>).<br>- Function responsibilities, including timely communication of issues, should <br>be well-defined and documented (<strong>Section 7.2(a)</strong>).<br>- Effective arrangements for coordination among control functions should be in<br>place to facilitate the CCO’s responsibilities (<strong>Section 7.2(d)</strong>).<br>- Compliance responsibilities must not compromise the separation of the <br>internal audit function (<strong>Section 9.1</strong>).<br><br>The board should ensure comprehensive oversight, and the CCO should maintain<br>effective coordination and communication across the organization to manage<br>control functions efficiently.</pre><p>In conclusion through this exercise, we have developed a system that demonstrates the following:</p><ul><li>A multi-graph system, with each graph representing a different process and objective within a RAG system.</li><li>Creating RAG-capable automated lexical graphs with Reducto &amp; LlamaIndex</li><li>A multi-agent system that allowed for smart traversals of documents based on the way the document intends for a human to read and traverse its information, returning answers from each section and sub-section in a structured way</li><li>A multi-graph multi-agent system that is governed with LangGraph.</li></ul><h4><strong>Appendix</strong></h4><p><strong>Agent code snippets</strong></p><p><strong>Definition Agent</strong></p><ul><li>Retrieves the definitions of terms mentioned in the query.</li></ul><pre><br><br>    definitions_response = client.graphs.query_unstructured(<br>        graph_id=definitions_graph.graph_id,<br>        query=query_prompt,<br>    )<br>    <br>    response_text = definitions_response.answer<br>    term_def_pairs = response_text.split(&#39;\n&#39;)<br>    definitions_dict = {}<br>    <br>    for pair in term_def_pairs:<br>        if &#39;:&#39; in pair:<br>            term, definition = pair.split(&#39;:&#39;, 1)<br>            definitions_dict[term.strip()] = definition.strip()<br>    <br>    return definitions_dict<br><br>query_prompt = &quot;&quot;&quot;Return me definitions for the terms in this query: &quot;How can the Board and the CCO manage control functions?&quot; Ensure the term-definition pairs are separated by newlines, properly capitalised&quot;&quot;&quot;<br><br>definitions_dict = definitions_search(query_prompt)<br><br><br>def print_prompt_definitions_dict(definitions_dict):<br>    prompt = &quot;Relevant Definitions:\n&quot;<br>    for term, definition in definitions_dict.items():<br>        prompt += f&quot;{term}: {definition}\n&quot;<br>    return prompt<br><br>print(print_prompt_definitions_dict(definitions_dict))</pre><p><strong>Router Agent</strong></p><ul><li>Decides if the process should stop or continue. Also identifies relevant nodes containing footer information or links to other nodes to be retrieved by the Recursive Retrieval Agent.</li></ul><pre>def router_agent(state: AgentState) -&gt; AgentState:<br>    # decide if process should should stop or continue<br><br>    starter_prompt_footer = f&quot;&quot;&quot;<br>        You are an intelligent agent overseeing a multi-agent retrieval process of graph nodes from a document. These nodes are to answer the query: <br>        ```{state[&#39;query&#39;]}```<br>        <br>        Below this request is a list of nodes that were automatically retrieved. <br>        <br>        You must determine if the list of nodes is enough to answer the query. If there isn&#39;t enough information, you must identify any relevant footer information in the nodes.<br>        <br>        A node can footer information asking to look in another section/part of the document, which will require a separate natural language search. <br>        Example: If the footer says &quot;see paragraph x&quot;, a search query e.g. &quot;Return paragraph x to answer the query &#39;{state[&#39;query&#39;]}&#39;&quot; should be made. <br>    <br>        If there are no further nodes worth analyzing, return an empty response. ONLY RETURN QUERIES FOR FOOTERS THAT ARE RELEVANT TO ANSWERING THE QUERY<br>        <br>        Else, if any relevant nodes require a footer search, specify the node_id and the search query.<br>        Nodes are identified by node_id and must be quoted in backticks.     <br>    &quot;&quot;&quot;<br>    <br>    starter_prompt_link = f&quot;&quot;&quot;<br>        You are an intelligent agent overseeing a multi-agent retrieval process of graph nodes from a document. These nodes are to answer the query: <br>        ```{state[&#39;query&#39;]}```<br>        <br>        Below this request is a list of nodes that were automatically retrieved. <br>        <br>        You must determine if the list of nodes is enough to answer the query. If there isn&#39;t enough information, you must identify any linked nodes that could be worth exploring.<br>        <br>        If there are no further nodes worth analyzing, return an empty response.<br>        <br>        Return a list of node_ids. ONLY RETURN NODE_IDS for NODES THAT ARE RELEVANT TO ANSWERING THE QUERY. Nodes are identified by node_id and must be quoted in backticks.<br>    &quot;&quot;&quot;<br>    <br>    # collect latest nodes, and all nodes<br>    last_fetched_nodes_flattened: Dict[str, MultiAgentSearchLocalNode] = {}<br>    all_nodes_flattened: Dict[str, MultiAgentSearchLocalNode] = {}</pre><p><strong>Supervisor Agent</strong></p><ul><li>Monitors the context window and prunes nodes if too much context is being used.</li><li>Also keeps track of search failures, if no nodes or relevant information was found for footer searches or linked nodes. If there are too many repeated search failures, it will end the retrieval process prematurely.</li></ul><pre>def supervisor_agent(state:AgentState) -&gt; AgentState:<br>    <br>    # Look for search failures. This might be an instance where multiple searches were made for certain parts of the document, but no relevant information was found.<br>    # This means that the search has to be ended prematurely to prevent infinite loops.<br>    printout = &quot;&quot;<br>    for node in state[&quot;previous_nodes&quot;]:<br>        printout += node.print_node_prompt()<br>    for node in state[&quot;last_fetched_context_nodes&quot;]:<br>        printout += node.print_node_prompt()<br>        <br>    prompt = f&quot;&quot;&quot;<br>You are a supervisor agent overseeing the multi-agent retrieval process of graph nodes from a document. The nodes are to answer the query:<br>```{state[&#39;query&#39;]}```<br><br><br>Below is a list of nodes that were automatically retrieved, followed by a list of errors. If there are many similar, repeated errors in the retrieval process , where no further linked or relevant nodes could be retrieved, return END to end the process. Else return CONTINUE. <br>Return only a single word, either END or CONTINUE.<br>&quot;&quot;&quot;<br>    <br>    completion = openai_client.beta.chat.completions.parse(<br>        model=&quot;gpt-4o-2024-08-06&quot;,<br>        messages=[<br>            {&quot;role&quot;: &quot;system&quot;, &quot;content&quot;: prompt},<br>            {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: printout},<br>            {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: state[&#39;search_failures&#39;]},<br>        ],<br>    )</pre><p><strong>Recursive Agent</strong></p><ul><li>Retrieves information for nodes marked by the Router Agent</li><li>Either fetches new linked nodes, or does a keyword search on the document for the footer (e.g. if the Footer asks to refer to paragraph 7.3 and 7.4 without a link, a search is done instead). An LLM call will prune redundant nodes at this step</li></ul><pre>def recursive_retrieval(state: AgentState) -&gt; AgentState:<br><br>    current_nodes = state[&quot;last_fetched_context_nodes&quot;]<br>    <br>    for current_node in current_nodes:<br>        state[&quot;previous_nodes&quot;].append(current_node)<br><br>    new_current_nodes = []<br><br>    # look up the nodes to fetch by id    <br>    <br>    for node_id in state[&quot;node_links_to_fetch&quot;]:<br>    # sometimes GPT returns node ids with or without backticks<br>        if node_id[0] == &quot;`&quot;:<br>            node_id = node_id[1:-1]<br>        if node_id in local_nodes_map:<br>            new_current_nodes.append(local_nodes_map[node_id])<br>        else:<br>            state[&quot;search_failures&quot;].append(f&quot;Failed to fetch node with id: {node_id}&quot;)<br><br><br>    for node_id, search_query in state[&quot;node_footers_to_fetch&quot;].items():<br>        # fetch nodes by keyword and bm25 search<br>        footer_retrieved_nodes = retrieve_with_keywords_bm25(search_query)<br>        # LLM prunes nodes that are not relevant<br>        footer_retrieved_nodes, _ = prune_nodes(search_query, footer_retrieved_nodes)<br><br>        for node in footer_retrieved_nodes:<br>            new_current_nodes.append(node)<br><br>        # if no nodes fetched, log failure<br>        if len(footer_retrieved_nodes) == 0:<br>            state[&quot;search_failures&quot;].append(<br>                f&quot;Failed to fetch nodes for query: {search_query}&quot;<br>            )<br><br>    state[&quot;last_fetched_context_nodes&quot;] = new_current_nodes<br>    state[&quot;pass_count&quot;] += 1<br>    state[&quot;node_footers_to_fetch&quot;] = {}<br>    state[&quot;node_links_to_fetch&quot;] = []<br><br>    return state</pre><p><strong>Answering Agent</strong></p><ul><li>Given all the information collected in the retrieval process, and the definitions from the document, it finalizes the answer to the query</li><li>It also tries to link to sources e.g. paragraph numbers wherever possible</li></ul><pre>def answering_agent(state: AgentState) -&gt; AgentState:<br>    # answer the query<br>    prompt = f&quot;&quot;&quot;<br>You are an answering agent. You will be given a list of document nodes that were automatically retrieved by the system. These nodes are to answer the query:<br>```{state[&#39;query&#39;]}```<br><br>Give references to sections/paragraphs if possible, but do not output full node ids with backticks and the hash. <br>&quot;&quot;&quot;</pre><p><strong>Variations of the Answers retrieved through the Multi-Graph Multi-Agent system</strong></p><p>Answer #2:</p><pre>To manage control functions effectively, both the Board and the Chief <br>Compliance Officer (CCO) must collaborate and establish a structured <br>framework. Key measures include:<br><br><strong>Board’s Responsibilities:</strong><br>- The Board must approve the appointment, remuneration, and termination of the<br>CCO, ensuring they have the necessary stature to engage effectively with<br>senior management <strong>(S 6.3(a), (b))</strong>.<br>- The Board should engage regularly with the CCO to discuss compliance issues<br>and ensure the CCO has direct access to the Board <strong>(S 6.3(c), (d))</strong>.<br>- The Board must also assure that the CCO is granted adequate resources and<br>support, including competent officers, to fulfill their duties <strong>(S 6.3(e))</strong>.<br><br><strong>CCO’s Role and Independence:</strong><br>- The CCO should oversee the institution-wide compliance risk management and <br>ensure that responsibilities are clearly documented and communicated in the <br>compliance policy <strong>(S 7.2(a), (b))</strong>.<br>- If the CCO is involved in other control functions, they must ensure their <br>independence and ability to focus on compliance responsibilities remain <br>uncompromised <strong>(S 7.3)</strong>.<br><br><strong>Coordination with Other Functions:</strong><br>- Proper coordination between the CCO and other control functions is essential.<br>This includes robust information flows and mechanisms for seeking compliance<br>advice <strong>(S 7.2(d))</strong>.<br>- The Board must approve the sharing of compliance responsibilities to ensure<br>there is no dilution of focus or effectiveness <strong>(S 7.4(a))</strong>.<br><br><strong>Separation from Internal Audit:</strong><br>- Compliance functions should remain distinct from the internal audit to <br>maintain the efficacy of independent reviews <strong>(S 7.4(b), S 9.1)</strong>.<br><br><strong>Training and Capacity Building:</strong><br>- The compliance function is responsible for training and providing guidance<br>to other officers on legal and regulatory requirements to manage compliance <br>risk effectively <strong>(S 8.11)</strong>.<br><br>By implementing these steps, the Board and the CCO can effectively manage<br>control functions, maintaining robust compliance and governance frameworks.</pre><p>Answer #3:</p><pre>The management of control functions by the Board and the Chief Compliance <br>Officer (CCO) involves several key responsibilities and structures:<br><br><strong>Role of the Board in Managing CCO Functions:</strong><br>- The board must approve the appointment, remuneration, and termination of the<br>CCO <strong>(Section 6.3(a))</strong>.<br>- The board should ensure that the CCO has sufficient stature to interact <br>effectively with the CEO and senior management <strong>(Section 6.3(b))</strong>.<br>- Regular engagement between the board and the CCO is important to discuss <br>compliance issues directly <strong>(Section 6.3(c))</strong>.<br>- The CCO must have direct, unimpeded access to the board <strong>(Section 6.3(d))</strong>.<br>- There must be adequate resources and support for the CCO to perform his<br>duties effectively <strong>(Section 6.3(e))</strong>.<br><br><strong>Shared Responsibilities and Independence:</strong><br>- Where compliance functions are shared, the board must approve this <br>arrangement, and responsibilities should be clearly defined and documented<br>in the compliance policy <strong>(Section 7.2)</strong>.<br>- The CCO should not assume responsibilities for internal audit, as this can<br>compromise independent review processes <strong>(Sections 7.4, 9.1)</strong>.<br>- The CCO must ensure that their independence and ability to focus on<br>compliance are not impaired by additional responsibilities <strong>(Section 7.3)</strong>.<br><br><strong>Responsibilities Within the Organization:</strong><br>- Compliance is the responsibility of all officers within the institution. <br>Business lines manage compliance risk through their managerial controls, <br>while the compliance function ensures that these controls are adequate <br><strong>(Section 1.2)</strong>.<br>- The internal audit function provides independent assurance on the quality <br>and effectiveness of the institution’s controls, including those concerning<br>compliance <strong>(Section 1.2(c))</strong>.<br><br><strong>Coordination Across Control Functions:</strong><br>- Arrangements for coordination among control functions and the CCO must <br>promote a consistent approach to managing compliance risk, with adequate <br>information flows and avenues for advice <strong>(Section 7.2(d))</strong>.<br><br>By following these guidelines, the Board and the CCO can manage the<br>compliance control functions effectively, ensuring that compliance risks<br>are appropriately identified, managed, and mitigated across the organization.</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c90e073e0052" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>