RAG

RAG Knowledge Base Tools: Build vs Buy, and How to Choose

Off-the-shelf knowledge base tools, managed RAG services or a custom build? A comparison by data sensitivity, permissions, quality control and total cost.

By Naeem Akhtar · 11 min read

01

The three tiers of RAG knowledge base tools

TierExamples of the typeStrengthLimit
SaaS knowledge assistantHosted 'chat with your docs' products and AI add-ons to wikis or help desksLive in days; no engineeringLimited control over retrieval, permissions and where data lives
Managed RAG serviceCloud-vendor knowledge bases, search services and vector databases with managed ingestionScalable infrastructure; you control configuration and promptsYou still assemble, tune and evaluate the pipeline
Custom buildYour own ingestion, chunking, retrieval, re-ranking and generation on pgvector, Pinecone, Weaviate or similarFull control of quality, security and integrationHighest upfront effort; you own operations
02

Seven criteria that actually separate the options

  1. Permissions — can retrieval respect per-user or per-tenant access, applied inside the search rather than after it? A filter bolted on after top-k retrieval can silently return nothing, or leak.
  2. Source coverage — does it ingest the formats and systems you actually have (PDFs with tables, Confluence, SharePoint, ticket history), and keep them fresh?
  3. Answer quality — citations, handling of 'I don't know', and behaviour on conflicting documents.
  4. Data location and retention — where embeddings and queries are stored, who can see them, and whether they're used for training.
  5. Integration — can the answers be embedded in your product, help desk or internal tools via API?
  6. Evaluation and observability — can you see retrieved passages, failures and costs per query?
  7. Exit cost — how hard is it to move your index and prompts if you change vendor?
03

When buying is the right call

If the corpus is public or low-sensitivity, access is the same for everyone, and the goal is employee or customer FAQ, a hosted tool is usually the right first step. Prove the value, learn which questions matter, then decide whether you've outgrown it.

04

When to build

Build when permissions are complex, data cannot leave your environment, answers must be tightly cited, retrieval must combine documents with structured data, or the knowledge base is a feature of your own product. Our write-ups on Enterprise RAG architecture and building production RAG with PostgreSQL and pgvector cover what to plan for. A common middle path is to start on a managed vector store and keep the ingestion and retrieval logic in your own code, so the pieces stay swappable. If you decide to build, see Enterprise RAG Architecture and our RAG knowledge systems service.

05

Feature comparison at a glance

CapabilitySaaS knowledge assistantManaged RAG serviceCustom build
Time to first answerDaysWeeksWeeks to months, depending on scope
Per-user / per-tenant permissionsBasic, often limited to connector-level syncConfigurable, but you wire it up and test itDesigned to your model, enforced inside the query
Source connectorsStrong for popular SaaS toolsGood for cloud storage and databasesAnything you can write an ingester for
Control of chunking and retrievalLittleModerateFull, including re-ranking and hybrid search
Citations to source passagesUsually yesUsually yesYes, designed to your standard
Combining documents with structured dataRarelyPossible with effortNatural fit
Data residency and isolationVendor's choiceYour cloud account and regionFully yours
Evaluation and observabilityVendor dashboardsSome tooling; you extend itWhatever you build, so build it
Ongoing engineering effortLowMediumHighest
Switching cost laterMedium to highMediumLow if components stay swappable
06

What a custom RAG pipeline is made of

If you build, it helps to treat the pipeline as stages, each with its own failure modes and its own tests. Most 'the AI got it wrong' reports trace back to ingestion or retrieval, not the language model.

StageTypical choicesCommon pitfall
IngestionParsers for PDF, Office, HTML, tickets; connectors with change detectionTables, headers and scanned pages lost or garbled during parsing
ChunkingStructure-aware splits with overlap and metadataFixed-size chunks that cut answers in half or drop the section title
Embedding and indexingEmbedding model plus a vector index (pgvector, Pinecone, Weaviate and others)Re-embedding costs and index drift when the model changes
RetrievalHybrid keyword + vector search with metadata and permission filtersFilters applied after top-k, so allowed documents never surface
Re-rankingCross-encoder or LLM-based re-ranker on the top candidatesSkipped to save latency, then answers cite the wrong passage
GenerationPrompt with retrieved passages, citation format and refusal rulesNo instruction to say 'I don't know' when evidence is missing
Evaluation and monitoringFixed question set, retrieval and answer scoring, live feedbackJudged only by demos; regressions go unnoticed
07

Choosing a vector store

The vector database is often the least important decision, but it affects operations and cost. A few honest rules of thumb:

OptionStrengthsConsider when
pgvector (PostgreSQL)One database for relational data, permissions and vectors; transactional; familiar operationsYou already run Postgres and want permission filters and joins in the same query
PineconeManaged, scales without index tuningYou want minimal operations and accept an additional managed service
Weaviate / Qdrant / MilvusRich vector features, self-hostable or managedYou need advanced hybrid search or want to host it yourself
OpenSearch / ElasticsearchMature keyword search plus vector supportKeyword relevance matters and you already operate the cluster
Cloud-vendor knowledge basesIntegrated with the vendor's models and storageYou are committed to that cloud and want managed ingestion

For a deeper look at the Postgres route, see our guide to building a production RAG system with PostgreSQL and pgvector.

08

Where the cost comes from

Cost lineSaaSManaged serviceCustom
Licences / seatsMain costNone or smallNone
Model and embedding usageBundled or cappedPay as you goPay as you go; you control model choice
Vector storage and searchBundledPay as you goHosting or managed service fee
Ingestion and re-indexingBundledPipeline and compute costsPipeline you build and run
Engineering and maintenanceLowMediumHighest, but it buys control
Evaluation and monitoringLimitedMostly yoursFully yours

Treat these as categories to price at your own volume, not as quotes. Vendor pricing changes often, and the cheapest option at demo scale is frequently not the cheapest at production scale.

09

A quick decision guide

If this describes youLean toward
Public or low-sensitivity content, uniform access, need results fastSaaS knowledge assistant
Content lives in one cloud, moderate permissions, you have some engineering capacityManaged RAG service
Per-user or per-tenant access, regulated data, strict citation needsCustom build
Knowledge search is a feature customers use inside your productCustom build on a managed vector store
Unsure and want to learn firstStart hosted or managed, keep ingestion and prompts portable
10

What an evaluation set looks like

A small, honest evaluation set is the single most useful asset in any RAG project. It lets you compare vendors, tune retrieval and catch regressions. Aim for real questions from real users, including ones the corpus cannot answer.

Evaluation set entry (illustrative)
{
  "id": "q_017",
  "question": "What is the notice period for terminating the master services agreement?",
  "expected_sources": ["MSA_v3.pdf#section-14.2"],
  "expected_answer_contains": ["60 days", "written notice"],
  "user_role": "legal_ops",
  "must_not_cite": ["MSA_v1_superseded.pdf"],
  "answerable": true
}
ScoreWhat to check
RetrievalDid the expected passage appear in the retrieved set, and how high?
Answer correctnessDoes the answer match the expected facts without adding unsupported claims?
Citation accuracyDoes each cited source actually support the statement?
Refusal behaviourDoes it decline to answer when the corpus has no evidence?
Permission safetyDoes a user without access get nothing from restricted documents?
11

How to compare tools in a week

  1. Collect 30–50 real questions from the people who will use it, with the expected source document for each.
  2. Load the same representative document set into each candidate.
  3. Score answers for correctness, citation accuracy and appropriate refusals; include questions the corpus cannot answer.
  4. Test permissions with at least two users who should see different results.
  5. Estimate monthly cost at your expected query volume, including ingestion and upkeep.

Watch for

A demo on clean, single-topic documents tells you almost nothing. Test on your messiest real files — scanned PDFs, tables, outdated duplicates — because that's where retrieval fails.
12

Frequently asked questions

What is a RAG knowledge base tool?

It is software that indexes your documents and data and uses retrieval-augmented generation to answer questions from them, with citations to the source passages. Options range from hosted assistants to managed cloud services to custom-built systems.

Should we build or buy a RAG knowledge base?

Buy or use a managed service when content is low-sensitivity, access is uniform and you want fast results. Build when you have complex permissions, strict data-residency needs, structured-data integration or the system is part of your product.

How do I check that a RAG tool respects document permissions?

Test it with at least two users who should see different documents, and ask questions whose answers exist only in restricted content. Confirm the access filter is applied during retrieval, not after the results are returned.

What does it cost to run a RAG knowledge base?

Costs include licences or API usage, vector storage, ingestion and re-indexing, evaluation, monitoring and the engineering time to maintain it. Compare options at your expected query volume, not at demo scale.

Is pgvector good enough for a production RAG knowledge base?

For many workloads, yes. It keeps vectors, permissions and relational data in one database, which makes permission-aware retrieval simpler. Very large corpora or high query volumes may call for a dedicated vector service, so test at your expected scale.

How big should a RAG evaluation set be?

Start with 30 to 50 real questions covering your main use cases, including some the documents cannot answer, then grow it as you find failures. Quality and realism matter more than raw size.

Can a RAG knowledge base combine documents and database records?

Yes, but it usually takes a custom or heavily configured build. Structured data is typically queried through validated tools or SQL, while documents are retrieved through the vector index, and the answer cites both.

In production

See this in production