Skip to content

Learn AI · Guides

RAG Stack Under $100/mo

A production-capable retrieval stack for startups and side projects — ingestion, embeddings, vector store, LLM, and observability without enterprise bills.

8 min readPublished Jun 2026Updated Jun 2026
StackRAGBudgetStartup
Edited by The AIKnowHub team · Editorial team

Key takeaways

  • 1pgvector on existing Postgres beats a separate vector DB under 1M chunks.
  • 2Embedding cost is negligible — generation and bad retrieval dominate bills.
  • 3Firecrawl saves weeks vs custom Playwright scrapers for web docs.
  • 4Hybrid search (BM25 + vectors) is worth it when keyword match matters.
  • 5Ship the docs chatbot workflow before buying Pinecone.

The stack

LayerToolMonthly cost
IngestionFirecrawl or markdown/git$0-30
ChunkingPython script or LlamaIndex loader$0
EmbeddingsOpenAI text-embedding-3-small$5-15
Vector storeSupabase pgvector (free tier)$0
LLMClaude Haiku retrieve+answer, Sonnet for hard queries$40-60
ObservabilityLangfuse self-host$0
HostingVercel / Fly.io free tier$0
Total$45-90/mo

Layer 1 — Ingestion

Web docs: Firecrawl URL to markdown. Schedule weekly re-crawl for stale pages.

Git/markdown repo: Direct chunk from files — no crawl needed.

PDFs: pymupdf or unstructured.io locally.

Chunking Strategies

Layer 2 — Embeddings

Default: text-embedding-3-small at 1536 dimensions.

Cost math: 1,200 doc pages at ~500 tokens/chunk, 3 chunks/page = 1.8M tokens. One-time embed under $0.50. Re-embed on change only.

Layer 3 — pgvector on Supabase

create extension vector;
create table chunks (
  id bigserial primary key,
  content text,
  embedding vector(1536),
  metadata jsonb
);
create index on chunks using hnsw (embedding vector_cosine_ops);

Store source_url, title, section in metadata for citations.

Upgrade to Qdrant or Pinecone when evals show retrieval latency problems at scale.

Layer 4 — Retrieval + generation

query
  → embed query
  → top-k similarity (k=8)
  → optional rerank (Cohere rerank or LLM pick top 3)
  → prompt with chunks + cite instructions
  → Haiku for default, Sonnet if confidence low

Reranking and Hybrid Search

Layer 5 — Observability

Log every query in Langfuse:

  • Retrieved chunk IDs
  • Answer latency
  • User thumbs down (feeds eval set)

The RAG docs case study hit $180/mo at production traffic — still under $100 for MVP volumes.

Cost control levers

  1. Cache embeddings — never re-embed unchanged docs
  2. Haiku default — Sonnet only on escalation
  3. Smaller k — start k=5, increase only if evals fail
  4. Query routing — FAQ keyword match before vector search

LLM Cost Optimization

Build path

Follow Build an AI Docs Chatbot — it maps directly to this stack.

Upgrade path

SignalUpgrade
Retrieval p95 above 200msQdrant or dedicated vector DB
Stale web docsFirecrawl scheduled + diff re-index
Wrong answers persistHybrid search + reranker
Multi-tenantPer-tenant namespaces in metadata

Common misconceptions

The wrong-but-common takes worth correcting.

Myth

RAG requires Pinecone or Weaviate.

Reality

pgvector handles most MVP and early production loads. Migrate when filtering latency or scale demands it.

Myth

Bigger embeddings always help.

Reality

text-embedding-3-small at 1536 dims is the 2026 default. Upgrade dimensions only with eval evidence.

Real-world use cases

Frequently asked questions

When p95 retrieval latency exceeds your SLA above ~500k-1M vectors, or you need advanced hybrid filtering at scale. [Qdrant](/directory/qdrant) is the common next step.