<?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 Jayavarshankuppusamy on Medium]]></title>
        <description><![CDATA[Stories by Jayavarshankuppusamy on Medium]]></description>
        <link>https://medium.com/@jayavarshankuppusamy?source=rss-a5fe8ba6633f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*vM2_fTPODKIbB4C_</url>
            <title>Stories by Jayavarshankuppusamy on Medium</title>
            <link>https://medium.com/@jayavarshankuppusamy?source=rss-a5fe8ba6633f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 11:31:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jayavarshankuppusamy/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[Your AI Agent Shouldn’t Do Math — Here’s What Should]]></title>
            <link>https://medium.com/@jayavarshankuppusamy/your-ai-agent-shouldnt-do-math-here-s-what-should-a889a29376c8?source=rss-a5fe8ba6633f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a889a29376c8</guid>
            <category><![CDATA[ai-design]]></category>
            <category><![CDATA[ai-workflow-automation]]></category>
            <category><![CDATA[deterministic-ai]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Jayavarshankuppusamy]]></dc:creator>
            <pubDate>Thu, 10 Sep 2026 07:32:34 GMT</pubDate>
            <atom:updated>2026-09-10T07:32:34.840Z</atom:updated>
            <content:encoded><![CDATA[<p>A few months into building an AI agent system for financial operations, I watched an LLM confidently calculate a working-capital number that was off by a factor of ten. It wasn’t hallucinating in the way people usually mean — it wasn’t inventing a fake citation or a fictional person. It was doing arithmetic, plainly and confidently, wrong. And it explained its reasoning fluently the entire way there.</p><p>That moment reframed how I thought about agentic AI in finance. The problem wasn’t that the model needed a better prompt, or a bigger context window, or a newer checkpoint. The problem was architectural: I was asking a language model to <em>compute</em> something, when its actual job should have been to <em>decide what to compute</em> and hand the arithmetic to something that can’t be wrong.</p><h3>The industry’s default answer is backwards</h3><p>Most of the current conversation around agentic AI reliability treats it as a prompting problem or a model-capability problem. Better chain-of-thought. Better tool use. Bigger models. Retry logic and self-correction loops. All of this treats the LLM as the thing that should ultimately produce the number — with guardrails bolted on around it to catch it when it’s wrong.</p><p>I think this is solving the problem at the wrong layer.</p><p>A large language model is a phenomenal reasoning and orchestration engine. It is not, and was never designed to be, a calculator. Asking it to compute a discounted cash flow, a working-capital delta, or a risk-adjusted allocation and then hoping your evaluation framework catches the errors after the fact is building reliability backwards — detection instead of prevention.</p><h3>What I built instead</h3><p>Over the past year I designed and shipped FinOps OS, a platform that orchestrates ten autonomous AI agents across accounts payable, receivable, reconciliation, treasury, and FP&amp;A workflows. Every one of those agents uses an LLM — for understanding intent, routing decisions, drafting communications, interpreting unstructured documents. None of them use an LLM to produce a financial figure.</p><p>Every number in the system — every reconciliation delta, every forecast, every optimization output — comes from a deterministic calculation layer that the LLM calls as a tool, the same way it might call a search API. The agent decides <em>what</em> to compute and <em>when</em>; a separate, testable, versioned piece of code does the actual computing. If the calculation layer is wrong, it’s wrong the same way every time, in a way you can unit test, not in a way that changes depending on phrasing or temperature.</p><p>This sounds obvious once stated. In practice, it’s a real architectural discipline that’s easy to erode under deadline pressure, because it’s <em>so much faster</em> to let the model just answer the question directly.</p><p>Here’s the actual tool boundary for a working-capital calculation. The agent can call calculate_working_capital — but all it gets back is a request for currency and period_days; every dollar figure is pulled from real ledger data and run through a separate WorkingCapitalService, never estimated by the model:</p><p>python</p><pre>class CalculateWorkingCapitalTool(AgentTool):<br>    name = &quot;calculate_working_capital&quot;<br>    description = (<br>        &quot;Deterministically compute DSO, DPO, and a (inventory-excluded) cash &quot;<br>        &quot;conversion cycle for a currency over a trailing period, from real &quot;<br>        &quot;open AP/AR balances and period activity.&quot;<br>    )<br>    input_schema = {<br>        &quot;type&quot;: &quot;object&quot;,<br>        &quot;properties&quot;: {&quot;currency&quot;: {&quot;type&quot;: &quot;string&quot;}, &quot;period_days&quot;: {&quot;type&quot;: &quot;integer&quot;}},<br>        &quot;required&quot;: [&quot;currency&quot;, &quot;period_days&quot;],<br>    }</pre><pre>    def __init__(self, finance: FinanceService, ar: ARService, calculator: WorkingCapitalService):<br>        self.finance = finance<br>        self.ar = ar<br>        self.calculator = calculator          # deterministic — no LLM involved</pre><pre>    async def _execute(self, *, args: dict, tenant_id: str) -&gt; dict:<br>        currency = args[&quot;currency&quot;]<br>        period_days = int(args[&quot;period_days&quot;])<br>        cutoff = date.today() - timedelta(days=period_days)</pre><pre>        invoices = await self.finance.list_invoices(tenant_id=tenant_id)<br>        ap_balance = sum(<br>            Decimal(str(i.total_amount)) for i in invoices<br>            if i.currency == currency and i.status not in _AP_STATUSES_EXCLUDED<br>        )<br>        purchases = sum(<br>            Decimal(str(i.total_amount)) for i in invoices<br>            if i.currency == currency and i.invoice_date &gt;= cutoff<br>        )</pre><pre>        receivables = await self.ar.list_receivables(tenant_id=tenant_id)<br>        ar_balance = sum(<br>            Decimal(str(r.total_amount)) - Decimal(str(r.paid_amount)) for r in receivables<br>            if r.currency == currency and r.status not in _AR_STATUSES_EXCLUDED<br>        )<br>        credit_sales = sum(<br>            Decimal(str(r.total_amount)) for r in receivables<br>            if r.currency == currency and r.invoice_date &gt;= cutoff<br>        )</pre><pre>        return self.calculator.calculate(<br>            period_days=period_days,<br>            accounts_receivable_balance=ar_balance, period_credit_sales=credit_sales,<br>            accounts_payable_balance=ap_balance, period_purchases=purchases,<br>        )</pre><p>The model never sees a balance and reasons its way to DSO or DPO. It asks for a currency and a window; WorkingCapitalService.calculate — plain arithmetic, fully unit-tested, zero tokens involved — does the rest.</p><h3>Independent verification, not just separation</h3><p>Separating computation from reasoning solves half the problem. The other half is verification: how do you know the deterministic layer itself is being invoked correctly, with the right inputs, and that its output is being used the way it should be downstream?</p><p>In FinOps OS, every agent-invoked calculation passes through an independent verification step before it’s allowed to affect a downstream decision or appear in a report. This isn’t the LLM checking its own work — it’s a separate control, blind to the reasoning that produced the request, checking the output against expected bounds and business rules. The system is validated by over 860 automated tests, most of which exist specifically to catch the case where an agent asks the right question but the calculation pipeline produces a result that doesn’t hold up.</p><p>One example: before an invoice workflow can proceed, a control independently re-derives the ground truth the agent’s own analysis relied on — vendor status, duplicate detection, PO match — using the same deterministic services, but never trusting the agent’s own retrieval of them:</p><p>python</p><pre>class InvoiceGroundTruthControlEvaluator(ControlEvaluator):<br>    &quot;&quot;&quot;Independently re-derives one piece of AP ground truth — vendor<br>    active status, duplicate assessment, or PO/goods-receipt match —<br>    directly from `invoice_id`. This is a genuinely independent check,<br>    not a shortcut around one: it never reads anything the AP Agent&#39;s<br>    own tool calls produced — a control must never trust the agent&#39;s<br>    own retrieval.&quot;&quot;&quot;</pre><pre>    control_type = &quot;invoice_ground_truth_check&quot;</pre><pre>    async def evaluate(self, context: dict, definition: ControlDefinition, *, tenant_id: str) -&gt; ControlEvalResult:<br>        check = definition.config.get(&quot;check&quot;)  # &quot;vendor_active&quot; | &quot;duplicate&quot; | &quot;po_match&quot;<br>        invoice_id, found = resolve_path(context, &quot;invoice_id&quot;)<br>        invoice = await self._finance.get_invoice(tenant_id=tenant_id, invoice_id=invoice_id)</pre><pre>        if check == &quot;duplicate&quot;:<br>            history = await self._finance.get_invoice_history(tenant_id=tenant_id, vendor_id=invoice.vendor_id)<br>            duplicate = DuplicateCheckService().check(invoice=invoice, history=history)<br>            if duplicate.assessment == &quot;NO_DUPLICATE&quot;:<br>                return ControlEvalResult(result=&quot;PASS&quot;, reason=&quot;no duplicate detected&quot;)<br>            return ControlEvalResult(result=&quot;FAIL&quot;, reason=f&quot;duplicate assessment: {duplicate.assessment}&quot;)</pre><pre>        if check == &quot;vendor_active&quot;:<br>            vendor = await self._finance.get_vendor(tenant_id=tenant_id, vendor_id=invoice.vendor_id)<br>            if vendor.status == &quot;ACTIVE&quot;:<br>                return ControlEvalResult(result=&quot;PASS&quot;, reason=&quot;vendor active&quot;)<br>            return ControlEvalResult(result=&quot;FAIL&quot;, reason=f&quot;vendor status: {vendor.status}&quot;)</pre><pre>        if check == &quot;po_match&quot;:<br>            match = await PurchaseOrderMatchService(self._finance).match(invoice=invoice)<br>            if match.status == &quot;MATCHED&quot;:<br>                return ControlEvalResult(result=&quot;PASS&quot;, reason=&quot;PO and goods receipt matched&quot;)<br>            return ControlEvalResult(result=&quot;FAIL&quot;, reason=f&quot;PO match failed: {match.status}&quot;)</pre><pre>        raise ValueError(f&quot;unknown check type: {check}&quot;)</pre><p>If the agent’s analysis says an invoice is clean but this independent re-derivation disagrees, the control fails — and the workflow stops, regardless of how confident the agent’s own explanation sounded.</p><h3>This isn’t just a finance problem</h3><p>I formalized the mathematical reasoning behind part of this system separately, in a published paper on CVaR-constrained optimization for supply chain finance — a stochastic mixed-integer programming framework for decision-making under uncertainty, solved deterministically rather than left to a model’s judgment call. The paper is domain-specific to finance, but the underlying principle isn’t: anywhere an agentic system is making decisions with real consequences — healthcare dosing logic, legal document analysis, infrastructure automation — the same question applies. Should the model decide, or should the model orchestrate a decision made by something that can’t drift?</p><p>I don’t think there’s a universal answer. But I think the default assumption — that a capable enough model eventually just handles it — is the wrong starting point for anything where being wrong is expensive.</p><h3>The principle, stated plainly</h3><p>If a wrong answer in your system costs money, trust, or safety, don’t let the part of your system that can be <em>confidently</em> wrong be the part that produces the number. Let it decide what to ask. Let it explain the answer. Don’t let it be the answer.</p><p>That’s the architectural bet I made building FinOps OS, and a year and three published papers later, it’s the one I’d make again.</p><p><em>I’m Jayavarshan Kuppusamy, an independent builder working at the intersection of finance and agentic AI systems. You can find my work on </em><a href="https://github.com/Jayavarshan-code"><em>GitHub</em></a><em> and my published research on SSRN.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a889a29376c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>