| Feature | Description |
|---|---|
| β‘ Low-Latency Chat | Streaming responses with real-time market context & source transparency |
| π Smart Portfolio | Live P&L tracking, health scores, sentiment analysis & buy/hold/sell signals |
| π Market Intelligence | Real-time quotes, technical analysis, fundamentals & synthesized news |
| ποΈ AI Transparency | Execution phases, source tracking, deduplication & live activity monitor |
| π Daily Briefs | Automated portfolio summaries & market pulse reports (Vercel Cron) |
| π Enterprise Security | RLS-enforced Supabase auth, environment-isolated credentials |
| π― Multi-Turn Intelligence | Coreference resolution for "that/it" queries, follow-up grounding |
| π± Responsive UI | Mobile-first design with Tailwind CSS, Framer Motion, native OS body fonts, and Fraunces headings |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLIENT (Next.js + React 19) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β’ Chat UI (streaming responses) β
β β’ Portfolio Dashboard (real-time P&L) β
β β’ Watchlist Monitor (price tracking) β
β β’ Settings & Profile Management β
β β’ State: Zustand (persistent client state) β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API LAYER (Next.js Route Handlers) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β /api/chat ......................... Streaming AI responses β
β /api/portfolio/* .................. Holdings management β
β /api/portfolio/intelligence ........ AI insights & signals β
β /api/watchlist .................... Price monitoring β
β /api/conversations/* .............. Chat history β
β /api/stock/* ...................... Market data β
β /api/daily-brief .................. Report generation β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SERVICES LAYER β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β’ Mistral AI (LLM, Embeddings) β
β β’ Supabase (Auth, Postgres, RLS) β
β β’ Yahoo Finance (Quotes, History, Search) β
β β’ MarketAux & NewsData (News Synthesis) β
β β’ Vercel Cron (Scheduled Briefs) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Next.js 16 App Router, React 19, TypeScript | Fast, type-safe UI with streaming support |
| Styling | Tailwind CSS, Framer Motion, native font stack, Fraunces serif | Premium responsive design, typography & animations |
| State Management | Zustand | Lightweight, persistent client state |
| Backend | Next.js Route Handlers | Serverless API functions |
| Database | Supabase (PostgreSQL) | RLS-enforced data isolation |
| Auth | Supabase Auth (PKCE OAuth) | Secure passwordless & email flows |
| LLM | Mistral (Large, Small) | Context-aware AI responses & embeddings |
| Market Data | Yahoo Finance API | Real-time quotes & historical data |
| News | MarketAux, NewsData, Yahoo RSS | Multi-source news aggregation |
| Deployment | Vercel | Serverless, edge-optimized hosting |
alphasight-ai/
βββ src/
β βββ app/
β β βββ (app)/ # Protected routes (authenticated)
β β β βββ chat/[id]/ # Chat conversation page
β β β βββ portfolio/ # Portfolio dashboard
β β β βββ watchlist/ # Watchlist monitor
β β β βββ daily-brief/ # Daily report
β β β βββ settings/ # User preferences
β β β βββ profile/ # Profile management
β β βββ api/ # Route handlers
β β β βββ chat/ # AI streaming
β β β βββ portfolio/ # Holdings CRUD
β β β βββ conversations/ # Chat history
β β β βββ watchlist/ # Monitoring
β β β βββ stock/ # Market data
β β βββ auth/ # Auth pages (login, signup)
β β βββ login/ # Login page
β β βββ signup/ # Signup page
β βββ components/
β β βββ chat/ # Chat UI components
β β βββ portfolio/ # Portfolio cards
β β βββ common/ # Reusable UI elements
β β βββ layout/ # Navigation & layout
β βββ lib/
β β βββ ai/ # Mistral integration & prompts
β β βββ stock/ # Market data utilities
β β βββ supabase/ # DB helpers & RLS
β β βββ hooks/ # Custom React hooks
β β βββ utils/ # Helper functions
β β βββ __tests__/ # Unit tests
β βββ stores/ # Zustand state management
β βββ types/ # Shared TypeScript types
β βββ middleware.ts # Auth middleware
βββ supabase/
β βββ schema.sql # Database schema with RLS
βββ public/ # Static assets
βββ logos/ # Brand assets
βββ package.json # Dependencies & scripts
Queries like "tell me about ITC" β "tell me about that" are resolved to standalone intent before routing, enabling natural multi-turn conversations.
Query rewrite path improves retrieval quality and reduces literal bad searches, ensuring every search is contextually relevant.
- Real-time execution phases (Searching... β Analyzing... β Finalizing...)
- Live source tracking with dedupe & domain-only filtering
- Smooth state transitions for optimal UX and clearer AI progress feedback
Prompts enforce use of available search/context instead of "not in training data" responses, keeping all answers grounded in live data.
Theme, chart/news visibility, and notification toggles apply instantly to UI without page reloads, with full light-mode token support across settings, profile, portfolio, and brief screens.
- Structured key/value memory for explicit facts (risk profile, preferences)
- pgvector embeddings for semantic facts ("prefers dividend stocks")
- Top-K retrieval with similarity thresholding
- Auto-extraction & deduplication on every chat turn
- Node.js 18+ or 20+
- npm or yarn
- Supabase project (free tier available)
- Mistral API key
git clone https://github.com/Eshwar02/bearbot.git
cd bearbot
npm installCreate .env.local:
# Supabase (required)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
NEXT_PUBLIC_APP_URL=http://localhost:3000
# AI Provider (required)
MISTRAL_API_KEY=your-mistral-key
# News Providers (optional, but recommended)
MARKETAUX_API_KEY=your-marketaux-key
NEWSDATA_API_KEY=your-newsdata-key
# Optional: Scheduled report auth
CRON_SECRET=your-cron-secret# Supabase CLI (optional but recommended)
supabase start
# Or manually: run supabase/schema.sql in your Supabase SQL editornpm run devOpen http://localhost:3000 and sign up.
npm run build
npm run startDeploy to Vercel:
vercel deploy| Command | Purpose |
|---|---|
npm run dev |
Start dev server with Turbopack |
npm run build |
Optimized production build |
npm run start |
Run production build locally |
npm run lint |
ESLint checks with flat config |
npm test |
Run Jest tests (single-run) |
npm run test:watch |
Jest in watch mode |
npm run test:coverage |
Coverage report |
| Endpoint | Method | Purpose | Auth |
|---|---|---|---|
/api/chat |
POST |
Stream AI response with market context | Required |
/api/conversations |
GET, POST |
List or create chat conversations | Required |
/api/conversations/[id] |
GET, DELETE |
Fetch or delete conversation | Required |
/api/conversations/[id]/messages |
GET |
Paginated message history | Required |
| Endpoint | Method | Purpose | Auth |
|---|---|---|---|
/api/portfolio |
GET, POST |
List holdings or add new position | Required |
/api/portfolio/[id] |
PUT, DELETE |
Update or remove holding | Required |
/api/portfolio/intelligence |
GET |
AI health score, sentiment, signals | Required |
| Endpoint | Method | Purpose | Auth |
|---|---|---|---|
/api/stock/quote |
GET |
Real-time stock quote | Optional |
/api/stock/search |
GET |
Symbol/company search | Optional |
| Endpoint | Method | Purpose | Auth |
|---|---|---|---|
/api/watchlist |
GET, POST, DELETE |
Manage watchlist | Required |
/api/daily-brief |
GET, POST |
Fetch or generate daily brief | Required |
- β Memory Capture Improvements - Enhanced semantic extraction & reliability
- β Chat Intelligence Refinements - Coreference resolution, multi-turn grounding, and AI-generated chat titles
- β Typography Refresh - Native OS body font stack with Fraunces serif headlines
- β Transparency Monitor - Phase tracking, source deduplication, and clearer progress UI
- β Light Mode Support - CSS variable tokens across settings, profile, portfolio, and brief screens
- β Live Settings - Instant theme, chart, and notification toggles
- β Auth Redirects - Canonical domain support
- β Password Reset - Supabase forgot-password flow
- β Profile Management - Email verification & password updates
15750ed - feat(ui): use native OS font stack for body, drop Geist sans webfont
340551f - fix: light mode tokens for settings, profile, error, portfolio-summary, add-holding-modal, schedule-settings
e276001 - feat(ui): swap to Fraunces serif and fix sidebar quick-access active state
0898afe - feat(chat): AI-generated chat titles with typewriter animation + new typography
37c03ef - feat: full light mode support with CSS variable tokens
We welcome contributions! Here's how to get started:
# Click "Fork" on GitHub
git clone https://github.com/YOUR_USERNAME/bearbot.git
cd bearbotgit checkout -b feature/your-feature-name- Follow ESLint rules:
npm run lint - Write tests if applicable
- Keep commits atomic and descriptive
git commit -m "feat: add your feature description"
git push origin feature/your-feature-name- Describe what your PR does
- Reference any related issues
- Request review from maintainers
- RLS Enforced: All database queries use Row-Level Security
- Auth Tokens: Supabase PKCE OAuth flow, no password stored
- API Keys: Environment-isolated via
.env.local - User Data: Scoped to authenticated user (auth.uid())
- No Hallucinations: All AI responses grounded in live market data
- Streaming Chat: Low-latency responses with text-first UI
- Edge Functions: Vercel serverless scaling
- Database: Supabase PostgreSQL with connection pooling
- Caching: Optimized quote & history caching
- Bundling: Turbopack for 5-10x faster builds
- π Report Bugs: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π§ Email: support@alphasight.ai
This project is licensed under the MIT License. See LICENSE for details.
- Mistral AI - LLM & embedding provider
- Supabase - Database & auth backend
- Vercel - Deployment infrastructure
- Next.js & React - Core framework & library
- Community Contributors - All developers who contributed to this project
β If you find this useful, please give us a star on GitHub