Codecademy Logo

Prompt Engineering Patterns

Related learning

  • Learn about effective prompting techniques to craft high-quality prompts, maximizing your use of generative AI.
    • With Certificate
    • Beginner Friendly.
      3 hours
  • Learn the basics of generative AI and best prompt engineering practices when using AI chatbots like ChatGPT to create new content.
    • Includes 6 Courses
    • With Certificate
    • Beginner Friendly.
      5 hours

Prompt Patterns

Prompt patterns are repeatable frameworks that organize prompts to generate consistent responses from AI assistants. Instead of trial and error, these patterns provide proven approaches that work across different topics and situations.

Purposes of Prompt Patterns

Prompt patterns serve different purposes depending on specific needs. They can structure how information is provided within prompts, control how AI assistants format responses, diagnose problems with failing prompts, and manage extended conversations with AI assistants.

Input Customization Patterns

Input Customization Patterns structure information and requirements within prompts to provide AI assistants with clear direction when organizing complex data. These patterns help arrange details, specifications, and context in ways that make prompts easier for AI assistants to understand and process effectively.

Output Customization Patterns

Output Customization Patterns control how AI assistants format and present responses. These patterns ensure information is generated in a precise structure or style required for specific purposes.

Error Identification Patterns

Error Identification and Prompt Improvement Patterns help diagnose and fix prompt problems systematically. These patterns are useful when prompts generate irrelevant results or fail to meet expectations. They reveal what led to prompt failures and guide targeted fixes.

Interaction Control Patterns

Interaction and Context Control Patterns manage extended conversations and complex workflows with AI assistants. These patterns ensure that important information doesn’t get lost as conversations progress and that each step in a multi-part task builds properly on previous steps.

Combining Prompt Patterns

Multiple prompt patterns can be combined within a single prompt to handle complex tasks. A base pattern provides the main structure and intent, while additional patterns add specific elements like formatting requirements, interaction control, or improved accuracy.

Learn more on Codecademy

  • Learn about effective prompting techniques to craft high-quality prompts, maximizing your use of generative AI.
    • With Certificate
    • Beginner Friendly.
      3 hours
  • Learn the basics of generative AI and best prompt engineering practices when using AI chatbots like ChatGPT to create new content.
    • Includes 6 Courses
    • With Certificate
    • Beginner Friendly.
      5 hours