Holdbrief: a daily read on the stocks you follow
Holdbrief is a daily brief on US and Indian stocks. Code computes every number and the stance, an LLM writes the explanation from those facts, and a checker removes any sentence it can’t trace back to them.
- Context
- Personal project, 2026
- Read
- 9 min
- Updated
- Built with
- Python, FastAPI, SQLAlchemy, SQLite, React, TypeScript, Vite, Claude API, SEC EDGAR
- Credit
- Parts of the engine began from the MIT-licensed daily_stock_analysis (opens in a new tab)
My part
I did the design, the engine, the API and the web app, and I made every decision. It’s a solo project.
Holdbrief is live at holdbrief.com (opens in a new tab). The live demo (opens in a new tab) is read-only, covers 30 of the stocks and needs no account; sign-in is by invitation. It’s free and open source under the AGPL: the source is on GitHub (opens in a new tab), and the site is my own instance of it.
What it does
Holdbrief is for people who hold stocks for years. Each day they want to know two things: whether anything changed, and whether the price is still reasonable for the business. After each market closes, Holdbrief writes a short brief on each of the 301 US and 200 Indian stocks it covers. Each brief gives:
- a stance: Keep, Watch closely or Reconsider;
- the price against a fair zone, the range in which it calls the price fair;
- a rating of the business as strong, average or weak;
- a short written read that cites the facts behind it;
- what changed since the last close, or a plain statement that nothing did.
Readers choose the stocks they follow and get one email each weekday morning with only what changed; Monday’s covers Friday’s session. A sample brief (opens in a new tab) shows what a full one looks like. Every reader sees the same view, and everything Holdbrief publishes is general information and not advice.

How it works
A site that prints one fair-value figure gives no sense of how sure it is, and a language model asked to summarize a stock will confidently type a price that isn’t today’s. I wanted a range that widens when a company is hard to value, a plain “Not enough to call” when the methods can’t settle on one, and prose that cannot drift from the numbers beside it.
So code computes everything that can be checked: the rating, the fair zone, the stance and the day’s events, all by fixed, versioned rules. An LLM writes the explanation from a table of those facts, and nothing else. A checker rejects any sentence the table doesn’t support, and every published view is stored to be graded later.
One market’s daily run, after its close
1. Facts
- Collected for every stock:
- Prices and fundamentals (I reworked this)
- Company filings (US) (I built this)
- Exchange announcements and results calendar (India) (I built this)
- News from five providers (I built this)
- The day’s events, found by rules (I built this)
2. Judge
- Business rated against peers in its own market (I built this)
- Fair value from the methods that suit the company: banks use book value (I built this)
- Fair zone and stance: or “Not enough to call” (I built this)
3. Explain
- A fact table, one ID per fact (I built this)
- Anything material today?: a fixed list of triggers (I built this)
- yes: Model writes the read with placeholders (I built this)
- Checker: one repair, then failing sentences dropped: a rule‑written read if the model is unavailable (I built this)
If not (a quiet day)
- Yesterday’s read is shown again: no model call (I built this)
- Its placeholders take today’s numbers (I built this)
4. Publish
- Stored report, never rewritten (I built this)
- Graded later against the index and sector peers (I built this)
- Morning email of what changed (I built this)
Step 3 calls the model only on a day when something material changed; on any other day the lane under it runs. The box marked as reworked began from the open‑source project credited above.
I builtI reworkedUnderlined opens its section
What the model writes, and what checks it
The model receives the stock’s fact table, one ID per fact, and writes a short read with placeholders such as {{price}} and {{fair_range}} where the figures go. The page fills them in with current values, so a read written last week shows today’s price and the model has no way to type a stale one.
A checker then rejects any sentence that:
- types a figure by hand, or cites a fact that isn’t in the table;
- uses a verb that contradicts the sign of its number, such as “fell” beside a positive number;
- compares two unlike quantities, or gets a comparison the wrong way round;
- describes the business or the price in words that contradict its rating or where the price sits against the fair zone.
Example: one comparison, accepted and rejected
- Three rows of the fact table
growth_neededis 2.2%growth_delivered_3yis 3.6%growth_relationis less than
- Accepted
The price implies revenue growth of about {{growth_needed}} a year, {{growth_relation}} the {{growth_delivered_3y}} achieved over three years.The price implies revenue growth of about 2.2% a year, less than the 3.6% achieved over three years.The sentence as the page shows it, with every placeholder filled from the table.- Rejected by the checker
The price implies revenue growth of about {{growth_needed}} a year, more than the {{growth_delivered_3y}} a year achieved over three years.Both placeholders are valid, and the typed comparison contradicts the table: 2.2% is less than 3.6%.
Units are normalized first, so Indian lakh (100,000) and crore (10 million) compare correctly with billions. A failing read gets one repair call, and any sentence that still fails is dropped. The checker is strict and sometimes rejects a sound sentence. I accept that over a wrong figure, and I loosen a rule when its false rejections show up in the repair counts.
Headlines are third-party text, and every prompt labels them that way. The writing prompt also tells the model never to follow an instruction inside a headline, and it names the single company the brief is about.
Apart from the wording, the model can do one thing, which is to suggest moving the stance one step. The code accepts the suggestion only when it cites an event in that day’s data that the rules already mark as able to move the stance, such as earnings that beat or miss expectations by 10% or more.
When the model runs, and what it costs
Every stock gets its numbers, stance and fair zone every day. The model is called only when something material changed, and the trigger decides which model writes.
| Model | Called when |
|---|---|
| Heavier model | A stock is covered for the first time. The stance, the business rating or the price position changes. There is a material event, or material news such as results, guidance, a deal, a management change or a legal case. The price moves 5% or more in one session. A tracked fact moves past its tolerance. |
| Lighter model | A placeholder’s fact has left the table, or the read is 30 days old. |
| No call | None of these happened. Yesterday’s read is shown again with today’s numbers filled in. |
Every call carries the same long system prompt, which is cached on the provider’s side, where cache reads cost a fraction of normal input. A budget is checked before each call, with followed stocks first in line and the rest sharing a capped allowance. Together these keep the daily cost near two dollars for all 501 stocks.
What code decides: rating, fair zone and stance
Rating the business
Each stock is scored against peers in its own market, drawn from its industry and re-ranked by similarity, with a guard against outliers. Comparing inside one market keeps differences in accounting and capital rules from distorting the scores, at the cost of breadth: 301 and 200 companies are small pools.
The code computes three scores: quality, growth and financial health. Quality combines profitability, growth and safety, following the quality-minus-junk factor from academic finance. The quality score sets the rating, with the health score as a guard: a quality score of 67 or above is rated strong unless health is weak.
Valuing the price
Each company is routed by type to the valuation methods that suit it. Most companies get three: the company’s own usual valuation range, the range for similar companies, and a discounted cash flow (the value today of the cash the business is expected to produce). Banks get two methods anchored on book value, the net worth on the balance sheet, because a bank’s cash flows say little about what it earns on that balance sheet. Insurers, property trusts, loss-makers and cyclical companies have their own routes, and discount rates are set per market.
The fair value is a weighted median of the methods, which keeps one extreme method from dragging the result. The analysts’ average target counts for a small share of the weight and is labeled as theirs.
When fewer than two methods are usable, or they’re too far apart, the page prints no fair value. It says “Not enough to call” and shows the growth the price implies against the growth the company has delivered.
The fair zone
Every stock gets an uncertainty class from low to extreme, based on how much its price swings, how steady its margins are, how much it owes and how far apart the methods are. The class sets the width of the fair zone: about 5% either side of fair value for the most predictable stocks and 15% to 25% for the least, wider where the methods disagree. A fixed band would hold a stable utility and an unprofitable growth company to the same tolerance.
Microsoft at the close on 28 October: the price sits inside the fair zone
US dollars a share, on one scale. The zone and the estimate are Holdbrief’s, and the price and the analysts’ average come from the market.
- Fair zone: $392 to $715
- Our estimate: $433 to $648
- Price: $531
- Analyst average: $602
A price below the fair zone is called cheap, a price inside it fair and a price above it expensive. The estimate, the price and the analyst average are all inside the fair zone.
The zone is wider than the estimate it is built around, so a price can leave the estimate and still be called fair.
Setting the stance
One fixed table turns the rating and the price’s position against the fair zone into a stance.
| Business | Cheap | Fair | Expensive | Not enough to call |
|---|---|---|---|---|
| Strong | Keep | Keep | Watch closely | Keep |
| Average | Keep | Keep | Watch closely | Watch closely |
| Weak | Watch closely | Reconsider | Reconsider | Watch closely |
I also made the stance slow to change. A price move changes it only after the price holds for 3 closes, and then by one step at a time. Fair-value revisions under 3% are ignored, and each change names a reason from a closed list. Someone holding for years is better served by a view that doesn’t flicker on noise. The whole method is versioned (currently 2026.11-f), and each stored report records the version that produced it.
Data and the daily run
Prices and fundamentals come from Yahoo, and US company statements also come from the SEC. Dated events come from the filings US companies make for material events and from the announcements and board-meeting schedule of India’s National Stock Exchange. All of it is third-party and can be late or wrong.
News comes from five providers, because they fail in different ways and I’d rather reconcile several than trust one. Each runs in parallel with its own timeout, circuit breaker and per-run cap. Items are matched to the company, which matters when ITC and ITC Hotels share a name. Duplicates are merged across providers, and junk such as law-firm ads is dropped.
Each market runs once after its close, with retry passes that evening and the next morning. Reruns are safe: a pass skips any stock already published for that session. The runner holds a lock and records every source’s failure rate in a run ledger.
When things go wrong
| Failure | What happens |
|---|---|
| A news source is blocked or over quota | It counts as skipped, not failed. News from the previous report’s last 7 days carries forward, and the page says when news was unavailable. |
| The model errors, refuses or is cut off | The call moves to the next model. If none works, code writes the read from the same facts and the run is marked degraded. |
| The model budget is spent | The numbers, stance and fair zone are still published, and only the written read waits. |
The record
Every view is stored the day it is published, never rewritten, and graded later.
The record so far: started, and no view has reached its 60th session yet
- 21 October 2026: the record starts, and every view since is stored unedited
- Graded at 60 sessions: against the market index and the median of its sector peers
- Around January 2027: the first 60‑session grades arrive
| Stance | Expected | Graded on |
|---|---|---|
| Keep, on a strong business at a fair or cheap price | To outperform | Its return against the index and its sector peers |
| Reconsider | To underperform | The same return, and the drawdown it avoided |
| Watch closely | No direction | Not graded |
Each hit rate (the share of graded views that went the expected way) carries a 95% range computed only on independent calls, one per stock per horizon window. Overlapping windows would make the range look far tighter than the evidence allows. The short horizons are noisy, so the longer ones count for more.
Limits
The record is weeks old, and I quote no results from it. I made two choices by judgment, the method weights and the widening fair zone, and it will take a longer record to test them.
The business rating hasn’t earned trust yet. In my own test over a short window from 2025 to 2026, the quality score came out backwards in both markets: higher-rated stocks did worse after 60 sessions. A short window of today’s large companies is too thin for a verdict, and Holdbrief’s how-it-works page (opens in a new tab) says the same.
The whole system runs as one FastAPI service and one SQLite database, with the scheduler inside the service, because a single process is easy to reason about and restore. If I added more markets or readers, I would move the database to a server and the scheduler out of the web service, and I would put a second model provider behind the fallback, which today is another model from the same provider.
The design notes and validation studies are in the repo’s docs folder.