PromptsApr 6, 2026·2 min read

Prompt Engineering Guide — 73K-Star Learning Hub

The most comprehensive open-source prompt engineering resource with guides, papers, notebooks, and courses covering chain-of-thought, RAG, AI agents, and 13 languages. 3M+ learners, MIT.

TL;DR
The Prompt Engineering Guide is the most comprehensive open-source resource for learning prompt techniques: CoT, RAG, agents, and more.
§01

What it is

The Prompt Engineering Guide is an open-source educational resource covering prompt engineering techniques for large language models. It includes written guides, research paper summaries, Jupyter notebooks, and course materials on topics like chain-of-thought prompting, retrieval-augmented generation, AI agents, and multi-modal models. The content is available in 13 languages.

This resource targets developers, researchers, and AI practitioners who want to understand and apply prompt engineering systematically rather than through trial and error.

§02

How it saves time or tokens

Understanding prompt engineering techniques directly reduces token waste. A well-structured prompt that uses chain-of-thought or few-shot examples gets better results on the first try, avoiding the iterative cycle of prompt refinement that consumes tokens.

The guide covers token-efficient patterns: when to use system prompts vs user prompts, how to structure few-shot examples for maximum effect, and when chain-of-thought helps vs hurts (simple tasks do not benefit from verbose reasoning).

§03

How to use

  1. Clone the repository or read online:
git clone https://github.com/dair-ai/Prompt-Engineering-Guide.git
cd Prompt-Engineering-Guide
  1. Start with the fundamentals:
guides/
  prompts-intro.md        # Introduction to prompting
  prompts-basic-usage.md  # Basic techniques
  prompts-advanced.md     # Advanced patterns
  prompts-chatgpt.md      # ChatGPT-specific tips
  prompts-applications.md # Real-world applications
  1. Explore technique-specific notebooks in the notebooks/ directory for hands-on practice.
§04

Example

Chain-of-thought prompting pattern from the guide:

# Without CoT (often wrong on complex tasks)
Q: Roger has 5 tennis balls. He buys 2 more cans
   of 3 tennis balls each. How many does he have?
A: 11

# With CoT (step-by-step reasoning)
Q: Roger has 5 tennis balls. He buys 2 more cans
   of 3 tennis balls each. How many does he have?
A: Roger starts with 5 balls.
   He buys 2 cans of 3 balls each = 6 balls.
   5 + 6 = 11.
   The answer is 11.

Explicit reasoning steps improve accuracy on math, logic, and multi-step tasks.

§05

Related on TokRepo

§06

Common pitfalls

  • Applying chain-of-thought to every prompt. Simple factual questions and classification tasks do not benefit from verbose reasoning. CoT adds tokens without improving accuracy on straightforward tasks.
  • Ignoring model-specific prompt formats. Claude, GPT-4, and Gemini have different system prompt conventions and capabilities. Techniques that work on one model may underperform on another.
  • Over-engineering prompts when a simple instruction suffices. Start with the simplest prompt that works and add complexity only when needed.

Frequently Asked Questions

What topics does the Prompt Engineering Guide cover?+

The guide covers foundational techniques (zero-shot, few-shot, chain-of-thought), advanced patterns (tree-of-thought, RAG, agents), model-specific tips (GPT-4, Claude, Llama), and applications (code generation, reasoning, creative writing). It also summarizes relevant research papers.

Is the Prompt Engineering Guide free?+

Yes. The entire guide is open source under the MIT license. All written content, notebooks, and course materials are freely available on GitHub and the project website.

How often is the guide updated?+

The guide is actively maintained by the DAIR.AI community. New techniques, model-specific tips, and research summaries are added regularly. Contributors submit updates via pull requests.

Can I use the guide materials for teaching?+

Yes. The MIT license permits use in educational settings, including university courses, corporate training, and workshops. Attribution to the project is appreciated but not legally required.

Does the guide cover Anthropic Claude prompting?+

Yes. The guide includes sections on Claude-specific prompting techniques, including system prompts, XML tags for structured output, and Anthropic's recommended prompt engineering patterns.

Citations (3)
🙏

Source & Thanks

Created by DAIR.AI. Licensed under MIT.

Prompt-Engineering-Guide — ⭐ 72,900+

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.