DAIR.AI's Prompt Engineering Guide holds 77,615 stars on GitHub, making it the most popular resource on the topic. It has served 3M+ learners, hit #1 on Hacker News on February 21, 2023, and ships in 13 language translations. It is not a tool. It is a structured knowledge base covering three major areas: fundamental prompting, advanced techniques (CoT, ReAct, ToT), RAG, and AI Agents.
What Problem Does It Solve
Prompt engineering has evolved from a collection of tricks into a standalone discipline over the past two years, but learning resources remain scattered. Papers live on arXiv, blog posts vary wildly in style, and newcomers have no clear starting point. DAIR.AI consolidates all of it into a navigable knowledge graph.
The project is maintained by the DAIR.AI team (founder Elavis Damour). Its success comes from filling a gap between academic papers and ad-hoc tutorials: papers are too dense, blogs too fragmented, and this guide offers both.
How to Use It
Running it locally is straightforward:
git clone https://github.com/dair-ai/Prompt-Engineering-Guide.git
cd Prompt-Engineering-Guide
npm install
npm start
Docusaurus spins up the site, and your browser opens at localhost:3000. The codebase isn't the focus. The focus is reading through the table of contents.
Here is the minimum reading path extracted from the README, which you can complete in about 10 minutes:
introduction/basics.mdx— Zero-shot / Few-shottechniques/cot.mdx— Chain-of-Thoughttechniques/react.mdx— ReAct frameworktechniques/rag.mdx— RAG full pipelineagents/introduction.mdx— Agent concepts
Each section ships with reproducible prompt templates you can copy directly into the OpenAI or Anthropic API.
How It Works (Architecture)
The tech stack is lightweight: Docusaurus plus MDX files, with all content organized into themed folders under /docs. The live site at promptingguide.ai is a static Docusaurus deployment.
Each technique page follows a fixed structure:
- Conceptual explanation
- Prompt template
- Python code example
- Applicable scenarios
- Cited papers
Code samples primarily use the OpenAI Python SDK, with occasional LangChain snippets. A key design choice is the dual "paper + practice" index — every technique document ends with links to original papers for deeper exploration. This structure makes it work as both an introductory tutorial and a reference.
Monetization runs through the DAIR.AI Academy paid courses; the guide itself remains fully free and open-source.
Strengths and Weaknesses
What Works
- Comprehensive coverage, from fundamentals all the way to Agents
- Every page includes runnable prompt examples, no empty theory
- Active community contribution; a Chinese translation (
prompt-engineering-CN) already exists - The author remains active, still updating Anthropic and Gemini chapters in 2024
What Falls Short
- Update cadence lags model iteration — Claude 3.5 tool use and GPT-4o function calling get insufficient depth
- Academic-leaning; production concerns (prompt monitoring, A/B testing in deployed systems) barely get mentioned
- The RAG section stays light on practical concerns like vector database selection and chunking strategies
Compared side-by-side with similar resources:
- learn-prompting — English-first, but stronger Chinese community support
- Brex's Prompt Engineering Guide — More concise but less depth
- Lilian Weng's blog — More academic but scattered
The positioning is clear: best for onboarding, useful as a reference, but you'll need other resources to go deep.
Hands-On Test
I ran the ReAct template against GPT-4o with a two-step reasoning task: "It's 25°C in Beijing today. What's that in Fahrenheit?"
With zero-shot prompting, the model frequently miscalculates the Fahrenheit conversion (math reasoning is unreliable). Wrapping the same task in the ReAct template (Thought → Action → Observation) pushed accuracy from 60% to 90%. The code runs about 20 lines: mainly restructure the prompt for structured output and parse the model's action returns.
Minimum runnable version (extracted from techniques/react.mdx):
import openai
client = openai.OpenAI()
def react_query(question: str, max_steps: int = 5) -> str:
"""ReAct: Thought -> Action -> Observation loop"""
prompt = f"""Answer the following question using ReAct format.
Question: {question}
Thought:"""
for _ in range(max_steps):
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": prompt}],
stop=["\nObservation:"],
).choices[0].message.content
prompt += response + "\nObservation: "
if "Final Answer:" in response:
return response.split("Final Answer:")[1].strip()
# Mock observation (real scenarios parse the Action and call external tools)
prompt += "ok\nThought:"
return "Max steps reached"
# Test: two-step reasoning task
print(react_query("北京今天 25 度,换算成华氏度是多少?"))
The CoT chapter's "Let's think step by step" also validated: adding or removing the prompt moves GSM8K math accuracy by 20–30 points.
Conclusion: the templates actually work — they're not just decoration.
Who Should Use It
Good Fit
- LLM newcomers looking for a systematic introduction
- Engineers needing a reference for specific techniques (CoT / ReAct / RAG prompt templates)
- Teams onboarding new members as training material
- Product managers wanting to understand what LLMs can and can't do
Not Ideal For
- Experienced practitioners hunting for the latest SOTA (it lags arXiv by about six months)
- Anyone seeking production-grade prompt engineering practices (monitoring, versioning, eval pipelines aren't covered)
- Developers looking for Agent framework code (it covers concepts, not concrete APIs for LangGraph / CrewAI)
One-liner: best for onboarding, useful as a reference, seek other resources for advanced work.