Prompt engineering
Designing instructions, examples and format so a model behaves as needed.
The cheapest lever: system prompts, few-shot examples and structured output. Try it first.
AI & agents
Prompt engineering changes the instructions, RAG changes the knowledge the model sees at answer time, and fine-tuning changes the model's weights to change its behaviour.
Designing instructions, examples and format so a model behaves as needed.
The cheapest lever: system prompts, few-shot examples and structured output. Try it first.
Retrieval-augmented generation: fetch relevant documents and give them to the model as context.
Keeps answers grounded in your current data with citations, without retraining; quality depends on retrieval.
Further training a model on your examples to adjust its weights.
Best for consistent style, format or narrow skills; it does not reliably add fresh facts and costs data and training.
| Aspect | Prompt engineering | RAG | Fine-tuning |
|---|---|---|---|
| Changes | Instructions | Context (knowledge) | Model weights |
| Fresh data | No | Yes, instantly | Only after retraining |
| Cost | Lowest | Medium (index + retrieval) | Highest |
| Citations | No | Yes | No |
| Use for | Behaviour and format | Facts from your documents | Style, format, specialised skills |
Prompt engineering changes the instructions and examples the model sees, RAG adds relevant documents to the context at answer time, and fine-tuning changes the model's weights by training on examples. The first two change inputs; only fine-tuning changes the model.
Prompt engineering, because it is cheapest and fastest to iterate: clearer instructions, examples and output formats often fix the problem. Add RAG when answers need your own or fresh knowledge, and consider fine-tuning only when behaviour still falls short.
When answers depend on facts that change or are private, such as product docs, policies or tickets. RAG pulls the latest documents at query time, supports citations and access control, and needs no retraining when content changes.
When you need a consistent style, format or narrow skill the base model does not do reliably, such as a specific classification scheme, brand voice or domain-specific output structure, and you have hundreds to thousands of good examples.
Not reliably. Fine-tuning mostly shapes behaviour and format; facts learned this way are hard to update, cannot be cited and may be hallucinated. For knowledge, RAG is usually better.
Yes. A common pattern fine-tunes a model to follow a house style or to use retrieved context well, then uses RAG to supply current facts. Prompt engineering still frames both.
Prompting costs only extra tokens. RAG adds an embedding index, vector storage, retrieval latency and longer prompts. Fine-tuning adds data preparation, training runs, evaluation and possibly higher inference prices for custom models.
Prompt changes barely affect latency unless prompts get long. RAG adds a retrieval step and more context tokens. A fine-tuned smaller model can be faster than a large prompted model, since it needs fewer instructions.
Prompts can include small, current facts directly. RAG handles change best: update the index and answers change immediately. Fine-tuned models need retraining to reflect new information.
RAG, because the answer is generated from specific retrieved passages that can be shown as sources. Prompting and fine-tuning produce answers from the model's internal knowledge without traceable sources.
Practise every comparison in your dashboard.
Start learning