Inspiration

I wanted to make investing accessible and engaging, especially for beginners. Financial platforms can feel intimidating with endless forms and charts. I imagined a system where users could just talk to an AI, ask questions, and get real-time, actionable investment advice — like having a personal financial coach in your pocket.

What I Learned

This project taught me: How to integrate multiple AI systems: STT (speech-to-text), LLM reasoning, vector databases for RAG, and TTS (text-to-speech). The power of Retrieval-Augmented Generation: using a vector database to provide contextually relevant info from a large PDF knowledge base. How to fetch and process real-time data from external APIs (Yahoo Finance) and combine it with AI reasoning. Best practices for building a reliable backend and handling multi-step AI workflows. How to structure a full-stack application that integrates frontend, backend, AI, and database layers seamlessly.

How I Built It

Frontend: Captures voice input via the Web Speech API Sends text queries to backend via POST /api/get-advice Displays AI responses clearly and visually, including portfolio allocations Backend: RAG system: PDF knowledge base split into chunks, embedded into MongoDB Atlas for vector search Real-time market data: Fetched via Yahoo Finance API LLM reasoning: Groq AI used to generate investment advice; Google Gemini as fallback Structured output: Ensures portfolio allocation, risk level, and confidence metrics are consistent and reliable Voice output (planned/optional): ElevenLabs API converts AI text responses to natural voice Plays audio through browser, optional for demo reliability

Challenges Faced

Ensuring the LLM output was safe and reliable (allocation sums, valid risk levels) Integrating multiple APIs (Yahoo Finance, ElevenLabs, Groq AI, Google Gemini) into a single workflow Semantic search with vector DB: selecting the optimal chunk size to balance speed and relevance Frontend/voice limitations: browser autoplay restrictions for audio output Debugging multi-step asynchronous calls and ensuring smooth, real-time performance

Takeaways

StockAI demonstrates how AI, real-time data, and user-friendly design can transform complex tasks like investing into a hands-on, interactive experience. Even without full voice output, the system remains robust, educational, and engaging, showing the power of RAG and multi-API orchestration in a hackathon-ready project.

Built With

Share this project:

Updates