# Prompt Engineering Guide

Canonical: https://cqbase.net/en/entry/prompt-engineering-guide
Chinese: https://cqbase.net/zh/entry/prompt-engineering-guide
English: https://cqbase.net/en/entry/prompt-engineering-guide

> DAIR.AI’s guide, from basic prompting through RAG and agents.

dair-ai/Prompt-Engineering-Guide is MIT licensed. The site is promptingguide.ai. It gathers common practice for prompting, context, RAG, and agents, and points at papers and notebooks. It is a vocabulary before you rewrite your own prompts.

Read a section and adapt it to a real task. Do not leave the guide’s examples in a production prompt unchanged. The examples are teaching material.

Note (verified 15 November 2026): The repository is not archived, and no deprecation notice was found. The latest commit is [5767372](https://github.com/dair-ai/Prompt-Engineering-Guide/commit/57673726396dd94acb23bdb1e67f27c78ee85a8e) (04:07 Asia/Shanghai on 12 March 2026). The GitHub Releases list was empty. The README still says it includes the latest papers and points to https://www.promptingguide.ai/. This review did not page through the website to check whether it is newer than the git repository.

## What problem it solves

[dair-ai/Prompt-Engineering-Guide](https://github.com/dair-ai/Prompt-Engineering-Guide) is a prompt-engineering guide maintained by DAIR.AI. The public site is [www.promptingguide.ai](https://www.promptingguide.ai/). It collects common techniques, applications, risks, and an index of papers and notebooks, from zero-shot, few-shot, and chain-of-thought prompting through RAG and agents. Use it to build a vocabulary, then go back and rewrite your own prompts. The repository is MIT licensed, is not archived, and no deprecation notice was found.

Verified on 2026-11-16 (Asia/Shanghai). The latest commit is [5767372](https://github.com/dair-ai/Prompt-Engineering-Guide/commit/57673726396dd94acb23bdb1e67f27c78ee85a8e), with author date 20:07 UTC on 11 March 2026, which is 04:07 Asia/Shanghai on 12 March 2026. The repository `pushed_at` timestamp is 04:09 Asia/Shanghai on 12 March 2026. The GitHub Releases list was empty on the same day. The README still says the guide includes the latest papers and points at the website. The site homepage was opened on 2026-11-16 and was reachable, but the homepage does not state an update date later than the repository. This review did not page through every section to check whether the site is newer than the March 2026 git commit. Treat the guide as introductory material, and compare it with the official docs for the model you actually use; do not treat it as a November 2026 paper index or model manual. This catalog has moved the entry off the featured list and added a notice because the repository has not been pushed for a long time, not because it was officially deprecated.

## Who it is for

It is for people who want a map of common prompt-engineering terms and techniques before they rewrite production prompts. The examples in the guide are teaching material, not a prompt library you can drop into production unchanged.

DAIR.AI also offers academy courses and consulting, linked from the README and [academy.dair.ai](https://academy.dair.ai/pricing). Those are paid products, separate from this MIT-licensed guide. This page does not repeat discount codes or prices, which can expire. If your goal is the current best way to call a specific model, open that vendor’s official docs as well.

## How to use it

Everyday reading can happen at [www.promptingguide.ai](https://www.promptingguide.ai/); you do not need to install anything first. Read one section at a time, rather than copying the whole site into a production prompt:

1. Start with the [Introduction](https://www.promptingguide.ai/introduction) for the basic parts of a prompt and common settings.
2. Then open [Techniques](https://www.promptingguide.ai/techniques) and choose only the sections that match the current task, such as few-shot prompting, chain of thought, or RAG. Do not stack every technique in the table of contents into a single prompt.
3. After each section, rewrite a prompt for a real task of your own and compare it with your previous version. The sample tasks in the guide are demonstrations.
4. Model-specific chapters (the README lists pages for ChatGPT, GPT-4, Gemini, LLaMA, and others) may lag behind that model’s current docs. Check the official pages too.

If you only want a local preview of the site (for example to check a translation), the README’s steps are: install Node.js 18 or later, install [pnpm](https://pnpm.io/installation), then install dependencies and start the dev server:

```bash
pnpm i next react react-dom nextra nextra-theme-docs
pnpm dev
```

Then browse `http://localhost:3000/`. That is not a prerequisite for reading the guide; it is only how you run the site source.

## A worked example

This exercise adapts the few-shot prompting section. This guide did not call any model, so it does not invent before-and-after outputs.

1. Open [Few-Shot Prompting](https://www.promptingguide.ai/techniques/fewshot) and identify the problem it addresses: giving the model a few input and output examples so the format and decision rule stay more stable. Do not paste the page’s sample sentences into your business data unchanged.
2. Take a real task of your own, such as classifying internal tickets into a fixed set of labels. Write a baseline prompt with no examples, then add three to five examples from your own data, including cases that are easy to confuse.
3. A prompt skeleton can look like: `You classify support tickets into one of: billing, outage, feature-request. Reply with the label only.` Then add your own labeled examples and one new ticket to classify. The labels and the source text must come from your data.
4. Expected effect: the model should stay closer to your label set and output format. Compare the baseline and few-shot versions on a small set of real samples yourself, and check the official prompting notes for the model you use. The guide is not a substitute for current model docs.

## Common pitfalls

- Reading “latest papers” in the README as a claim that the repository was still being updated weekly in November 2026. The latest git commit is from 12 March 2026, and the Releases list is empty.
- Assuming the website must be newer than the git repository. This review only confirmed that the homepage is reachable. It did not page through update dates, so it does not claim that the site has been updated, or that it is also frozen in March.
- Pasting teaching examples into a production prompt. The samples exist to explain a technique; their tasks, tone, and labels need not match your constraints.
- Relying only on a model-specific chapter and skipping that model’s current official docs. Those chapters go stale more easily.
- Treating the paid academy courses and this MIT guide as the same material. Whether a course is current, and what it costs, is stated on the academy pages and is separate from this repository’s license.

## FAQ

### Has this guide been abandoned or deprecated?

The repository is not archived, and no deprecation notice was found. The latest commit, however, remains at 04:07 Asia/Shanghai on 12 March 2026, and the GitHub Releases list is empty. It is still useful as an introduction, but it should not be treated as the most current or most authoritative prompting manual.

### Are the guide and the courses both free?

The guide text in the repository is published under the MIT license. DAIR.AI also offers paid academy courses and related services, linked from the official site. Do not treat those as the same thing. This page does not list prices or coupon codes.

### Can I use the guide’s examples in production as they are?

That is not a good idea. The official material is for teaching. The useful path is to understand the technique, rewrite the prompt with your own task, data, and constraints, and compare a small sample on the model you actually use.

### What is the license?

The repository is MIT licensed. The README points to [LICENSE.md](https://github.com/dair-ai/Prompt-Engineering-Guide/blob/main/LICENSE.md). Read the full text before commercial use or redistribution. If you cite the guide in a paper or in your work, the README also provides a citation format; use the repository text.

### Do I have to run the website locally to read it?

No. Everyday reading can happen at [www.promptingguide.ai](https://www.promptingguide.ai/). A local server is only for previewing the source or checking a translation. The README requires Node.js 18 or later and uses pnpm to install dependencies.

## Sources and license

The [dair-ai/Prompt-Engineering-Guide](https://github.com/dair-ai/Prompt-Engineering-Guide) repository is licensed under MIT. This page is a paraphrase, for CQBase — Context & Query Base, of the README, the latest commit [5767372](https://github.com/dair-ai/Prompt-Engineering-Guide/commit/57673726396dd94acb23bdb1e67f27c78ee85a8e), the empty GitHub Releases list, and the [promptingguide.ai](https://www.promptingguide.ai/) homepage opened on 2026-11-16. If the site or the repository is updated, the official pages win.

## Catalog record

- Author: dair-ai
- License: MIT
- Source: https://github.com/dair-ai/Prompt-Engineering-Guide
- Added: 2026-11-15
- GitHub stars: 80068 (captured 2026-11-15)

