Many architecture discussions confuse five different needs: giving instructions, supplying current knowledge, preserving state, accessing live systems, and changing model behavior. Each need has a different mechanism and operating cost.
| Need | Typical mechanism | Good fit | Important limitation |
|---|---|---|---|
| Define task and format | Prompt and structured output | Instructions that change quickly | Competing or ambiguous instructions can still fail |
| Supply current or private knowledge | RAG or direct context | Policies, support articles, product documentation | Retrieval quality and permissions become critical |
| Preserve user or workflow state | Session state or explicit memory | Preferences and multi-step tasks | Stale or cross-user state creates harm |
| Read or change live information | API or tool call | CRM lookup, booking, analytics query | Requires authorization, validation, and failure handling |
| Improve repeated task behavior | Fine-tuning | Stable patterns with representative examples | Does not reliably inject current factual knowledge |
| Change capability or economics | Model selection | Quality, latency, modality, context, or cost needs | A stronger model cannot repair broken data flow |

Source: Google Cloud, Deploy and operate generative AI applications, licensed under CC BY 4.0.
Retrieval-augmented generation adds selected external information to the model’s input. It does not make every source true, current, relevant, or authorized.
flowchart LR
A[Source documents] --> B[Parse and split]
B --> C[Metadata and permissions]
C --> D[Index]
E[User query] --> F[Retrieve and rerank]
D --> F
F --> G[Assemble context]
G --> H[Generate and cite]
Quality can fail at every step:
Measure retrieval separately from generation. If the correct passage never reaches the model, changing the prompt cannot reliably solve the problem.
The visible chat history, a session summary, a user profile, and durable task state are different artifacts. For each one, decide:
More memory is not always better. Irrelevant history consumes context, stale preferences distort decisions, and shared state can leak one person’s data to another.
Start with the least complex intervention that addresses the verified cause:
Question: A sales-email system uses yesterday’s account status. Should the team fine-tune the model on more CRM exports?