What actually makes a modern generative AI system work in practice?
Most people start with the model name. I start with the architecture around it. A large language model gives you the generative core. RAG gives you current or domain-specific knowledge. Prompts shape how the system uses both. That is the real stack.
An LLM is a model trained on large amounts of text so it can predict and produce language. In plain terms, it learns patterns in words, then uses those patterns to answer, write, summarize, or transform text. It is not a database. It is not a search engine. It is a pattern machine with memory only in its weights.
That last part matters. The model weights store what the model has learned during training. When the model runs, it does inference. It takes input tokens, processes them through its learned weights, and generates new tokens one by one. It is fast, useful, and also limited by what it already knows.
That is where RAG comes in.
RAG means Retrieval-Augmented Generation. It adds an external knowledge step before generation. Instead of asking the model to answer only from its training, the system first retrieves relevant documents or passages from a knowledge source, then sends that material into the prompt with the user’s question. The model then writes an answer using that added context.
This is why RAG became so common in production systems. It gives the model access to fresh, private, or specialized information without retraining the whole model. In a support bot, that might mean product docs. In a legal tool, it might mean policies or case notes. In a developer tool, it might mean internal API docs. The architecture is doing the heavy lifting, not magic.
The three parts that matter
Modern generative AI systems usually rest on three layers.
The first layer is the LLM itself. It is the generator. It can summarize, explain, draft, or classify text. A transformer model is the common backbone here. Transformers track relationships across tokens, which helps them handle language in context instead of word by word.
The second layer is retrieval. This is the part that searches for relevant information before the model answers. The retrieval system often works over embedded chunks of documents, so it can find passages that match the user’s query by meaning, not only by exact keywords. That is what makes RAG feel smarter than a plain chat model.
The third layer is the prompt. The prompt tells the model what role to play, what context to use, what to ignore, and what format to follow. In a RAG system, the prompt is not a throwaway string. It is part of the architecture. A weak prompt can waste good retrieved context. A strong prompt can keep the model grounded and structured.
This is the part many people miss. The prompt is not only a user instruction. It is also system design. It decides how the model reads the retrieved evidence and how it should respond when the evidence is thin or messy. That is a common failure point. The model is often blamed when the real problem is the prompt.
A small example makes this easier to see.
Imagine a company help bot that answers questions about refund rules. The user asks, “Can I return a subscription after 30 days?” If the system uses only the LLM, it may give a fluent answer that sounds right and is wrong. If the system uses RAG, it first pulls the refund policy from the company documents. Then the prompt tells the model to answer only from that context. The result is usually more grounded and easier to audit.
That does not mean RAG fixes everything. If the retrieved document is wrong, outdated, or poorly chunked, the answer can still fail. If the prompt is vague, the model may ignore the evidence or blend it with its own training. If the retrieval step misses the right passage, the model never even sees the important fact. RAG improves the odds. It does not remove failure.
Prompts do more than ask questions
Prompt engineering is the work of shaping the input so the model behaves in a useful way. In a RAG system, that usually means more than writing a nice instruction. It includes the order of the system message, the retrieved context, the user query, and sometimes example answers.
Good prompts reduce confusion. They can tell the model to cite the provided context, avoid inventing facts, answer briefly, or say when the context does not contain enough information. That last part is important. A system that refuses to guess is often better than one that answers with confidence and nonsense. Confidence is cheap. Correctness is the expensive part.
Prompting also helps with context management. LLMs have a finite context window. That means every token you add has a cost. Too much context can crowd out the user’s question or add noise. Too little context leaves the model blind. Prompt design is partly about choosing what matters most and arranging it clearly.
This is why prompt engineering and RAG belong together. RAG brings in the facts. The prompt tells the model how to use them. If one side is weak, the whole system weakens.
Where the architecture gets real
In production, the system is usually a pipeline, not a single call. A user sends a query through an API. The application may rewrite the query, search a vector store, collect the top matches, build a prompt, send it to the LLM, then format the response for the app. Each step can fail on its own.
That is also why modern generative AI is really systems engineering. The model is only one part. The data source, retrieval logic, prompt structure, token budget, and API layer all shape the result. A good model with bad retrieval still disappoints. A smaller model with strong context can look better than a bigger one with poor setup. That surprises people the first time, then it stops being surprising.
There is also a practical limit to what these systems can know. An LLM can generalize from training, but it does not automatically know your internal policies, your latest docs, or your product changes. RAG fills that gap. Prompts keep it honest. Together they make the system useful enough for real work.
Modern generative AI architecture is built from a model that generates, retrieval that grounds, and prompts that steer. Once that pattern is clear, the rest stops looking like hype and starts looking like engineering. That is the kind of clarity The Model Log tries to keep alive: one practical AI concept, one working example, and one honest look at what actually works.



