Decoupled Architecture
The application is built using a modern, scalable, and decoupled architecture. The frontend is fully isolated from the heavy AI orchestration, communicating gracefully via a REST API.
Frontend
- Next.js 14 (App Router)
- React Server Components
- Tailwind CSS & Lucide Icons
- Vercel Edge Deployment
API Gateway
- Python 3 & FastAPI
- Uvicorn ASGI Server
- Hybrid RAG Orchestrator
- Serverless Execution ready
Infrastructure Layer (Dual Database)
Supabase elegantly fulfills the requirement of having both a Relational PostgreSQL Database and a Vector Database within the same unified engine. The relational side strictly manages **1,821 verified equity records** via the pgvector extension.
Relational PostgreSQL (3NF)
Architectural Note: While the current MVP securely ingests the raw CSV directly as a flat table for rapid prototyping, the target Production Schema (below) normalizes the structured data into the 3rd Normal Form (3NF) to eliminate data redundancy (e.g., Sector and Country mappings).
Vector Database (pgvector)
Unstructured PDF knowledge is chunked and stored in a mathematical vector space alongside the relational data.
OpenAI Models
gpt-4o-mini(Orchestration & Synthesis)text-embedding-3-small(Vectorization)