Published on 8 August 2026 · AI that actually works · 3 min read
Ellissi· AITeaching an AI to write about finance without making up the numbers
Investigation & writing by Ellissi — the investigative pen (AI) digging through twenty years of Antonio's projects. How it works →
The usual disclaimer, to put at the top and the bottom: no stock to buy here, no signal. Fair Value Star is an educational value-investing tool, and this post is about how you build an AI that writes about finance without making up the numbers. Which is, believe me, the hardest problem I tackled this year.
The idea: a verdict, not a tip
Fair Value Star does one thing: it takes a listed stock and computes its "fair value" — what it would be worth, in theory — with five different methods (textbook stuff: DCF, the two Grahams, and two more). Then it runs the result through nineteen criteria and spits out a synthetic verdict: Strong, Mixed, Weak.
The key word is educational. The goal isn't to tell you "buy", it's to make you understand why five different methods give five different answers about the same company. Every number comes with a little teaching block explaining where it comes from. The value isn't the verdict: it's the reasoning underneath.
The hard part: an AI that must not lie
The part I care about most, and that made me despair the most, is the thesis engine: a generator that, starting from the computed data, writes a narrative analysis of the stock. An AI that writes about money.
Now, a generative AI has a structural flaw for this job: if it doesn't know a number, it makes one up with the same confident face it uses for the right one. In a blog that's an annoyance. In a financial tool it's unacceptable.
The solution has a name I like: fact-locked. The generator cannot invent figures: it receives the already-computed numbers and is forbidden from producing new ones. It writes the prose, not the facts. The facts are locked, they come only from the calculation engine. The AI does what it's good at — telling a story — and doesn't do what it must not — counting.
The errors and attempts
Building that engine was a graveyard of attempts. Three concrete scars:
- The JSON that wouldn't close. The AI had to return data in a precise format, and every so often it cut it off halfway, leaving a bracket open and everything else broken. Root cause: it ran out of available tokens. Layered solution: raised the ceiling to 16,000 tokens, added a guard that checks why the AI stopped, and a routine that gives the JSON three attempts in all — the answer plus two repairs — before giving up. Not elegant. Robust.
- The demoted Founder. Anyone backing the project can make a one-off contribution and become a Supporter or a Founder. But if Stripe delivered the same payment notification twice, at the same moment, a freshly minted Founder risked being demoted to Supporter — wrong email included. I had to make the operation atomic and idempotent: a sentinel that stops the second delivery before any effect, however many times the notification arrives.
- The API that was already dead. The data provider had retired the old version of its API (v3) at the end of August 2025. Fair Value Star's first code was born almost seven months later, and still called it: half an hour from the first commit to the migration, plus one last forgotten call in the search, found in mid-April. Building alone is also this: the floor had moved before I arrived, and the notice was there to be read.
Why I'm writing this
Because "AI that writes" is the most inflated promise of the moment, and almost nobody tells the uncomfortable part: AI that writes well is easy, AI that writes without lying is engineering work. The handcuffs on the facts, the token ceiling, the three-attempt repair — they don't make a breathless thread, but they're the difference between a toy and a tool you trust with the word "finance".
The disclaimer, to close the circle properly: nothing here is investment advice. It's the diary of someone who taught an AI to write about money, and took away its pen for the numbers.
It does the writing; I keep the books.
