Inspiration

I wanted to build a tool that bridges the gap between the complex, fast-moving world of financial markets and the people trying to make sense of it. The stock market reacts instantly to global news, yet most tools only show what is happening — not why. I saw an opportunity to help both beginner and experienced investors gain that missing context.

Perplexity’s Sonar model gave me a unique advantage: a real-time, web-search-powered AI that could analyze breaking events and connect them to stock movements. That inspired me to build AlphaGist — a platform that transforms noisy financial information into clear, actionable insights.


What it does

AlphaGist is a Perplexity AI–powered web app that allows users to:

  • Analyze any stock using live market data
  • Generate reports that explain why a stock is rising or falling using real-time event analysis from Perplexity Sonar
  • Chat with an AI assistant to explore stock viability, risks, breaking news, and terminology
  • Compare two stocks side-by-side in a report or table format
  • Toggle an educational mode for beginner-friendly explanations of complex concepts
  • Explore over 3,700 NASDAQ and NYSE stocks with real-time data, 5 years of historical context, and sentiment filters

How I built it

I built AlphaGist using a modern and scalable tech stack:

  • Frontend: Built with Next.js
  • Backend & Storage: Powered by Firebase Functions and Firestore for handling APIs and storing persistent data
  • AI Intelligence Layer: All core functionality is powered by Perplexity’s Sonar AI, which performs live web searches and delivers contextualized insights
  • Automation & Scraping: I wrote custom Node.js and Puppeteer scripts that run on CRON schedules during market hours. These scripts track and update stock prices in near real-time, ensuring the platform always reflects the latest market activity

Challenges I ran into

  • Prompt Response Formatting: Initially, I struggled with getting consistent JSON responses from the Sonar model. Providing examples worked, but it significantly increased token usage. I eventually discovered the response_format parameter in the Perplexity API, which allowed me to define the output structure explicitly — and from that point on, responses were returned accurately every time.

  • Performance at Scale: Ensuring that my stock-scraper.js script could keep all 3,700+ stocks updated while the market was open was a big challenge. I solved this by distributing the workload across multiple workers, enabling parallel scraping. After a lot of iteration and testing, I brought the update time down to just 7.5 minutes — meaning all stock prices are refreshed within that window.

  • Rate Limiting: Managing API limits while keeping data fresh during trading hours required careful orchestration across all worker scripts and API requests.


Accomplishments I'm proud of

  • Successfully combined live market data with live web search AI to deliver real-time, explainable insights
  • Built a unique educational mode that dynamically simplifies responses, making the platform accessible and useful for everyone
  • Implemented strategies that keep load times, server usage, and API calls to a minimum
  • Created a clean, intuitive interface that allows users of all skill levels to understand stock movements and market context in seconds
  • Automated the retrieval and updating of live and historical data for over 3,700 stocks

What I learned

  • How to effectively prompt and integrate Perplexity Sonar for financial and domain-specific use cases
  • Techniques for delivering a dual-layer UX that balances advanced tools with beginner accessibility
  • Efficient strategies for maintaining data freshness while managing external API rate limits
  • How to extract narrative value from raw market data using natural language generation

What's next for AlphaGist

  • 📱 Mobile app: I plan to build a React Native version of AlphaGist for iOS and Android
  • 📈 Deeper analytics: Include earnings breakdowns, insider trades, and sentiment history

Built With

Share this project:

Updates