Inspiration
I've always wanted to get into AI when making a project, and this seemed like the perfect opportunity to finally take that step. Another thing I've had an interest in is investing. I know just how difficult it is to start out when investing, so I wanted to create a tool that would make the process easier.
What it does
We imported the top 50 trending business articles and prompted an AI to recommend 8 stocks based on the information in the articles. It gives a short description of why you should invest and credits the sources with URLs so you can research on your own.
How we built it
We used News API to fetch the top 50 trending business articles. We then got a short description about each article and passed that through the AI (using llama 3.3-70b-versatile). The AI would then check through all the articles and recommend 8 stocks to invest in, the AI would return the stocks ticker, company, reason for the recommendation, articles used, and sentiment on it. We then passed the ticker returned by the AI through finnhub API to get the current price of the stock. We built all of this using react and tailwind.
Challenges we ran into
We were initially supposed to implement a separate page for each stock, and it would go in detail about the stock, giving all the data about the stock, a graph, and all the articles. We had finnhub API fetch most of the data, however we realized the graph would be hard to implement with the time constraints, and finnhub API did not provide the data to do so. Additionally, there was supposed to be a scoring system on the sources, and we included a list of buzzwords in business and reputable sources to get articles from and gave them a score based on if they contained buzzwords and/or was from a reputable source. However, since we only used 50 articles, the sample size was severely limiting, and it would consistently score 3-5 articles higher than the rest, using only those articles for stocks that sometimes weren't even related. We also spent a while prompting the AI since it kept giving stocks that were vaguely related and sometimes being an incredibly far reach for connecting a stock and article.
Accomplishments that we're proud of
We're proud of making our first app that includes an AI, it's definitely a step that we've been wanting to take for a long time, even if the use of AI is not machine learning and training, it's still exciting learning how to use it. the API data also connects pretty seamlessly, and I think we designed it pretty well, along with the structure of the page.
What we learned
We learned how to use an AI, prompting, and deepened our understandings of APIs (since we had to use 3). We also learned just how hard using an AI can be, as it doesn't always provide the same response, and you can't give it feedback on which response is good and which isn't.
What's next for AI Stock recommender
Definitely better APIs, one of the limiting factors of this project was the API restrictions. We couldn't prompt the AI the way we wanted because if we either increased the number of articles used or prompted with too much information, or asked it to respond with too much information, we would quickly hit the rate limit. Another thing would be to implement the features we never got to, an in-depth analysis of the stock with its own page containing a graph and data would definitely be implemented, and the article score function, I did feel like it made some stocks connect better with articles, however the sample size for articles just limited it too much, and it could also be improved to provide a greater variety of recommended articles.
Built With
- finnhub
- groq
- javascript
- news-api
- react
- tailwind
- visual-studio-code
Log in or sign up for Devpost to join the conversation.