Menu

Prompt Patterns And Techniques

Learn Prompt Patterns And Techniques for Prompt Engineer for free: roadmap, examples, subskills, and a skill exam.

Published: January 8, 2026 | Updated: January 8, 2026

Why this skill matters for Prompt Engineers

Prompt patterns turn generic models into reliable task-solvers. As a Prompt Engineer, you will design instructions, structure inputs, and compose multi-step flows that reduce errors, improve safety, and hit product goals such as accuracy, latency, and cost.

  • Ship features faster by reusing proven patterns.
  • Lower hallucinations with retrieval and verification prompts.
  • Scale to complex tasks with planning, chaining, and tool use.
  • Protect users and brands with guardrails and refusal handling.

What you will be able to do

  • Break problems into steps that models can follow.
  • Design short-reasoning prompts that are fast and safe.
  • Use retrieval-augmented prompting (RAG) to ground answers.
  • Call tools/functions via structured outputs.
  • Separate planning from execution for reliability.
  • Chain prompts into robust workflows.
  • Implement guardrails and graceful refusals.

Who this is for

  • Prompt Engineers and ML/AI practitioners building LLM features.
  • Data scientists adding LLMs to analytics, agents, or apps.
  • Product engineers needing reliable, policy-safe prompts.

Prerequisites

  • Basic familiarity with LLM inputs/outputs and temperature/top-p concepts.
  • Comfort reading JSON and simple templates.
  • Optional but helpful: experience with a vector store or simple API calls.

Learning path (roadmap)

  1. Decomposition into steps: Turn one vague goal into clear sub-tasks with constraints and formats.
  2. Short reasoning (CoT avoidance): Request concise justifications and use fallback phrases when uncertain.
  3. Self-check and verification: Ask the model to check outputs against a checklist and fix issues.
  4. RAG basics: Insert retrieved snippets and instruct the model to answer from context only.
  5. Tool use / function calling: Return structured JSON for function calls; validate and execute.
  6. Planning–execution separation: Generate a plan in one call, execute in another.
  7. Prompt chaining & orchestration: Sequence prompts with state passing and error handling.
  8. Guardrails & refusals: Define allowed/disallowed topics, safe alternatives, and uncertainty responses.

Core patterns with worked examples

1) Decomposition Into Steps — Structured summarization

Goal: summarize a meeting transcript into decisions and actions.

System: You are a concise business analyst.
User: Goal:
Summarize the meeting transcript into two sections.
Constraints:
- Use bullet points.
- Max 5 bullets per section.
Output format:
Decisions:
- ...
Actions:
- ...
Transcript:
{{transcript}}

Why it works: explicit goals, constraints, and output shape reduce ambiguity.

2) Chain-of-thought avoidance — Short reasoning prompts

Use brief justifications to keep responses fast and safe.

System: Provide the final answer first. If uncertain, reply "Not enough information".
User: What is the average of 10, 15, and 35? Include a one-sentence justification.

Expected style: a correct final answer with a single-sentence justification, no step-by-step reasoning.

3) Self-check & verification — Model checks its own output

Ask for an answer, then a quick conformance check with targeted fixes.

System: You produce JSON matching a strict schema and then verify it.
User: Task: Extract product name, price (USD), and availability from the text.
Output JSON schema: {"name": string, "price_usd": number, "in_stock": boolean}
Text: {{snippet}}
Steps:
1) Produce JSON only.
2) Verify: keys present, price is number, booleans are true/false.
3) If a check fails, correct and re-emit JSON.

Benefit: reduces format drift and missing fields.

4) Retrieval-Augmented Prompting (RAG) — Grounded answers

Insert retrieved snippets and constrain the model to them.

System: Answer from the provided context only. If missing, reply "Not in context".
User: Question: {{question}}
Context:
-----
{{chunk_1}}
-----
{{chunk_2}}
-----
Rules: Quote relevant lines. If unsure: "Not in context".

Benefit: lowers hallucinations and adds traceability.

5) Tool use & function calling — Structured actions

Have the model request a tool by returning a function name and arguments JSON.

System: If a tool is needed, respond ONLY with JSON: {"name": string, "arguments": object}.
Tools:
- name: "lookup_weather", args: {"city": string, "units": "metric"|"imperial"}
User: What's the current temperature in Paris in Celsius?

Example assistant response:

{
  "name": "lookup_weather",
  "arguments": {"city": "Paris", "units": "metric"}
}

Then your app runs the tool and optionally follows up with a natural-language answer.

6) Planning–Execution separation + Guardrails

First get a plan, confirm it is safe/allowed, then execute.

Call 1 (Plan)
System: Create a 3-step plan to answer the user. Avoid disallowed content. If risky, mark step as "REFUSE".
User: {{task}}

Call 2 (Execute)
System: Execute the approved plan. If any step is REFUSE, provide a safe alternative or say why you can't comply.

This isolates risky steps and makes review easier.

Drills and exercises

  • [ ] Rewrite one of your existing prompts to include a clear output schema and a 2-item verifier checklist.
  • [ ] Convert a long explanation prompt into a short-reasoning version with a one-sentence justification rule.
  • [ ] Add a RAG wrapper: insert 2–3 context chunks and force "Not in context" when missing.
  • [ ] Build a tool-call spec with a name and arguments JSON; test a response that triggers the tool.
  • [ ] Split a complex task into a plan call and an execute call; log both outputs.
  • [ ] Add a refusal template for unsafe requests with a safe, high-level alternative.

Common mistakes and debugging tips

  • Vague goals: Fix by adding explicit tasks, constraints, and output format.
  • Overlong reasoning: Use short-reasoning prompts with word limits and "final answer first".
  • Hallucinations in factual tasks: Switch to RAG with a strict "answer from context only" rule.
  • JSON drift: Include a schema, ask for JSON only, and add a verification step; parse strictly.
  • Unsafe or policy-violating outputs: Add refusal policy, ambiguity clarification, and safe alternatives.
  • Chained prompts fail silently: Log each step, include checks, and add fallback branches for empty or invalid outputs.
  • Latency spikes: Prefer short-reasoning prompts and only call tools when necessary.

Mini project: Policy-aware Q&A with RAG and tool calls

Build a small assistant that answers company FAQ questions from a set of documents and can optionally call a currency conversion tool.

  1. Indexer: chunk and store 20–50 FAQ docs (titles + text).
  2. Retriever: return top 3 chunks for a query.
  3. RAG prompt: answer only from context; say "Not in context" if missing.
  4. Tool call: if a price needs converting, return a JSON tool request {"name":"convert_currency","arguments":{...}}.
  5. Verification: ensure the final answer cites at least one context snippet and includes units for any amounts.
  6. Guardrails: refuse unsafe or PII-seeking queries with a safe alternative response.
Suggested evaluation checklist
  • Accuracy: answers match context; no made-up facts.
  • Safety: unsafe requests receive refusals.
  • Format: JSON tool calls parse correctly.
  • Latency: 95% responses under your target (e.g., 2s without tools, 4s with tools).

Practical projects to reinforce learning

  • Meeting minutes generator: decompose into sections; add verification for required fields.
  • Product finder assistant: tool calling for search + RAG grounding from a catalog.
  • Policy compliance checker: short-reasoning classification with refusals and safe rewrites.
  • Research synthesizer: plan first, then execute with RAG and citations.

Subskills

  • Decomposition Into Steps: Turn broad tasks into clear, checkable sub-tasks with formats.
  • Self Check And Verification Prompts: Ask the model to validate and correct its own outputs.
  • Chain Of Thought Avoidance And Short Reasoning Prompts: Fast prompts that require concise justifications.
  • Retrieval Augmented Prompting Basics: Ground responses in provided context or decline.
  • Tool Use And Function Calling Patterns: Return structured JSON to request tools.
  • Planning And Execution Separation: Plan in one call, execute in another for clarity and safety.
  • Prompt Chaining And Orchestration: Sequence multi-step flows with state passing.
  • Guardrails And Refusal Handling: Clearly define allowed/disallowed content and safe alternatives.

Next steps

  • Instrument your prompts: log inputs/outputs and verification flags.
  • Create a small library of reusable templates (RAG, tool call, refusal).
  • Take the skill exam below to check gaps and solidify learning.

Have questions about Prompt Patterns And Techniques?

AI Assistant

Ask questions about this tool