Stock Co-Pilot

Stock Co-Pilot

An AI co-pilot, not an autopilot.

A trading workbench where the human decides and the model does the homework.

Stock Co-Pilot is an AI-native research tool built for active traders. Two client surfaces — a SwiftUI iOS app and a React PWA — sit on top of a single routing layer that turns natural-language questions into structured work, dispatches them to eight specialist services, and hands back validated, cache-aware answers. The model never touches the trade button.

01The problem

Most retail trading tools fall into two camps. On one side, there are brokerage apps that give you a big green button and a confetti animation. On the other, there are professional terminals that cost thousands a month and assume you already know what a Stochastic crossover is. Neither is built for the growing population of self-directed traders who are serious about learning but don’t have a Bloomberg terminal budget.

The AI wave made it worse before it made it better. Chatbots started offering stock tips with no attribution, no methodology, and no guardrails. A trader would ask a question and get a confident-sounding paragraph that they couldn’t verify, couldn’t trace back to data, and couldn’t act on safely.

I wanted to build the opposite: a tool where every answer is grounded in real data, every recommendation shows its reasoning, and the user stays in control of every decision. A co-pilot that does the analysis legwork, not an autopilot that pretends to know the future.

02The product

The web workbench is the primary surface — a React PWA with screening, charting, strategy bots, portfolio sync, and a persistent AI copilot sidebar. The iOS app focuses on daily briefings, watchlists, and push alerts for traders on the move.

03Architecture

The system is four layers deep: client surfaces ask questions, the AI router classifies intent and picks the right specialist, eight specialist services do the actual work, and the data layer keeps the system honest with live market feeds and durable storage.

Stock Co-Pilot full system architecture
Figure 1 — The full system: surfaces ask, the brain routes, specialists answer, the world keeps it honest.
AI Router
A single GPT-4o entry point classifies intent, hydrates context (stock, portfolio, page), and dispatches to the right specialist. Every response is schema-validated before leaving the server.
8 Specialists
From single-stock reads and chart pattern recognition to paper trading bots and a multi-source news pipeline. Each specialist owns its domain and its cache layer.
Five-Tier Cache
In-tab memory, client LRU, per-user storage, function-level 1–24h cache, and overnight batch jobs. Most analysis requests are pre-paid by the time the user taps “Analyse.”
Clean Perimeter
Every external dependency — TwelveData, SnapTrade, Stripe, OpenAI — sits behind a Cloud Function. No client ever holds an API key.
How a question becomes an answer
The askThe client packages the message with what’s already on screen and posts it to one callable.getAIResponse
The triageA small classifier picks the right specialist. Auth and rate limits are checked at the door.queryRouter
The searchThe specialist parses criteria, resolves a universe, and scans pre-computed indicators.parseCriteria
The rankingMatches are scored against intent, enriched with prices and patterns, and sorted.runWorkshopRoutine
The handoffA schema-validated payload comes back. The chart panel hydrates, already cached.{ results, feedback }
The stack, at a glance
ClientsSwiftUI + React 18Native iOS plus an installable web PWA on Vite + Tailwind.
BackendCloud Functions~85 Node functions: callable handlers, scheduled jobs, Firestore triggers.
DataFirestore + StorageDocument store for state, blob store for audio and exports.
AuthFirebase AuthGoogle, Apple, email — verified at every callable boundary.
InferenceOpenAI GPT-4oGPT-4o for analysis and chat, mini for cheap intent + sentiment work.
Market DataTwelveData ProUp to 120 symbols per call; nightly batches at 04:00 ET.
BrokerageSnapTradeOAuth-based read-only account sync for connected portfolios.
BillingStripeSubscriptions, trials, signed webhooks driving tier mutations.
04Product decisions I’d defend

Natural language is the API.

A trader can ask anything in plain English and it flows through one router. Intent classification happens once and gets reused across every surface — chat, screener, briefing, bots.

The model never touches the user.

Every call to OpenAI happens server-side, behind auth and a rate limiter. Clients hold no keys. Schemas are validated on the way out, so a hallucinated shape never crosses the wire.

Cache is a first-class citizen.

Five tiers of caching sit between the user and the cost of fresh inference. By the time you tap “analyse,” there’s a good chance someone already paid for the answer.

05What’s next

The next iteration moves the workshop from screen-and-pick to screen-then-improvise — the same router, but with mid-run branching, so the co-pilot can change its mind alongside you when the tape turns.

Scroll to Top