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.
More from coding & agent
- No Monaco Wrapper: A Brand-New Code Editor Engine Built from Scratch — aidenybai · 2026-08-04
- Google Paper: Financial AI Agents Excel at the Past, Fail at the Future — rohanpaul_ai · 2026-08-04
- Developer Shares Summary Diagram of AI Agent Harness Evolution — bingxu_ · 2026-08-04
- ChatGPT is Breaking Codebases: Devs Complain About Model Regression — wowa93 · 2026-08-04
- Quickly Turn Any Website into an API or MCP Server Using DevTools — dsp_ · 2026-08-04
- Anthropic Engineers Demo Multi-Agent Loops: Full App Built from Scratch in 40 Mins — mathemagie · 2026-08-04