Financial Research Copilot
A full-stack RAG assistant that answers plain-English questions about public companies with citation-backed answers from SEC filings and live market data.
The problem
Researching a public company means juggling hundred-page SEC filings, live market data, and analyst commentary across a dozen tabs. General AI chatbots hallucinate financial figures and can't cite where an answer came from. The Copilot answers plain-English questions with verifiable, citation-backed responses grounded in primary sources.
Architecture
- Frontend
- React + TypeScript + Vite + Tailwind
- Backend
- FastAPI (Python) — query, ingest, market, news routes
- Retrieval
- LangChain over ChromaDB vector store
- Data
- SEC EDGAR (10-K/10-Q + XBRL) · Yahoo Finance
- Storage & Auth
- Supabase / PostgreSQL with Row-Level Security
- AI
- OpenAI embeddings + LLM
- Infra
- Docker + docker-compose
Key engineering decisions
Two-path query router
Every question is classified as live (price, news, TTM, analyst ratings) or filing-based (risk factors, strategy, balance-sheet detail). Live questions bypass the vector store and answer straight from market data — cutting latency and, more importantly, eliminating stale-filing hallucinations on time-sensitive questions.
Parallel 10-K + 10-Q ingestion
On first ask, both the annual (10-K) and quarterly (10-Q) filings are fetched in parallel from SEC EDGAR, chunked, embedded with OpenAI, and stored in ChromaDB. 10-Q chunks are prioritized as more recent, and staleness detection flags when a newer filing is published.
Multi-tenant data isolation
Role-based auth via Supabase, JWT verification in FastAPI, and PostgreSQL Row-Level Security keep each user's data scoped and private. An admin approval gate and per-user token budget ledger control cost and access.
Citations, always
Every answer ships with a Sources panel linking back to the exact filing or data source it drew from — so the output is auditable rather than a black box.