Skip to main content

Build vs. Buy: Why a Custom RAG System

Status of this page

This is the project team's own design reasoning, written during a graduation project. It is not a market study and it does not rate named vendor products: earlier versions carried a vendor-by-vendor scoring matrix, which has been removed because those claims could not be verified from the repository.

A short decision brief for two readers: the business sponsor asking "could this have been bought?" and the technical evaluator asking "what did a custom build have to provide?"

Summary​

The pilot needs depth in one narrow, safety-critical domain: Dutch-language hospital navigation, where a wrong answer is a patient-safety and regulatory concern rather than a poor search result. Three requirements drove the decision to build the cognition and safety layer:

  1. Citation-grounded answers and refusal of medical-advice questions as a structural property of the pipeline.
  2. Dutch medical terminology resolution (patient wording to clinical terms) using SNOMED CT.
  3. Auditability for the EU AI Act and GDPR designed in from the start (see AI Act compliance and the DPIA).

The project did not carry out a formal procurement evaluation of commercial products, so it makes no claim about what any specific product can or cannot do. The decision rests on the fit of the requirements above.

Scope

"Build" here means the cognition and safety layer. The pilot still buys commodity components: embeddings (OpenAI), speech-to-text (Deepgram) and text-to-speech (ElevenLabs). The build-vs-buy line is drawn at the layer that decides what the system may say, not at the infrastructure beneath it.

Reasons for building the core layer​

  1. Safety is a pipeline stage, not a relevance setting. A search system ranks documents; the pilot also has to recognise that a query asks for medical advice and refuse it with a link to a validated brochure. The pilot implements this as layered checks (see triple-defense). The June 2026 dose incident showed that this layer needs constant scrutiny, which is a reason to own it.

  2. Grounding must be able to say "I don't know." A system that always returns the best-matching passage, even when nothing matches well, is unsuitable here. Refusing when the corpus does not support an answer is a control-flow property of the generation step.

  3. Dutch clinical terminology is more than multilingual support. Resolving "suikerziekte" to Diabetes Mellitus and routing to Endocrinologie requires a medical terminology layer, here SNOMED CT (integration touchpoints).

  4. The durable asset is curated data. The operator-reviewed, SNOMED-mapped taxonomy of hospital entities is built through an extraction, review and publish lifecycle. See Competitive Advantage for the project's reasoning.

  5. Compliance obligations apply to the application. EU AI Act and GDPR obligations (audit trail, human review of navigational relationships, source explainability) attach to the deployed application, not only to the platform it runs on. Designing these in is easier than retrofitting them.

Cost and risk​

At pilot scale, running cost is small either way; the decisive axes are risk and fit.

DimensionBuying a general productBuilding the core layer
Patient-safety riskDepends on what the product offers; the project did not evaluate thisRefusal and post-generation safety checks are explicit pipeline stages, tested by the project's own suites (self-reported)
Regulatory fitApplication-level obligations still need to be metDPIA and AI Act analysis written for this application
Dutch medical qualityNot evaluated by the projectSNOMED-anchored; see the self-reported evaluation pages
Vendor dependenceTypically higherPostgreSQL, pgvector and open formats keep the data portable
EffortFaster to a first demonstrationHigher build and operating effort

The honest counter-argument: buying is faster to a first demo and removes the burden of running a stack. For a breadth problem (searching any intranet), buying is the natural choice. For this depth-and-safety problem the project judged building the core layer to be the lower-risk path; that is a judgement, not a measured result.

Where to read more​