9
Code generation requires extreme specificity.
- Context is King: "Write a function to sort users" fails. "Here is my User schema, write a TypeScript function to sort them by lastLogin, handling nulls" succeeds.
10
How you format retrieved documents in the prompt determines if the model actually uses them.
- XML Tags: Use `` tags to clearly separate retrieved knowledge from the user's instructions, preventing prompt injection and confusion.
11
Managing context across a long conversation is an art.
- Context Window Management: As conversations grow, you must summarize older messages or drop them entirely to keep the prompt focused and cheap.
12
Tool descriptions are just prompts for the model's routing engine.
- Naming Matters: A tool named `get_data` will confuse the model. A tool named `get_user_purchase_history` will be used correctly.
The Bottom Line: In real-world applications, the prompt is rarely written by the user. It is a dynamic template constructed by your software, combining system rules, retrieved data, and user input.