TrailCut: An AI Agent Team That Never Guesses a Rupee
2026-11-23 · 3 min read
Why now
SEBI made Direct plans the default on AMC digital platforms from 1 November 2026. But most retail money still sits in older Regular plans, quietly paying commission every year.
The obvious advice — "switch everything to Direct" — can backfire. In India, moving from a Regular to a Direct plan counts as selling one fund and buying another. That can trigger short-term capital gains tax, exit loads, and long-term gains above the yearly exemption.
So the real question is not whether to switch, but which units, in what order, and on which date. That is what TrailCut answers.
TrailCut is a calculator and explainer, not investment advice. It never places orders and never recommends funds to buy.
What it does
You upload your CAMS / KFintech CAS statement. TrailCut:
- finds every Regular plan and what its commission costs you this year, and over 10 and 20 years;
- builds a lot-by-lot switch plan — Switch now, Wait until a specific date, or Keep — with a one-line reason for each purchase lot;
- works out STCG, LTCG, the ₹1.25 lakh yearly exemption shared across lots, ELSS lock-ins, exit loads and 2018 grandfathering;
- compares the plan with "switch everything today" and "never switch".
How the optimizer works
For every lot, the planner prices a switch on a handful of candidate dates: today, the day the lot turns long term, the day its exit load ends, the day an ELSS lock-in ends, and 1 April (a fresh exemption). For each date it grows the lot at return − Regular expense ratio until the switch, deducts exit load and tax, grows the rest at return − Direct expense ratio, and compares the outcome with never switching. Lots with the biggest yearly saving claim the shared exemption first.
The plan is deterministic, never sells locked ELSS units, and is property-tested to never be worse than switching everything today. Every tax rate lives in a YAML file with a legal reference and source URL — nothing is hardcoded.
The rule: the AI never guesses a number
The "Ask the AI" chat is a team of Claude agents with tool calling: 4 specialists and 8 tools. But they never compute money themselves. Every rupee in a reply must come from the calculation engine, and a numeric-claim validator checks that each number the model quotes was produced by a tool. If the model invents a figure, the reply is rejected.
This is the pattern I now use for any AI product that touches money: the model explains, the engine calculates.
Privacy
The PDF is read in memory, personal information is masked before anything reaches an agent, and nothing is stored.
Stack
React + Vite with Razorpay's Blade design system on the front end; FastAPI, a pure Decimal-based engine (XIRR, FIFO lots, tax, exit load, expense ratio projections) and Claude tool calling on the back end — with over 1,340 tests and an offline fallback when no API key is set.
The code is open source on GitHub.