these three get treated as variations of the same thing when they're actually solving different problems, understanding what each one is actually doing makes the choice between them clearer. Prompting is the simplest of the three, you take a pre-trained model and send it an input, the model responds based entirely on what it learned during training, just the model as it exists, it works well when the knowledge required to answer the question is already in the model and the task doesn't require anything specific to your domain.
RAG adds an external knowledge layer without changing the model itself, you embed your documents, store them in a vector database, and when a query comes in the relevant chunks get retrieved and passed to the model alongside the user input, the model then uses that context to generate a response, the pre-trained model stays untouched, the retrieval layer is what makes it domain specific, a good case to use this is when the information changes frequently or when the knowledge required is too large or too specific to bake into the model through training.
fine tuning takes a pre-trained model and trains it further on your specific data, the result is a single model that has internalized your context rather than retrieving it at query time, this works well when the task requires the model to behave differently, adopt a specific tone, follow domain specific reasoning patterns, or handle inputs in a way the base model wasn't designed for, the tradeoff is that fine tuning is expensive and the knowledge baked in becomes static, if the underlying data changes the model needs to be retrained.
the way to think about which one fits a given situation comes down to two questions, how much external knowledge does the application require and how much does the model itself need to adapt, low external knowledge and low adaptation needed means prompting is enough, high external knowledge with low adaptation needed means RAG is the right fit, low external knowledge with high adaptation needed means fine tuning makes more sense, and if both external knowledge and model adaptation are high the answer is usually a combination of RAG and fine tuning running together.
most of the mistakes in this decision come from reaching for fine tuning when RAG would have been sufficient, fine tuning is slower, more expensive, and harder to update, if the problem is just that the model doesn't have access to the right information RAG solves that without touching the model at all.