RAG vs fine-tuning
Retrieve changing or private facts; tune when many task examples support improving behavior.
Match architecture to the job: rules, prompts, retrieval, tools, workflows, agents and fine-tuning.
| Pattern | Good for | Main constraint |
|---|---|---|
| Deterministic rules | Known logic, permissions, calculations | Weak at ambiguity |
| Prompt-only | Drafting or classification with supplied facts | Context and freshness limit |
| RAG | Current or private evidence | Retrieval and permission quality |
| Tool calling | Live reads or bounded actions | Scope, validation, audit |
| Fixed workflow | Predictable multi-step tasks | Less flexible paths |
| Agent | Variable multistep investigation | Higher variability, latency, testing burden |
| Fine-tuning | Recurring behavior/style improvements | Not for fresh facts or permissions |
Retrieve changing or private facts; tune when many task examples support improving behavior.
Choose fixed sequences for known routes; agent only when variable planning earns the cost.
| Layer | What to verify |
|---|---|
| Retrieval | Relevant source found, freshness, permission filtering, ranking and provenance |
| Model output | Groundedness, completeness, uncertainty handling, structured fields and safety |
| Tools/actions | Correct tool, valid arguments, approval, scopes and side-effect recovery |
| End-to-end workflow | Task outcome, latency, cost, human review effort and fallback behavior |
| What is missing? | Choose first | Watch for |
|---|---|---|
| Current, trusted facts | Permission-filtered retrieval (RAG) | Stale sources, access leaks, conflicting truth. |
| Repeatable method or checks | Skill, runbook, structured workflow or instructions | Skipped steps, weak exit criteria, bad recovery. |
| Live action or reading a system | Scoped tool/API with deterministic permission checks | Unsafe side effects, wrong arguments, lack of audit. |
| Variable multi-step route | Agent only when bounded planning earns its complexity | Runaway loops, weak oversight, cost and ambiguity. |
Combine these when needed. A retrieval source does not grant authority; a procedure cannot replace missing evidence; a tool does not justify unattended action.