This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady.
What I Built
What if researching investments could take a few clicks instead of hours of browsing financial websites?
That question inspired StockPilot AI, a free, open-source investment research assistant built for people who want to understand stocks and ETFs without becoming financial analysts.
Imagine you have €20,000 to invest over 12 months. Normally, you might spend hours comparing prices, researching ETFs, studying charts, calculating currency conversions, and estimating how many shares you could afford.
StockPilot brings those tasks into one browser-based experience.
Enter your budget, currency, investment duration, preferred market, and investment type. StockPilot automatically retrieves historical market data, analyzes investment candidates using open-source machine learning, and produces a research shortlist.
It displays:
- AI-ranked stocks and ETFs from selected US and European markets.
- Historical price charts and momentum indicators.
- A machine-learning assessment of historical price patterns.
- Estimated purchase quantities and remaining cash.
- Currency conversion information.
- Illustrative investment scenarios for the selected duration.
- Candidate comparisons and external research links.
The goal isn't to predict the stock market perfectly. It's to make the first stage of investment research more accessible, transparent, and less repetitive.
Demo
Try StockPilot AI: https://stockpilot-ai.sandeela.workers.dev/
No installation, account registration, or personal financial documents are required.
For example, I tested the application with a €20,000 budget, a 12-month investment horizon, and both US and European stocks and ETFs.
The application screened 23 instruments and generated a research shortlist. Its leading diversified ETF candidate was the iShares MSCI World UCITS ETF, with an estimated price of €129.89, 153 whole units affordable, and €126.83 remaining cash.
The application also displayed historical model statistics and an illustrative future value.
These figures are historical research outputs, not guaranteed investment returns.
I also tested a €100 budget and an invalid €0 budget. The application correctly rejected the zero amount. The €100 test highlighted an important improvement opportunity: the top-ranked candidate can cost more than the available budget, so the interface warns that no whole unit can be purchased.
Code
GitHub repository: https://github.com/sandeela/stockpilot-ai
Version 1.3 release: https://github.com/sandeela/stockpilot-ai/releases/tag/v1.3.0
The project is publicly available under the MIT license.
The repository includes the application source code, Cloudflare Worker deployment file, documentation, and automated tests.
How I Built It
I wanted the open-source AI component to do meaningful work—not simply add an AI label to a conventional calculator.
StockPilot uses TensorFlow.js, an Apache-2.0-licensed open-source machine-learning framework, to run a k-nearest-neighbors (KNN) classifier in the user's browser.
The application follows this workflow:
1. Retrieve historical market data
A Cloudflare Worker serves the application and retrieves historical stock and ETF prices through an external market-data source.
2. Prepare machine-learning features
The application constructs features from historical price behavior, including:
- 20-day momentum.
- 50-day momentum.
- Historical volatility.
These features summarize how an investment behaved over different periods.
3. Train a local classifier
TensorFlow.js performs tensor-based distance calculations for a KNN classifier.
The model compares current market conditions with similar historical observations. It uses the outcomes of those observations to classify the current pattern.
The model is trained and evaluated in the browser rather than through a proprietary AI prediction API.
4. Evaluate historical performance
The application separates training and validation observations chronologically, helping avoid the most obvious form of training-on-future-data leakage.
In one demonstration, the model reported:
- 187 earlier training observations.
- 47 historical validation observations.
- 63.8% directional validation accuracy.
- 76.6% majority-class baseline accuracy.
This is an important limitation: the classifier did not outperform the simple majority-class baseline in that example. I deliberately retained these results rather than presenting the model as more accurate than the evidence supports.
The model's historical-neighbor percentages are not calibrated probabilities of future profit.
5. Generate an AI-ranked shortlist
Model classifications contribute to the candidate rankings and eligibility filters. Existing trend checks and investment-planning calculations then help users compare the results.
6. Run the application without managing a server
Cloudflare Workers hosts the application. TensorFlow.js runs in the visitor's browser.
The deployed website remains accessible even when my laptop is switched off.
Technology Stack
- TensorFlow.js: Open-source machine-learning runtime.
- JavaScript: Data processing, classification, and application logic.
- HTML and CSS: Browser interface.
- Cloudflare Workers: Hosting and market-data proxy.
- GitHub: Public source code, version history, and releases.
Why Does Open Innovation Matter?
For me, the most important benefit of open-source AI is transparency.
Investment tools often present recommendations as authoritative answers without explaining how those answers were produced.
I wanted a different approach.
With StockPilot, the feature calculations, historical labels, model logic, validation approach, and ranking rules are inspectable.
Anyone can review the implementation, challenge its assumptions, or improve it.
There are also practical advantages:
Local inference: The machine-learning calculations run in the user's browser. Their investment budget does not need to be sent to a proprietary AI prediction service.
No paid AI API: The classifier does not require a subscription or secret API key.
Replaceable components: Developers can experiment with alternative features, classifiers, and evaluation approaches.
Reproducibility: The repository provides code and tests so others can inspect the implementation.
Honest limitations: Open code makes it easier to identify when a model performs poorly or when historical evidence is insufficient.
The application is not completely offline: TensorFlow.js loads from a CDN, and historical market data requires network access. Open-source AI does not automatically mean offline operation.
My Agent Session
I used AI-assisted development to help iterate on the application, improve its deployment architecture, introduce machine-learning functionality, and prepare tests and documentation.
I reviewed the resulting application through browser-based testing and published the source code and release history on GitHub.
I have not included a DevRelay agent-session recording.
The Lazy Payoff
The theme of Week 3 is Slow and Steady: build something that does the work so people don't have to.
StockPilot's contribution is reducing the repetitive preparation involved in early-stage investment research.
Instead of manually opening several finance websites, converting prices, calculating quantities, and comparing historical charts, users can enter their preferences once and receive a structured shortlist.
It automates:
- Collecting historical data for supported instruments.
- Comparing momentum and volatility patterns.
- Running local ML classification.
- Calculating whole-share affordability.
- Converting prices between supported currencies.
- Presenting research comparisons in one place.
I haven't conducted a controlled time-saving study, so I won't claim a specific number of hours saved. The benefit is consolidating multiple repetitive steps into one workflow.
The bigger lesson from building StockPilot is that open-source AI doesn't have to be enormous to be useful.
A relatively small, transparent model can automate a meaningful part of a workflow while leaving its assumptions open to scrutiny.
What I'd Improve Next
My next priorities are improving affordability-aware recommendations, expanding validation, evaluating the model against stronger baselines, and incorporating additional financial data where appropriate.
StockPilot AI is an educational historical research prototype, not personalized financial advice or an automated trading system. Its model outputs and illustrative future values should not be treated as reliable predictions of investment returns.
Try it: https://stockpilot-ai.sandeela.workers.dev/
Explore the source: https://github.com/sandeela/stockpilot-ai
Prize Categories
Overall Hacktoberfest Open-Source AI Challenge: Week 3 — Slow and Steady.
No partner-specific prize category is claimed.





Top comments (0)