← Back to Blog
July 8, 2026

How to Build a Bilingual Portfolio with pgvector and Next.js 15

Building a production-grade bilingual retrieval-augmented generation (RAG) interface poses significant formatting and semantic alignment challenges for RTL (Arabic) and LTR (English) layouts. We opted for PostgreSQL's pgvector extension as it integrates directly with our relational queries and avoids external API request latency.

The system architecture centers around Next.js 15 serving as the BFF (Backend for Frontend), communicating with a FastAPI RAG worker that executes hybrid keyword + cosine similarity vector lookups over local HNSW index tables.

A crucial takeaway from operating this stack is that deploying LLM applications without automated regression gates (testing Groundedness via LLM-as-a-Judge) is highly risky. Enforcing validation pipelines ensures reliable response outputs.