· 2 min read
Filter before you think
Designing Stock Bot, a scheduled LLM agent that reads the Nigerian stock market on a tiny budget.
Stock Bot is a small agent I'm building. Every day it finds stocks on the Nigerian Exchange that dropped, decides which drops look like opportunities, and sends me the shortlist on Telegram. The interesting part isn't the LLM. It's everything around it.
The pipeline
- An EventBridge schedule starts a Lambda function once a day.
- The function scrapes the day's biggest losers instead of every listed company.
- For each one it checks five days of stored prices in DynamoDB, to confirm a real dip and not one noisy day.
- Only the survivors go to Gemini with a structured prompt, and the top picks go to Telegram.
Why filter first
LLM calls are the slowest and most expensive step, so they go last. Plain code removes most candidates for free, and the model only judges the handful worth judging. The same idea applies to any agent: let cheap, deterministic steps narrow the problem, and spend intelligence where it changes the answer.
Small packages, fewer surprises
My first version used pandas, which made the Lambda bundle too big to deploy without extra layers. Swapping it for a lightweight HTML parser removed the problem. Serverless rewards boring dependencies.
It's still in progress: the pipeline works locally and the deployment is being finalised. Next, I want to log every pick and measure the model's calls against what the market actually did.
Related case study
Stock Bot