Inspiration

We wanted a simple, fast way to ask questions about S&P 500 data and documents like an analyst would combining chat, file context, and SQL-backed retrieval without wrangling dashboards or notebooks.

What it does

Chat UI with ChatGPT-like UX (expanding textarea, typing indicator, user/assistant bubbles) File-aware Q&A: upload PDFs/images/HTML and ask questions referencing them (OCR for images) Session history with summaries, message/doc counts, and quick delete FastAPI backend with endpoints for chat, history, and session docs Pluggable LLMs (Gemini/OpenAI) and TiDB/MySQL for persistence Deployed frontend (Vercel) + backend (EC2/Vercel), with graceful fallbacks

How we built it

Frontend: React + Vite + Tailwind, Vite dev proxy, environment-driven API base URL, custom events for Menu↔Chat coordination Backend: FastAPI with CORS, multipart uploads, robust error handling; session/message/doc models via PyMySQL/SQLAlchemy; OCR via PyMuPDF + pytesseract Data: TiDB/MySQL with TLS; SQL utilities and session-aware retrieval, Build Data Pipeline to extract data from wikipedia, APIs, y finance Infra: Vercel for frontend, EC2 (uvicorn/systemd) for backend; optional serverless via Mangum

Challenges we ran into

CORS and environment switching (dev vs prod) across Vercel/EC2 TLS to TiDB Serverless and CA management Dependency bloat (removed unused ML libs; kept OCR/core packages) Aligning database schema vs queries (missing columns/tables, fallbacks) Stable process management on EC2 (PM2 vs systemd, pinned Pydantic/FastAPI versions)

Accomplishments that we're proud of

Clean, resilient API with graceful error paths (no 500s for missing config) Smooth chat experience with session selection, history, and document chips File ingestion with OCR and PDF parsing that “just works” Clear docs (README/CONTRIBUTING/SETUP) and a tidy client/server split

What we learned

Keep production configs explicit: API base URLs, CORS origins, and vercel rewrites Start minimal on dependencies; add only what’s truly used Systemd is often simpler and more predictable than PM2 for Python services Defensive SQL and schema fallbacks dramatically reduce breakage during integration

What's next for BlueJayAI

Add RAG with embeddings + hybrid search over uploads and curated corpora Session summarization and pinning key insights Role-based auth and multi-tenant workspaces Analytics: query tracing, latency metrics, and observability One-click deploy templates (Docker + Terraform) for repeatable infra

Built With

Share this project:

Updates