Combine a web crawler (or SerpAPI), embedding model, vector DB (pgvector), and streaming LLM for RAG-based search. Stack: Next.js 15 for frontend, Supabase (self-hosted) for pgvector, assisters.dev-compatible API for inference.
create extension vector; then create table docs (id uuid primary key, url text, chunk text, embedding vector(1536));.$50/mo) or self-host SearXNG on your VPS (free). Fetch top 10 results for query.query_id to group chunks.SELECT ... ORDER BY embedding <=> query_embedding LIMIT 8 to get top chunks.[1] as hoverable source link.| Tool | Best For | Price |
|---|---|---|
| Supabase + pgvector | Vector DB | Free tier |
| SerpAPI | Google results | $50+/mo |
| SearXNG | Self-hosted search | Free |
| Trafilatura | Content extraction | Free |
| Next.js | Streaming UI | Free |
Q: Do I need a separate vector DB like Pinecone? No — pgvector in self-hosted Supabase handles millions of vectors fine.
Q: Which embedding model?
OpenAI-compatible text-embedding-3-small via assisters.dev. 1536 dimensions.
Q: How do I handle follow-up questions? Keep session context; re-embed with conversation history as query.
Q: Can I search private docs instead of web? Yes — replace web crawl with doc upload + embed pipeline. That's RAG-over-docs.
Q: How fast should results be? First token in <2s. Full answer in <8s. Cache common queries.
Q: Is this better than Google? For synthesis, yes. For navigational queries, no. Position it as "research assistant."
AI search is the defining product category of the decade. Build a vertical search engine (legal docs, research papers, your company wiki) and you have a moat. Learn semantic search patterns before scaling.
Free newsletter
Join thousands of creators and builders. One email a week — practical AI tips, platform updates, and curated reads.
No spam · Unsubscribe anytime
Replace keyword search with semantic search using embeddings, pgvector, and hybrid BM25 + vector scoring — better result…
Build a searchable, chat-enabled knowledge base from your docs using RAG, pgvector, and a clean chat UI — for internal o…
Build a production retrieval-augmented generation app with pgvector, embeddings, and any OpenAI-compatible LLM. Covers c…
Comments
Sign in to join the conversation
No comments yet. Be the first to share your thoughts!