I had the research. I didn't have a system.
How I built an AI assistant that runs my portfolio with me - and keeps every decision on record.
A month ago I sat down and decided I needed a system to manage my portfolio
One position was down 57% from cost basis. I was too busy with projects, running a business that I hadn't looked at it since July.
12 positions were under 5% of the portfolio. One of them could double and my whole portfolio would move by about half a percent.
And a research report I'd paid for, about exactly the themes I was invested in, had arrived three days earlier. I'd watched it. Nothing in my portfolio changed because of it.
I believe I was simply overwhelmed. I read the research when I had time, tried to understand it and make my own opinions, I had some rules, however what I didn't have was a system that connected them. The research lived in one place, the positions in another, the rules nowhere.
What I have now
Four parts, all run by my AI assistant, all in one folder on my machine (and on Github).
1. A weekly check-in with my assistant
Every Saturday I sit down with my assistant for two things.
Intel ingestion. I give it whatever arrived that week: a Real Vision report, a model portfolio update, a letter, my own notes. It files it into my knowledge base, then compares it against what I actually hold. Which names do I own? At what weight? What does this source imply for them? It proposes changes to my records. I evaluate them and make decisions.
Ledger review. We go through the open positions: is the thesis still intact, has anything I said I'd watch for happened, is anything due for a fresh look?
The weekly check-in: decision recorded in the ledger, execution as a separate step
If a decision comes out of it - hold, trim, exit - it goes into the ledger. That's the decision made, with its reason and date.
Executing it is a separate step. It follows from the decision, but it doesn't have to happen right away: I can wait for a better price, for the end of the week, or for cash to come in. When I'm ready, the assistant drafts the order in my broker account, and I review it and approve it in IBKR myself. Nothing is sent on its own.
2. Daily price scans, with alerts to my Gmail
Every weekday evening, after the US close, a small script checks every position against my rules.
It watches the following tripwires:
- Trailing drop - a position falls 25% from its highest close since I bought it. The momentum might've broken.
- Risk limit - a position is 25% below cost basis.
- My own stop - a level I wrote down when I made the decision.
- Too big, too small - a position grows past its cap, or sits below the floor.
- Stale thesis - the date or event after which I said I'd recheck has passed.
Tripwires on one sample position, daily closes
A tripwire is a reason to look, and the e-mail says what to look at.
Most nights nothing fires, and I get no e-mail. But silence is the dangerous part of any alert system. A script that crashed and a script that found nothing look exactly the same from the outside. So every run writes down what it checked: every position, every price, every exchange rate, and how far each position is from its nearest level. A quiet night comes with proof.
A quiet night next to a night with two alerts
3. Position size, basket size, theme allocation and a record of every decision
This is the part I was missing the most.
I decide how many positions I want to hold considering my NAV. From that, the system works out three bands every night, from the live value of the portfolio: a floor, a natural size and a cap. With 10 positions that's 5%, 10% and 20%.
Below the floor, a position doesn't matter enough to be worth the attention. I top it up or exit. Above the cap, I trim back to the cap. That's the only sell the system ever suggests on its own.
Because the bands are recomputed from the live value every night, they move with the portfolio. Nobody has to update a spreadsheet.
Position sizes against the bands, and allocation by theme
Then there's the ledger. One file per position, holding the decisions:
- why I bought it (the thesis),
- the stop,
- how convinced I am,
- when the thesis needs a fresh look - a date, or an event like "next earnings",
- and a log of every decision since, each with its date and reason.
The log only grows. Nothing in it gets rewritten. When I move a stop, I don't overwrite the old one, I add a line saying when, from where, to where, and why.
One position's ledger, from purchase to trim
"Why do I own this?" now has an answer, written on the day I decided.
4. A local knowledge base of my themes
Everything I read ends up in a small wiki on my machine: one page per theme, per company, per source, linked together. My assistant reads it and keeps it up to date.
When a new source arrives, the assistant knows which themes it touches, which companies sit under those themes, and which of those I actually own.
A new source, the themes it touches, and the positions under them
That's what turned research into something I act on. Before, a report was something I watched. Now it ends with a list: these three positions are affected, here's what the source says about each, here's what I'd change in the ledger.
The Four design decisions
The ledger stores decisions, never facts. Quantities, cost, prices and exchange rates come fresh from the broker on every run. They're never written into the ledger. That means there's no inconsistencies between the records and my account. The ledger only holds the things that exist nowhere else: what I decided and why.
Code for deterministic work; AI for the judgement, evaluation. The nightly scan is a few hundred lines of Python. The assistant digests research, compares it with my positions, prepares a review, drafts orders.
Deciding and executing are separate steps. A decision lands in the ledger the moment I make it. The trade follows from it, on my timing, as its own step. That keeps the record honest - what I decided and why stays true whether I execute today, next week or in pieces - and it means nothing reaches the market as a side effect of updating my notes.
Privacy first. The ledger, the knowledge base and the nightly scan live in my own private repository, and the scan never calls a model. The assistant runs on Claude, or on an open-weights model (DeepSeek) through Fireworks, which doesn't keep prompts or outputs. Either way the boundaries are the same.
Where it is now
It's been running every weeknight since start of October. Every position I hold has a written thesis in the ledger. Research gets compared with my portfolio the week it arrives.
I've been feeding it RV reports. However, the knowledge base takes any source. If you read a newsletter, a broker's research or your own notes, it works the same way.
The engine - the ledger and the nightly alerts - is open source on GitHub. The whole setup, with Claude Code and IBKR, is on the AI Portfolio Manager page.
And if you manage your own portfolio: what's the part you'd most want a system to take off your hands?
This describes a system I built for myself. It isn't investment advice, and every chart above uses a made-up sample portfolio.