Defensive share = defensive / defensive. Always 100.
Defensive share = defensive / all priceable assets.
Stage 4 · Agent engineer · AI agent case
I designed and built the whole assistant. It is live for real users of an investment app: they ask about their own assets in natural language, and it handles conversation, portfolio check-ups and memory.
This is what a single turn looks like. Each step opens to show what it did. Everything here is sample data.
Before launch, testing showed the defensive-asset share at 100%. The real figure was about 36%. The denominator was wrong: it counted only the assets that were already defensive. I fixed the denominator and added a gate.
Animation: the denominator grows from defensive assets only to all priceable assets, and the share falls from 100% to 36%.
Defensive share = defensive / defensive. Always 100.
Defensive share = defensive / all priceable assets.
If priceable assets cover less than 30% of the portfolio, the assistant gives no advice. Watch it run, then drag it yourself.
no advice given
The user is looked up from the session and never passed as a tool argument, so a prompt injection cannot read someone else's data.
Output is checked claim by claim. Memory is isolated per user and writes are idempotent.
Fail again: fall back to a template
The split is the product. Anything a user could check with a calculator is done by code.
The model explains. The code counts.