When building BazzarBD , an AI voice-commerce platform powered by Pipecat WebRTC and Gemini Live API, we hit a classic architecture decision: should we store product embeddings in our transactional MongoDB database, or split search into PostgreSQL with pgvector ?
The Problem with Single-Database AI Search
Standard keyword search breaks down when shoppers speak naturally ("show me a lightweight cotton panjabi under 2000 taka"). At the same time, running heavy 1536-dimensional vector similarity scans inside the same primary store that handles live carts and inventory updates creates latency spikes during checkout.
Our Dual-Database Architecture
MongoDB (Transactional Commerce Layer) : Stores flexible product attributes, cart state, customer sessions, and order writes with low-latency document updates.
PostgreSQL + pgvector (Semantic Retrieval Layer) : Indexes 1536-dimensional embeddings for fast cosine similarity search across natural-language and mixed-language queries.
Node.js + Express + TypeScript…