Prompt
I'm building a RAG app for a mid-size company. Should I use a vector DB or search engine?
Latest observation
For a mid-size company building a RAG app, the default choice is often:
Use a search engine if your knowledge is mostly text and you need strong keyword/metadata filtering.
Use a vector DB if semantic similarity is the core requirement and you want the simplest path to embedding-based retrieval.
In many real RAG systems, the best answer is actually a hybrid search engine + vector retrieval setup.
Quick rule of thumb
Choose a search engine if you need:
- Great keyword/BM25 search
- Faceted filtering on metadata like department, date, product, access level
- Fast indexing and mature operations
- Logs, docs, tickets, web pages, PDFs, knowledge base content
- Search that users can understand and debug
Examples: Elasticsearch, OpenSearch, Solr, Azure Cognitive Search
Choose a vector DB if you need:
- Semantic retrieval over chunks of text
- Simpler setup for embeddings + ANN search
- High recall on vague/approximate queries
- Dedicated vector workflows and similarity search APIs
Examples: Pinecone, Weaviate, Milvus, pgvector, Qdrant
What matters most for RAG
For RAG, retrieval quality is usually driven by:
- Chunking strategy
- Embedding model quality
- Hybrid retrieval
- Filtering and reranking
- Evaluation
The storage layer matters, but it’s not the whole game.
Practical recommendation for a mid-size company
If this is your first RAG app:
Start with a search engine that supports vectors or Postgres + pgvector if the scale is modest.
Why:
- Easier operationally
- Easier to combine keyword + vector retrieval
- Lower vendor sprawl
- Good enough for many mid-size use cases
If your corpus is large or retrieval is central:
Use a search engine for lexical + metadata filtering and add vector/hybrid support.
Why:
- Users often search with exact terms, names, IDs, product codes
- Semantic-only search misses these
- Hybrid tends to outperform pure vector search on enterprise content
If you expect heavy semantic workloads and less metadata complexity:
A dedicated vector DB can be a clean choice.
Why:
- Simple model for embeddings
- Often easier to optimize ANN retrieval
- Good if search is mostly “find similar stuff”
My default recommendation
For a mid-size company RAG app:
Pick a search engine with vector/hybrid support unless you have a strong reason to go vector-native.
That gives you:
- Lexical search for precision
- Vector search for semantic matching
- Filters for enterprise constraints
- One system to operate
Decision guide
Use search engine first if:
- You already have Elasticsearch/OpenSearch/Azure Search
- You need enterprise search features
- You care about auditability and filter-heavy queries
- Your users will search with names, codes, acronyms, and exact phrases
Use vector DB first if:
- Your corpus is mostly unstructured text
- Queries are conversational and fuzzy
- You want a simpler semantic retrieval layer
- You don’t need advanced text search features
Important warning
A pure vector approach often disappoints in enterprise RAG because:
- Exact terms matter a lot
- Acronyms and product names are critical
- Metadata filters are essential
- Users need deterministic retrieval in some cases
A common best architecture
- Ingest docs
- Chunk text
- Store:
- raw/chunk text
- metadata
- embeddings
- Retrieve with:
- keyword search
- vector similarity
- metadata filters
- Rerank top results
- Generate answer with citations
Bottom line
- Small to mid-size, first RAG app: search engine with vector support, or Postgres + pgvector
- Semantic-first workload: vector DB
- Enterprise production RAG: hybrid search is usually best
If you want, I can also give you:
- a decision matrix by company size / scale / budget, or
- a recommended stack for AWS / Azure / GCP / open-source.