Resources / Architecture decisions

Fine-Tuning (LoRA) vs. RAG vs. Knowledge Graphs

Fine-tuning a model to memorize company facts is a common and costly mistake: the weights go stale, can’t cite a source and can’t enforce access rights. Knowing which layer solves which problem avoids rewrites.

Decision matrix

ApproachBest forRisksAudit and updates
Structured prompting + schemasClassification, extraction into JSON contracts, formatting, triage.No private knowledge beyond the prompt; behavior shifts across model upgrades.Easy to version; pair with validation and regression tests.
LoRA / QLoRA fine-tuningConsistent tone, strict schema adherence on small local models, tasks with thousands of labeled examples.Bakes facts into weights; memorization and forgetting; no per-user access control.Retraining to update or delete data; weak provenance.
Vector or hybrid RAGSearching prose such as policies, manuals and reports, with passage citations.Weak on multi-hop joins, counts, conflicting versions and inconsistent terms.Good passage traceability with metadata filters and access checks.
Knowledge graph (OWL 2, RDF, SHACL)Authoritative entities, cross-system lineage, explicit definitions and constraints.Needs upfront modeling and schema governance.Strongest audit trail: named-graph provenance, SHACL gates, open W3C standards.

Most systems combine layers

A durable design keeps authoritative entities and constraints in an RDF/OWL graph (or maps existing SQL with R2RML), indexes supporting prose for hybrid retrieval, routes model calls through a gateway such as LiteLLM or local serving with Ollama or vLLM, and uses LoRA only to teach small local models your output format.

Avoid lock-in

With your data in open W3C standards and model calls behind an OpenAI-compatible gateway, moving from a hosted model to a local open-weights one becomes a configuration test, not a rebuild. Federal acquisition guidance points the same way; see the OMB M-25-21 and M-25-22 guide.

Next step

If your team is debating fine-tuning, a bigger vector database or a knowledge graph, start with a $2,000 Technical Decision Assessment on that one decision, or read the SQL vs RDF worked example.

Send a non-sensitive summary; protected exchange comes before internal documents.