What It Does

AI Stock recommender is a multi-agent AI platform that turns a simple chat into a full-service investment advisor. Upload a portfolio statement, say what you want to invest, and get expert-grade stock recommendations backed by real-time technical indicators. It's live at https://www.aistockrecommender.com.

Inspiration

Retail investors juggle five browser tabs — screeners, charting tools, news feeds — just to make one decision. Meanwhile, Google released the A2A (Agent-to-Agent) protocol, letting AI agents delegate tasks to each other. I combined the two: instead of one monolithic AI, specialized agents collaborate — one parses documents, another runs technical analysis, another builds portfolio recommendations. One conversation replaces an entire toolkit.

How It's Built

Architecture — Three layers of agents communicating over standardized protocols:

  • Host Agent (FastAPI) — Orchestrates everything: Firebase auth, PostgreSQL sessions, and an integrated sub-agent that parses portfolio PDFs/images using Gemini 3.0 vision.
  • Stock Analyser Agent (A2A protocol) — Computes RSI ($100 - \frac{100}{1+RS}$), MACD ($EMA_{12} - EMA_{26}$), Bollinger Bands ($SMA_{20} \pm 2\sigma$), and support/resistance levels, then synthesizes buy/sell/hold recommendations.
  • YFinance MCP Server — Feeds real-time market data via yfinance and pandas-ta.

Frontend — React + TypeScript + Tailwind with Firebase Auth. Responses stream in real-time as sentence-level chat bubbles.

Infrastructure — AWS ECS Fargate, RDS PostgreSQL, CloudFront CDN, all provisioned via Terraform.

AI Model — Powered by Gemini 3.0 for document verification, ticker extraction, technical analysis interpretation, and portfolio recommendations. Supports both US and Indian markets.

Key Features

  • Chat-based portfolio analysis** — Upload a PDF/image, get actionable recommendations
  • Technical indicators — RSI, MACD, Bollinger Bands, support/resistance computed in real-time
  • Investment history — View all past recommendations the system has given you
  • Profit/loss tracking — See how much you would have gained or lost had you followed previous advice
  • Multi-market support — US ($) and Indian (₹) stocks with currency-aware allocations
  • Streaming responses — Real-time progress updates as agents work

Billing & Access

Since this is a hackathon project, a payment gateway isn't integrated yet — but the system is designed for it:

  • Credit system — Free users get 30 message credits and 3 report generations
  • Credit requests — When users need more, an admin receives an email (via Activepieces webhook) and can add credits. This human-in-the-loop step controls LLM API costs.
  • Payment-ready architecture — PayPal config is scaffolded; adding self-serve purchases is a flip-the-switch change
  • Whitelisted access — Logins are currently admin-whitelisted to prevent abuse during the hackathon period

Challenges

  • Agent boundaries — Started with 3 services; realized PDF parsing was too lightweight for its own microservice and merged it into the Host Agent
  • LLM consistency — Built a multi-pass extraction pipeline with 3 retries to handle hallucinated tickers
  • Context windows — A 15-stock portfolio with full indicators blows through token limits; solved with a LimitedContextSessionService and selective state persistence

What I Learned

Multi-agent systems are fundamentally distributed systems problems — timeouts, retries, and connection pooling matter as much as prompt engineering. Structured output contracts between agents are non-negotiable. And going from localhost to production AWS taught me more about infrastructure than any course.


Live at www.aistockrecommender.com

Built With

  • a2a
  • a2a-sdk-(agent-to-agent)
  • activepieces-(webhook-automation)-**frontend:**-tailwind-css
  • adk
  • amazon-web-services
  • apify-(web-scraping)
  • aws-cloudfront
  • aws-cloudwatch
  • aws-ecr
  • aws-rds
  • aws-secrets-manager
  • finnhub-api-(stock-news-&-quotes)
  • gemini
  • google
  • google-adk-(agent-development-kit)
  • langchain-(pandas-ta-for-technical-indicators)-**databases:**-postgresql-(via-sqlalchemy-orm)-**cloud-services-&-infrastructure:**-aws-ecs-fargate
  • lucide-react-**devops:**-docker
  • mcp-(model-context-protocol)-**ai/ml:**-google-gemini-3.0
  • postgresql
  • python
  • react
  • react-19
  • react-router
  • s3
  • terraform-(iac)-**authentication:**-firebase-auth-(email/password-+-google-oauth)-**apis-&-data-sources:**-yfinance-(market-data)
  • typescript-**frameworks:**-fastapi
  • uv-(python-package-manager)
Share this project:

Updates