Building a Real RAG Pipeline for a Portfolio Site: Architecture and SDK Pitfalls

Reasonable-Lack-7701 · reddit · 2026-08-04

The author details the implementation of a genuine RAG (Retrieval-Augmented Generation) pipeline for a personal portfolio site, rather than a simple chatbot wrapper. The stack: chunking case studies and work history, embedding via OpenAI's text-embedding-3-small, storing in Neon Postgres with pgvector, retrieving via cosine distance, and passing citations as message annotations on the AI SDK's data stream to show exact sources in the UI.

Key Pitfall: The AI SDK core package and the embeddings provider drifted onto different versions of the same spec (EmbeddingModelV1 vs V4). This caused embeddings to fail silently with a type error pointing nowhere near the root cause. Pinning the provider version fixed it instantly.

The author's next step is moving off hosted embeddings/inference entirely to test local models on an old MacBook, asking the community for latency benchmarks between local pgvector and dedicated vector DBs like Qdrant or Weaviate.

Original post →

More from coding & agent

coding & agent channel →