Inspiration
Most people who invest pick a plan once, something like 60% stocks, 20% bonds and 20% cash, and then never look at it again. Markets move, the mix drifts, and without noticing you end up taking more risk than you signed up for. Fixing it means logging in, doing the math and placing several trades, so most people just don’t.
Alexa+ can already book a table or order groceries for you. I wanted to see what it would look like if it could also look after your money, without turning into an AI that tells you what to buy. The idea behind Ballast is simple: you set the rules, Ballast keeps you on them, and nothing happens until you say yes.
What it does
Ballast is an Alexa+ experience for keeping your portfolio on plan. Today it runs on a paper-trading account, but it’s built to connect to real brokerage accounts. The broker sits behind a single adapter, so supporting a live account or another broker doesn’t change how Ballast works.
“Alexa, how’s my portfolio?” Ballast reads your holdings and tells you how far each category has drifted from the targets you set.
“Rebalance me.” It works out the exact trades that bring you back on target and reads them out. Nothing is placed yet.
“Yes, go ahead.” A confirmation appears on your screen. Only when you approve it does Ballast place the orders, then it checks the result and confirms you’re back on plan.
Ballast never recommends investments. Ask it what to buy and it will tell you it only maintains the rules you chose.
The demo site simulates the Alexa+ experience in the browser, with voice in and out. An “under the hood” panel shows every tool call live, and a porthole-style horizon tilts with your drift and settles level once the rebalance fills.
How I built it
Ballast has four layers, and each one has a single job. A Bedrock agent stands in for Alexa+: it understands you, picks tools and explains the results. The Ballast MCP server offers 9 tools over Streamable HTTP and asks the user to confirm trades. The Ballast engine handles the drift, rebalance and guardrail logic. And Alpaca’s paper trading API provides real market prices with simulated money.
The engine is plain Python with no AI in it. For each category, drift is the category’s current share of the portfolio minus its target share, and the trade needed is the target share times the portfolio value, minus what you currently hold. If any category drifts past your limit, the engine plans trades that use spare cash first, place sells before buys, and skip trades too small to matter. Every plan then passes guardrails you control: maximum order size, maximum per rebalance, and a cap on any single stock. All money uses exact decimals.
Proposals are the safety lock. A plan becomes a proposal like BL-E86D that expires in five minutes and records a fingerprint of your holdings and rules. If either changes before you approve, Ballast refuses to execute the stale plan. A new plan replaces any older open one, and every step lands in an audit log.
The MCP server uses the official MCP Python SDK. The key design choice is that there is no “approve” tool the AI can call. When the AI asks to execute a rebalance, the server uses MCP elicitation to ask the person directly. The answer never passes through the model, so it can’t approve a trade on your behalf. Safety limits can’t be changed through MCP at all.
The agent runs on Amazon Bedrock with Claude Haiku 4.5, using the Converse API’s tool calling, with Amazon Nova as a fallback. It is only allowed to repeat numbers that tools return.
The demo site is a small Starlette app that streams each step to the browser as it happens, using the Web Speech API for voice.
The whole thing is covered by 75 automated tests, including a fake broker and a scripted model, so every path can be tested without AWS or market hours.
Challenges we ran into
No access to the real Alexa+ toolkit. Hackathon participants can’t use the gated Alexa+ MCP tooling, so I built the MCP server to the spec and used a Bedrock agent plus a browser simulator to stand in for Alexa+.
Finding a real action to take. My first idea was a fantasy football assistant, but none of the platforms offered write access I could get in time. That pushed me toward Alpaca, which has an official paper-trading API with self-serve keys.
Making sure the AI can’t trade for you. Prompt instructions alone weren’t enough for me. Moving approval into MCP elicitation, outside the model, made it a guarantee instead of a promise.
A tricky conversation bug. Refreshing the page mid-answer could leave a tool request in the history without its result, and Bedrock then rejected every later message. I fixed it by building each turn separately, committing it only when it finishes, and repairing broken history before each turn.
AWS onboarding. A new Free plan account limited the console to one region, which made the Anthropic use-case form hard to reach. I documented all of this in my friction log.
Accomplishments that I am proud of
The AI can explain, plan and ask, but it cannot move money without a human saying yes on the confirm card. Every number Ballast speaks comes from deterministic code, not the model. Stale or replaced proposals are refused before you’re even asked about them. The horizon animation: you can see your portfolio settle level when the rebalance fills.
What I learned
How MCP works in practice, especially elicitation as a way to keep a human in the loop. How to split an agent cleanly: the model handles language, deterministic code handles the numbers, and the person handles consent. How Bedrock tool calling works, and why a conversation history has to stay valid on every turn. How portfolio rebalancing actually works, including cash-first rebalancing and drift thresholds.
What's next for Ballast
Connect to the real Alexa+ once the MCP tooling opens up. The server is already built to the spec. Tax-aware rebalancing for taxable accounts, avoiding selling winners when new cash can do the job. Scheduled check-ins, so Ballast can tell you when you drift instead of waiting to be asked. More brokers behind the same adapter interface.
Built With
- alexa
- alpaca
- alpaca-py
- amazon-bedrock
- amazon-nova
- amazon-web-services
- anthropic
- aws-iam
- boto3
- claude
- css3
- github
- html5
- javascript
- mcp
- model-context-protocol
- pydantic
- pytest
- python
- starlette
- svg
- uvicorn
- web-speech-api
Log in or sign up for Devpost to join the conversation.