Inspiration
On a direct-investing platform there is no adviser between the investor and the order. The risk profile is filled in once at account opening and then nobody checks trades against it again. We wanted a check at the exact moment it matters: when the investor clicks Submit. Not to block them, but to make sure they see the conflict with their own plan before the order exists.
What it does
Second Look checks every trade against the investor's stored profile, goals and values (ESG preferences, money needed for retirement or a big purchase).
- Green: the trade fits, the order goes through with no interruption.
- Yellow: close to a limit, a short heads-up and one click to confirm.
- Red: a limit, goal or value is crossed. The trade pauses and the investor is asked why.
On a red trade, AI agents explain the conflict in plain words with dated, sourced evidence, and a conversational agent talks it through with the investor in French or English. The agent is grounded in investor-behaviour research (Library of Congress report for the SEC, 2010), it is non-judgmental and it never gives financial advice. The investor always keeps the final decision: revise, cancel, or acknowledge the risks and proceed.
How we built it
- A deterministic Python rule engine decides green, yellow or red (position limits, crypto cap, concentration, goal-based liquidity, ESG look-through inside funds). The AI can never change the verdict: the code overwrites it after the agents run.
- Strands Agents on Amazon Bedrock: three specialists run in parallel on Amazon Nova 2 Lite (Profile, News, Financial data), and the conversational agent runs on Claude Sonnet 5.5.
- Bedrock Guardrails screen the investor's message and every reply (prompt attacks, personal identifiers, harmful content).
- Every number in a reply must be tied to evidence; if not, the reply is rejected and repaired before the investor sees it.
- Two AWS Lambda functions (API + data tools), Amazon S3 for data and conversation state, CloudWatch for logs. Everything deploys with four scripts.
- Data: the AlphaForge starter dataset (31 assets), Bank of Canada and FRED, NBF model portfolios, ETF fact sheets and official news dated before the decision date.
Challenges we ran into
- Keeping the AI useful but never in charge of the decision. We split the job: rules decide, agents explain.
- Making the replies short and not repetitive. The first versions were way too long for a normal investor.
- Speed: the first reply took 46 seconds; we brought it to about 15 to 28 seconds by running the specialists in parallel and using a faster model.
- Guardrails that blocked normal risk warnings at first, so we had to tune them.
Accomplishments that we're proud of
- 12/12 live demo trades matched, 660 random stress-test trades, 81/81 rule-engine tests.
- 23 of 24 test conversations passed, with no hard-fail (the agent never called a client irrational and never gave advice).
- Every verdict is reproducible and hashed, with the source and date of each fact on screen.
What we learned
Explainability is not only about the model. It comes from the design: deterministic rules, evidence attached to every number, and a conversation that respects the investor's autonomy.
What's next for Second Look
Live market and news feeds, thresholds calibrated with National Bank advisers, secure login with real client profiles, and a larger evaluation with independent reviewers.
Built With
- amazon-bedrock
- amazon-cloudwatch
- amazon-nova
- amazon-web-services
- aws-lambda
- bedrock-guardrails
- claude
- css
- html
- javascript
- pandas
- python
- strands-agents