prompt engineering
Prompt engineering is the practice of crafting, refining, and iterating prompts like input instructions, context, and examples to guide a generative model toward producing desired, high-quality, and reliable outputs.
It treats the underlying model’s parameters as fixed and focuses on optimizing the input rather than retraining the model.
Prompting techniques may include the following:
- zero-shot and few-shot prompting
- structured instructions
- chain-of-thought or reasoning-style cues, now mostly a fallback because reasoning models generate these steps natively
Prompt designers typically distinguish between system (global behavior) and user (task-specific) messages, include retrieved or contextual grounding information, and iterate on prompt design based on output quality, feedback, and evaluation.
For multi-turn and agentic work, prompt engineering is now usually framed as one part of context engineering. Context engineering manages the whole context window, including system instructions, tools, retrieved data, and message history, rather than a single prompt.
Related Resources
Tutorial
Prompt Engineering: A Practical Example
Learn prompt engineering techniques with a practical, real-world project to get better results from large language models. This tutorial covers zero-shot and few-shot prompting, delimiters, numbered steps, role prompts, chain-of-thought prompting, and more. Improve your LLM-assisted projects today.
For additional information on related topics, take a look at the following resources:
- Simon Willison: Using LLMs for Python Development (Podcast)
- Context Engineering for Python Codebases (Tutorial)
- Build an LLM RAG Chatbot With LangChain (Tutorial)
- Practical Prompt Engineering (Quiz)
- Context Engineering for Python Codebases (Quiz)
- First Steps With LangChain (Course)
- Build an LLM RAG Chatbot With LangChain (Quiz)
Have a question about this? Mentor AI can show you examples, compare related terms, and point you to tutorials.
By Leodanis Pozo Ramos • Updated Sept. 21, 2026