Prompt engineering
A system prompt is the top-priority instruction that frames every turn: role, rules, and constraints. Models learn to favor it, but that is a habit rather than an enforced boundary. Determined text in the user message, a tool result, or a retrieved passage can sometimes override it. Treat the system prompt as a strong default, then back it with checks in your own code when the stakes are high.
Few-shot prompting places a handful of worked input and output examples in the prompt so the model copies the pattern. No weights change, and the effect disappears when the examples do. The model may also copy quirks of the examples, such as their tone or length, so pick them as carefully as you would pick test fixtures.
Chain-of-thought asks the model to write out its reasoning step by step before answering. Each written token gives later tokens more to build on, which helps with multi-step problems. The price is extra tokens, time, and cost, and it adds little for simple lookups. For work you will run often, measure whether the extra reasoning actually improves the answer.
When you need a specific shape of output, constrained decoding is stronger than politely asking for JSON. It blocks any token that would break a format, such as a schema. You should still validate the result in your own code. The model can satisfy the grammar and still be wrong.