<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Adhithi.s</title>
    <description>The latest articles on DEV Community by Adhithi.s (@adhithis_senthil).</description>
    <link>https://dev.to/adhithis_senthil</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4232477%2F1b89d7ed-22dc-48cc-a1fd-d29b0e5e6506.png</url>
      <title>DEV Community: Adhithi.s</title>
      <link>https://dev.to/adhithis_senthil</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adhithis_senthil"/>
    <language>en</language>
    <item>
      <title>The dashboard said ₹9.91 lakh left. My Hindsight agent said ₹1.94 lakh short.</title>
      <dc:creator>Adhithi.s</dc:creator>
      <pubDate>Sat, 07 Nov 2026 17:52:57 +0000</pubDate>
      <link>https://dev.to/adhithis_senthil/the-dashboard-said-991-lakh-left-my-hindsight-agent-said-194-lakh-short-5d5g</link>
      <guid>https://dev.to/adhithis_senthil/the-dashboard-said-991-lakh-left-my-hindsight-agent-said-194-lakh-short-5d5g</guid>
      <description>&lt;h1&gt;
  
  
  The dashboard said ₹9.91 lakh left. My Hindsight agent said ₹1.94 lakh short.
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;How I built a cash-flow agent that never does arithmetic, and what I use Hindsight for instead.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A dashboard said Malabar Electronics would have ₹9.91 lakh left after Friday's supplier payment. The agent I built said it would be ₹1.94 lakh short. Both were working from the same books: ₹12.00 lakh in the bank and a ₹15 lakh bill due on 13 November.&lt;/p&gt;

&lt;p&gt;Only one of those numbers accounts for the fact that customers do not pay on the due date. Some are reliably a week late, some two. Owners tend to find out on the day the supplier bill lands. This post covers how the second number gets computed, why I will not let the language model compute it, and what I use Hindsight for once the arithmetic is out of the model's hands.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F35shfe2u1qchkbhw20q8.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F35shfe2u1qchkbhw20q8.jpeg" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The gap in one card: after paying the supplier on 13 November, a due-date dashboard says ₹9.91 L left; the forecast built from real payment habits says ₹1.94 L short.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  What it does and how it hangs together
&lt;/h2&gt;

&lt;p&gt;Cashwise is a cash-flow tool for small businesses that sell on credit: distributors, traders, manufacturers waiting on customers while raw-material bills arrive, and service firms with monthly invoicing and fixed rent and salaries. The owner uploads CSVs exported from Tally, Zoho Books, QuickBooks or Excel and gets a four-week forecast in best, likely and worst cases, a short weekly to-do list, alerts, management reports they can print, email or share by link, and an agent they can question in plain words.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The Cashwise landing page: the product pitch, with a live demo for anyone who wants to try the forecast first.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa39b03gc9t0rm95t2rpf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa39b03gc9t0rm95t2rpf.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;First-run setup: four uploads, then the forecast and the agent are ready. Customers, invoices and payments, suppliers and bills, and history for memory.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The backend is FastAPI and SQLAlchemy, with one SQLite database per business. The frontend is React and Recharts. The model runs on Groq with tool calling. Memory lives in &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight&lt;/a&gt;, one bank per business.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0cy6pz590dzzqfkxytp1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0cy6pz590dzzqfkxytp1.png" alt=" " width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Three components with three jobs. The forecast engine computes, Hindsight remembers, and the model chooses what to look at and explains what it found.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Most of the design is about not letting any one of them do another's job. One detail I care about: the forecast starts from the bank's balance, not the books'. The owner types in what the bank shows and a single adjustment keeps the records consistent. Books and bank rarely agree to the rupee, and a forecast that starts from the wrong number is wrong everywhere downstream.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjnhvoxsd2nixpwk6744a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjnhvoxsd2nixpwk6744a.png" alt=" " width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The overview: bank balance, four-week net cash flow in best, likely and worst cases, financial position, and the agent alongside.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The forecast is deliberately boring
&lt;/h2&gt;

&lt;p&gt;For each customer, the engine takes their last eight paid invoices and measures how many days late each one was. The 20th, 50th and 90th percentiles of those delays give a best, likely and worst case for when each open invoice will actually be paid. Supplier bills, recurring expenses such as rent and salaries, and any what-if changes are layered on day by day.&lt;/p&gt;

&lt;p&gt;Eight invoices is a small window, and I would rather say so up front. With so few points, the 90th percentile is close to "the worst delay we have seen": a defensible worst case, not a statistical guarantee. I chose the short window because payment behaviour drifts, and a customer who tightened up should not be judged on last year's habits. The interface says plainly that forecasts are estimates, not advice.&lt;/p&gt;

&lt;p&gt;What I get in return is traceability. Alerts, runway, the financial position and every report come from the same engine. When an owner asks why it says something, the answer is a list of invoices and delays, not a paragraph of model output.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpmsf0ob80kn49t45fegh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpmsf0ob80kn49t45fegh.png" alt=" " width="799" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The forecast chart. On 24 November the likely line sits at ₹2.23 L; if everyone paid on the due date it would read ₹12.83 L. The blue line is a what-if, and the green band is best to worst case.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The model is not allowed to do maths
&lt;/h2&gt;

&lt;p&gt;I have watched language models do arithmetic with money. They are right often enough to be trusted and wrong often enough to hurt, and the wrong answers arrive with the same confidence as the right ones. A cash tool that is confidently wrong on the morning a supplier bill is due is worse than no tool.&lt;/p&gt;

&lt;p&gt;So the agent works through tools, and a tool call is the only way a figure can enter an answer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cash_forecast   what_if   customer_profile   upcoming_bills   recall_memory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model decides which to call and then explains what comes back. Answers are structured: a headline, recommended actions, evidence, patterns from memory, and assumptions and uncertainty. The what-if tool is the clearest example. "What if Mehta pays 15 days late?" does not ask the model to reason about dates. It calls the same function that drives the slider in the forecast view, and the model reads the result.&lt;/p&gt;

&lt;h2&gt;
  
  
  What goes into Hindsight
&lt;/h2&gt;

&lt;p&gt;A forecast knows how customers pay. It does not know that a customer promised Monday and did not deliver, that a supplier once agreed to split a bill, or that phoning one particular customer achieved nothing last time. That context lives in the owner's head, and it is what turns generic advice into specific advice.&lt;/p&gt;

&lt;p&gt;I use the open-source &lt;a href="https://hindsight.vectorize.io/" rel="noopener noreferrer"&gt;Hindsight memory layer&lt;/a&gt; for it. If you want the background on why agents need a separate memory layer at all, Vectorize's explainer on &lt;a href="https://vectorize.io/what-is-agent-memory" rel="noopener noreferrer"&gt;what agent memory actually is&lt;/a&gt; is a good primer, and the Hindsight documentation for retain and recall covers the API. Each business gets its own bank, and two kinds of content go into it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;History.&lt;/strong&gt; During setup, owners can upload a final, optional file of past calls, disputes, extensions and decisions, with four columns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;date, entity_type, event_type, description
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The description is free text on purpose: it exists to hold what a ledger cannot. The data screen has a "Send history to memory" button because memory can be set up after the records, and nobody should have to re-upload everything to do it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdynzpvv0t8wbqdzkwz3p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdynzpvv0t8wbqdzkwz3p.png" alt=" " width="800" height="690"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Uploads are validated before anything is saved. The memory card on the right sends history to that business's own Hindsight bank.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The agent's own advice, and what happened next.&lt;/strong&gt; For every question the agent runs one loop: recall the most relevant memories from the business's bank; reason with the model and call the tools; explain the answer with evidence and uncertainty; retain the recommendation it just made.&lt;/p&gt;

&lt;p&gt;The last step is the one I care about most, and the easiest to skip. Because the recommendation is stored, outcomes and feedback recorded later have something to attach to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST /api/ask        POST /api/feedback
POST /api/outcome    GET  /api/memories
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The owner can record that a customer paid on the 18th instead of the 11th, and whether the advice was useful. Both go back into Hindsight alongside the recommendation that triggered them. The next time a similar question comes up, recall returns the earlier advice together with how it turned out. There is no fine-tuning and no retraining. The agent just reads a better record.&lt;/p&gt;

&lt;p&gt;Two more decisions. One bank per business: isolation is easy to reason about, one company's history never appears in another's answers, and recall only searches things that business said or did. And a switch, the "Memory on" control in the header, that turns memory off. That leaves a due-date-style assistant with forecast tools and no history, so I can compare the two on the same question. A memory feature you cannot turn off is one you cannot evaluate.&lt;/p&gt;

&lt;h2&gt;
  
  
  What an interaction looks like
&lt;/h2&gt;

&lt;p&gt;Back to the opening. In the forecast view, the weekly to-do list proposes asking the supplier to take ₹12.00 L on 13 November and holding back ₹3.00 L for two weeks. That turns a likely ₹1.94 L shortfall into ₹1.06 L left on the day. That is the what-if tool's arithmetic, surfaced as an action. Then the owner asks the agent: &lt;em&gt;What if Mehta pays 15 days late?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv68h8b2hz6psyvaiyarv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv68h8b2hz6psyvaiyarv.png" alt=" " width="436" height="946"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The agent as the owner first sees it: the "Online, with memory" badge and four starter questions.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7p51nt2npa8hklazz76e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7p51nt2npa8hklazz76e.png" alt=" " width="439" height="1078"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The agent's answer, with recommended actions, evidence and a labelled pattern from memory. The assumptions and uncertainty section sits below the fold.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The answer, in short.&lt;/strong&gt; The likely low point falls to −₹8.03 L on 2 December, with an ending balance after 30 days of about −₹2.68 L. Three actions: call Mehta Traders today and ask for payment within five days; send a formal reminder; and if there is no response by 12 November, offer a 2% early-payment discount for settlement within three days.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where each part comes from.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;From the what-if tool:&lt;/strong&gt; the low point, its date and the ending balance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;From Hindsight:&lt;/strong&gt; the note that Mehta consistently pays 13 to 15 days late, and the pattern that this habit has deepened cash shortfalls in past cycles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;From both:&lt;/strong&gt; the recommended actions, which combine the numbers with what has worked before.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The owner can tell which part is arithmetic and which part is recollection. That is the point of keeping them apart.&lt;/p&gt;

&lt;p&gt;I am not claiming the agent is right in any absolute sense. It reads estimates built from past habits, and it says so in the assumptions and uncertainty section. The claim I can make is narrower and checkable: every figure came from a function, and the history behind the advice comes from a bank the owner can inspect on the Memory page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running it
&lt;/h2&gt;

&lt;p&gt;Configuration is a handful of environment variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GROQ_API_KEY=gsk_...
HINDSIGHT_API_KEY=hsk_...
HINDSIGHT_URL=https://api.hindsight.vectorize.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;/api/health&lt;/code&gt; reports whether the model and memory are configured (&lt;code&gt;ai_configured&lt;/code&gt;, &lt;code&gt;memory_configured&lt;/code&gt;), which is the first thing I check when the agent behaves strangely. The test suite uses a throwaway database and never calls Groq or Hindsight, so the forecast and ingestion logic are tested without a network.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would tell another engineer
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Separate judgment from calculation in the architecture, not in the prompt.&lt;/strong&gt; A prompt that says "do not invent numbers" is a hope. A system where the only way to produce a number is a function call is a guarantee.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forecast ranges, not points.&lt;/strong&gt; A single figure implies certainty the data does not contain. Three cases side by side make the owner think about the bad one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retain the advice, not only the facts.&lt;/strong&gt; Most memory setups store what the user said. The more useful thing to store is what the agent recommended, because that is what later outcomes and feedback have to attach to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Give memory an off switch.&lt;/strong&gt; If you cannot turn it off and compare, you cannot tell whether it is helping, and neither can anyone you are trying to convince.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One memory bank per tenant.&lt;/strong&gt; It costs a little in setup and saves a lot of reasoning about privacy and relevance.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The forecast is why the number is right. Memory is why the advice is specific. Keeping the two apart is what lets me trust either one.&lt;br&gt;
&lt;a href="https://drive.google.com/file/d/1knUUg6Hha9f1R17sa-eynvkcAjoCgJEJ/view?usp=sharing" rel="noopener noreferrer"&gt;download the pdf version of this article&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>agents</category>
      <category>python</category>
    </item>
  </channel>
</rss>
