NirDiamant/Prompt_Engineering

22 prompt engineering techniques with hands-on Jupyter Notebook tutorials, from fundamental concepts to advanced strategies for leveraging LLMs.

NirDiamant/Prompt_Engineering — Explained

What it is

A public GitHub repository that collects 22 hands-on tutorials about prompt engineering — the practice of designing the text instructions you give to AI language models (like GPT) to get better, more reliable outputs. It's meant as a learning resource for everyone from beginners to advanced users.

What's inside

  • 22 Jupyter notebooks (interactive code + explanations), each covering a specific technique.
  • Techniques range from basic (what a prompt is, simple structures) to advanced (multi-step reasoning, security, evaluation).
  • Each notebook has an Overview (what the technique does) and an Implementation (how to actually use it, often with OpenAI's GPT models and the LangChain library).
  • The README also links to a book version of the same 22 techniques, a newsletter, and YouTube explainer videos.

How it's organized

The techniques are grouped into six categories:

  1. Fundamental Concepts — intro, basic prompt structures, templates with variables.
  2. Core Techniques — zero-shot prompting, few-shot learning, chain-of-thought.
  3. Advanced Strategies — self-consistency, constrained generation, role prompting.
  4. Advanced Implementations — task decomposition, prompt chaining, instruction engineering.
  5. Optimization — A/B testing prompts, handling ambiguity, managing prompt length.
  6. Specialized & Advanced Applications — negative prompting, formatting, multilingual, ethics, security, evaluation.

Example techniques (in plain terms)

  • Zero-shot prompting: asking the model to do a task without giving it any examples.
  • Few-shot learning: giving the model a few examples to learn from before asking it to do the task.
  • Chain of Thought: asking the model to show its step-by-step reasoning instead of jumping to an answer.
  • Self-consistency: generating multiple reasoning paths and picking the most consistent answer.
  • Role prompting: telling the model to act as a specific persona (e.g., "you are a lawyer").
  • Prompt chaining: connecting multiple prompts in sequence to handle complex tasks.
  • Prompt security: preventing malicious prompt injections.

Who it's for

  • Beginners who want to learn prompt engineering from scratch.
  • Experienced practitioners who want to explore advanced techniques.
  • Contributors — the README explicitly welcomes pull requests and community contributions.

Related projects

The author maintains several companion repositories: RAG Techniques (retrieval-augmented generation), GenAI Agents (AI agent systems), Agents Towards Production, and Agent Memory Techniques.

Key takeaway

This is a learning and reference library — not a single tool or app. You browse the notebooks, run them, and adapt the techniques to your own AI projects. The README emphasizes it's one of the "most extensive and dynamic collections" of prompt engineering tutorials available, and it's actively maintained with regular updates.

Related

  • Project
  • Project
  • Project
  • Project