MA
MOSES ACOSTA
AI · Cloud · Leadership
← Back to Work
App · AI

SimpliInvest — AI-Powered Risk Scoring

A full-stack AI platform that analyzes stocks, ETFs, and crypto to produce instant risk scores using live data and multi-agent orchestration.

Next.jsFirebaseGenkitTypeScriptTailwind CSS

The Problem

Retail investors lack access to the sophisticated risk analysis tools available to institutional traders. Existing solutions are either prohibitively expensive, require deep financial expertise, or deliver results too slowly to be actionable.

The Approach

I designed SimpliInvest as a real-time AI platform that democratizes investment risk analysis. The core insight: combine multiple data sources with AI agent orchestration to produce institutional-grade analysis accessible to anyone.

Multi-Agent Architecture

Rather than a single monolithic prompt, the system uses a pipeline of specialized agents:

  1. Data Collection Agent — aggregates live pricing, fundamentals, news sentiment, and market indicators from multiple APIs
  2. Quantitative Analysis Agent — runs risk models across multiple timeframes (1D, 1W, 1M, 3M, 1Y)
  3. Scoring Agent — synthesizes quantitative and qualitative signals into a 1-100 risk score
  4. Explanation Agent — generates human-readable risk narratives that non-experts can understand

Technical Decisions

  • Google Genkit for AI orchestration — provides structured output schemas, streaming, and tool use out of the box
  • Firestore for real-time data sync — enables live score updates as new data arrives
  • Firebase App Hosting for zero-config deployment with automatic scaling
  • Zod schemas at every agent boundary — prevents LLM output drift and ensures type safety

Architecture

The application follows a serverless architecture deployed on Firebase:

  • Frontend: Next.js 15 App Router with server components for initial data loading and client components for real-time interactions
  • API Layer: Next.js API routes handling market data aggregation and AI agent orchestration
  • AI Pipeline: Genkit flows with structured I/O, retry logic, and fallback strategies
  • Data Layer: Firestore for user data and cached analysis, with in-memory caching for frequently accessed tickers
  • External APIs: Alpha Vantage, Financial Modeling Prep, and news sentiment APIs with rate limiting and circuit breakers

Outcomes

  • Sub-second risk scores for any publicly traded asset
  • Multi-asset coverage — stocks, ETFs, and cryptocurrencies
  • AI-generated explanations readable by non-technical investors
  • Zero-downtime deployments via Firebase App Hosting
  • Live at simpliinvest.app — serving real users daily

Key Learnings

Resilient data pipelines matter more than model sophistication. 40% of engineering effort went into handling API rate limits, inconsistent data formats, and source outages. The AI is only as good as the data feeding it.

Structured outputs are non-negotiable. Without Zod schemas enforcing output structure at every agent boundary, LLM-powered analysis drifts unpredictably. Type safety extends to AI outputs.

Ship early, iterate with real feedback. The MVP shipped in two weeks with a single risk model. User feedback drove the multi-timeframe analysis, explanation quality improvements, and crypto support.