PromptisePromptise
Docs
GitHub
Promptise - AI Framework LogoPromptise

The foundation layer for agentic intelligence. Build, secure and operate autonomous AI systems with Promptise Foundry.

pip install promptise

[01] Foundry

  • MCPcast
  • The Promptise Agent
  • Reasoning Engine
  • MCP
  • Agent Runtime
  • Prompt Engineering
  • Execution Engine
  • Agent Identity

[02] Resources

  • Documentation
  • GitHub
  • Guides
  • Learning Paths
  • Questions

[03] Company

  • About
  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Subprocessors

© 2026 Promptise by Manser Ventures. All rights reserved.

Open source · Python

← Guides> Library> Category

Prompt engineering guides: techniques with worked examples

Prompt engineering is the practice of writing and testing the instructions, examples and context you give a language model so that it does a task reliably. These guides cover it from the first prompt to advanced techniques.

The beginner guides explain clear prompts, system and user messages, few-shot examples, step-by-step reasoning, structured JSON output and quick checks for hallucinations. Intermediate and advanced guides cover chain-of-thought variants, self-correction, verification loops, long-context prompting and compression, routing between models, automatic prompt optimization and a series of mental models for how LLMs behave. Most guides show a real prompt, its output and what changed, and many include Python code you can run.

[n.01/02]> 54 guides

Beginner19

  1. 01Why Can't LLMs Count Letters? Tokens and ProbabilityWhy LLMs miscount letters, reverse strings wrong and miss word limits: tokenization, sampling, real failures, and why exact work belongs in your code.Beginner · 4 minOct 18, 2026
  2. 02How to Brief an LLM: Context Gaps and Clarifying QuestionsHow to brief an LLM like a new colleague: why it lacks your context and won't ask, the jagged frontier, and a real example of guesses swapped for asks.Beginner · 5 minOct 18, 2026
  3. 03Are LLMs Stochastic Parrots? What the Term Gets RightAre LLMs stochastic parrots? What Bender et al. meant, what next-token prediction implies, where the term falls short, and the habit it should give you.Beginner · 5 minOct 18, 2026
  4. 04RAG for Beginners: Build a Tiny RAG Pipeline in PythonBuild a tiny RAG pipeline in Python: chunk Markdown files, embed and retrieve passages, cite sources and admit when the docs don't cover it. Real output.Beginner · 7 minOct 18, 2026
  5. 05Grounding LLM Answers: Give the Model the Right ContextGround LLM answers in your own text: paste the source, fence it with delimiters, require citations and handle gaps. Real return-policy example.Beginner · 7 minOct 18, 2026
  6. 06Few-Shot Prompting: How to Pick Examples That WorkFew-shot prompting explained: when examples beat instructions, how to choose and format them, and which biases to avoid. Real release-notes example.Beginner · 6 minOct 18, 2026
  7. 07Multimodal Prompting: Extract Reliable Data from ImagesPrompt a vision model for usable data: send the image first, name the fields, write rules for tricky cases and check totals in code. Real receipt example.Beginner · 6 minOct 18, 2026
  8. 08Chain of Density Prompting: Denser Summaries, Same LengthChain of Density prompting explained: add missing entities to a summary without making it longer, from the 2023 paper to a one-pass version. Real output.Beginner · 8 minOct 18, 2026
  9. 09LLM Hallucinations: Why They Happen and Quick ChecksWhy LLMs hallucinate and how to catch it: spot risky questions, allow "I don't know", require quotes and check them in code. Real fake-citation example.Beginner · 7 minOct 18, 2026
  10. 10Structured Outputs: Get Reliable JSON from an LLMGet reliable JSON from an LLM: define a schema, use structured outputs, validate with Pydantic and catch wrong values. Real email-extraction example.Beginner · 7 minOct 18, 2026
  11. 11Iterative Prompt Refinement: Improve a Prompt in 3 RoundsImprove a prompt step by step: diagnose the biggest gap, change one thing per round and keep every version. Three real rounds on one task, with output.Beginner · 8 minOct 18, 2026
  12. 12Prompt Evaluation for Beginners: A Simple Eval LoopEvaluate prompts with a simple eval loop: build a golden set, write pass/fail checks, compare prompt versions and read the failures. Real Python output.Beginner · 7 minOct 18, 2026
  13. 13Role Prompting: When Personas Help and When They Don'tRole prompting explained: when a persona improves output, when it doesn't, and how to write a role that works. Real example: a price-change email.Beginner · 7 minOct 18, 2026
  14. 14System Prompt vs User Prompt: What Goes WhereSystem prompt vs user prompt: what each is for, what to put in each, and how the model weighs them. A real support-assistant example with model output.Beginner · 7 minOct 18, 2026
  15. 15LLM Tone and Style: Write a Style Guide PromptControl LLM tone, voice and length with a style guide in the system prompt: rules, banned words, one example and code checks. Real before-and-after output.Beginner · 6 minOct 18, 2026
  16. 16Chain-of-Thought Prompting for Beginners: Step by StepChain-of-thought prompting for beginners: when asking for steps helps, how to write a step prompt, and when reasoning models don't need it. Real example.Beginner · 6 minOct 18, 2026
  17. 17LLM Confidence Scores: Add Self-Check Fields to PromptsGet useful LLM confidence scores: add basis, quote and check fields to the output, define each level and route answers in code. Real example and output.Beginner · 8 minOct 18, 2026
  18. 18How to Write Clear Prompts: Ask, Role, Constraints, FormatWrite prompts the model can't misread: state the ask, set a role, add constraints and fix the format. A real product-description prompt, before and after.Beginner · 6 minOct 18, 2026
  19. 19What Is Prompt Engineering? A Beginner's Guide with ExamplesWhat prompt engineering is, how a prompt works, and the five parts of a good one, with a real before-and-after example and a map of the beginner path.Beginner · 7 minOct 18, 2026

Intermediate21

  1. 20Can LLMs Simulate Users? Role-Play, Personas and LimitsCan LLMs simulate users or customers? The simulator view of LLMs, what research says about personas, two real role-plays that went wrong, and fixes.Intermediate · 5 minOct 18, 2026
  2. 21Does AI Boost Productivity? The LLM as Cognitive MultiplierDoes AI make you more productive? What field studies show about the jagged frontier, and how to use an LLM to sharpen your judgment. Real plan example.Intermediate · 5 minOct 18, 2026
  3. 22How LLMs Generate Text: Next-Token Probabilities ExplainedHow LLMs generate text one token at a time: probabilities, temperature, top-p, and why early words commit the rest. Real example of a verdict-first error.Intermediate · 5 minOct 18, 2026
  4. 23Why LLM Output Is Untrusted Input: Design for InjectionWhy to treat LLM output as untrusted: indirect prompt injection, OWASP LLM risks, a real injected support ticket, and design rules that contain the damage.Intermediate · 5 minOct 18, 2026
  5. 24Why LLMs Mirror You: Sycophancy, Bias and Leading PromptsWhy LLMs agree with you: sycophancy from human-feedback training and bias from human text. Prompts that get honest feedback, with a real rating example.Intermediate · 5 minOct 18, 2026
  6. 25How LLM Tool Calling Works: The Model Never Runs ToolsHow LLM tool calling works: the model writes a request, your code runs it. A real two-step refund exchange and design rules for tools, results and gates.Intermediate · 4 minOct 18, 2026
  7. 26Prompts as Code: The LLM as a Probabilistic CompilerTreat prompts as code: write specs, enforce output shape with structured outputs, surface assumptions and test every change. Real date-extraction example.Intermediate · 5 minOct 18, 2026
  8. 27Prompts as Interfaces: Design Prompts Like API ContractsDesign prompts like API contracts: delimited inputs, a fixed output, a defined failure path, versions and tests. A real classifier prompt before and after.Intermediate · 4 minOct 18, 2026
  9. 28LLM as a Judge vs a Jury: Making AI Evaluations ReliableLLM-as-a-judge explained: position, length and self-preference bias, and how a jury of swapped orders, rubrics and mixed models fixes it. Real example.Intermediate · 5 minOct 18, 2026
  10. 29Why LLMs Fail Modified Puzzles: Pattern-Matching BiasWhy LLMs answer the famous version of a changed puzzle: training-data priors, research on counterfactual tasks, a real failure and how to prompt around it.Intermediate · 5 minOct 18, 2026
  11. 30How Context Shapes LLM Output: The Model Continues ItWhy LLMs copy the patterns in your context, flaws included: next-token prediction, Codex and multi-turn research, a real example and three fixes.Intermediate · 4 minOct 18, 2026
  12. 31Why LLMs Get Niche Facts Wrong: Popularity and Training DataWhy LLMs know popular facts but invent niche ones: accuracy tracks how often a fact appears in training data. When to retrieve instead. Real example.Intermediate · 5 minOct 18, 2026
  13. 32AI Code Hallucinations: Why Plausible Output Fools YouWhy LLM code looks right but fails: plausibility vs correctness, hallucinated packages, a real regex that broke, and how to verify output by running it.Intermediate · 4 minOct 18, 2026
  14. 33Are LLMs Black Boxes? What You Can and Can't InspectAre LLMs black boxes? Why model explanations can hide the real cause, and what you can inspect instead: context, tool calls, counterfactual tests.Intermediate · 5 minOct 18, 2026
  15. 34LLMs as Lossy Compression: Why They Can't Quote ExactlyWhy an LLM is a lossy compression of its training data: it keeps gist and loses exact wording, quotes and URLs. What to ask it for, with a real example.Intermediate · 4 minOct 18, 2026
  16. 35Why LLMs Give Similar Answers (and How to Get Variety)Why LLMs repeat the same kind of answer: mode collapse after RLHF. Get real variety with sets, named axes and verbalized sampling. Real naming example.Intermediate · 5 minOct 18, 2026
  17. 36ReAct Agent From Scratch in Python: The Reason-Act LoopBuild a ReAct agent from scratch in Python: the Thought, Action, Observation loop, a 60-line controller with a real trace, and how it maps to tool calling.Intermediate · 8 minOct 18, 2026
  18. 37Long-Form LLM Writing: Control Length, Structure, StyleGenerate long-form content with an LLM: outlines with word budgets, one section per call, style rules you can check in code. Real 1,200-word example.Intermediate · 8 minOct 18, 2026
  19. 38Long-Context Prompting: Placement, Structure and RAGLong-context prompting tactics: where to put documents and the question, how to tag sources, quote-then-answer, and when to retrieve instead of stuffing.Intermediate · 8 minOct 18, 2026
  20. 39What Are PAL and Program-of-Thought Prompting?PAL and Program-of-Thought prompting explained: the model writes code, an interpreter computes the answer. How they differ, when to use them, real example.Intermediate · 7 minOct 18, 2026
  21. 40LLM Routing: When to Use a Small vs Large ModelLLM routing explained: rules, LLM routers, learned routers and cascades to send each request to the cheapest model that works. A real router misroute.Intermediate · 7 minOct 18, 2026

Advanced14

  1. 41Active Prompting: Pick the Few-Shot Examples That MatterActive prompting explained: sample answers, measure disagreement, and annotate only the most uncertain inputs as few-shot examples. Runnable code, output.Advanced · 8 minOct 18, 2026
  2. 42Automatic Prompt Optimization: APE, ProTeGi and AMPOAutomatic prompt optimization explained: APE, ProTeGi, OPRO and multi-branch prompts, with one real optimization round on a ticket classifier in Python.Advanced · 9 minOct 18, 2026
  3. 43Prompt Ensembles and LLM Judges: Generate, Rank, RespondPrompt ensembles and rank-then-respond: generate candidates with prompt variants, rank them with an LLM judge, and correct for position bias. Real example.Advanced · 8 minOct 18, 2026
  4. 44Chain-of-Verification and SelfCheckGPT: Catch HallucinationsChain-of-Verification (CoVe) and SelfCheckGPT explained: draft, verify with independent questions, flag claims that samples disagree on. Real pitfalls.Advanced · 9 minOct 18, 2026
  5. 45Program-of-Thought in Python: Run Model Code SafelyCompute answers with model-written code in Python: an output contract, a locked-down Docker sandbox, a two-run check, and when to use a code tool instead.Advanced · 8 minOct 18, 2026
  6. 46Prompt Compression: LLMLingua and Lost in the MiddlePrompt compression techniques compared: selection, LLMLingua, summaries. Fix lost in the middle with reordering. Real example: 15,900 tokens cut to 1,400.Advanced · 9 minOct 18, 2026
  7. 47Directional Stimulus Prompting: Steer Output with HintsDirectional Stimulus Prompting explained: add a per-input hint, such as keywords, to steer what the model writes. Paper method plus a prompt-only build.Advanced · 7 minOct 18, 2026
  8. 48Skeleton-of-Thought: Outline First, Expand in ParallelSkeleton-of-Thought prompting: write the outline in one call, expand each point in parallel under a word budget. Runnable Python, real output, and limits.Advanced · 7 minOct 18, 2026
  9. 49Semantic Entropy: Detect When an LLM Is UnsureSemantic entropy explained: sample answers, group them by meaning, and use the entropy to decide when to answer, retrieve or abstain. Runnable Python code.Advanced · 8 minOct 18, 2026
  10. 50LLM Self-Correction: Self-Refine, Reflexion and CRITICLLM self-correction without fine-tuning: how Self-Refine, Reflexion and CRITIC work, why external feedback matters, and a real self-review vs test example.Advanced · 7 minOct 18, 2026
  11. 51LLM Tool Call Planning: Validate Plans Before ExecutingHave the LLM plan multi-step API calls as JSON, validate tools, arguments and guards in code, then execute safely. Python code and a real plan that failed.Advanced · 8 minOct 18, 2026
  12. 52Tree of Thoughts Prompting: How ToT Works and When to Use ItTree of Thoughts (ToT) and Graph of Thoughts explained: propose, score and prune reasoning steps, a runnable Game of 24 search, and cheaper modern options.Advanced · 9 minOct 18, 2026
  13. 53Self-Ask Prompting, Auto-CoT and Decomposition PromptsSelf-Ask prompting and Auto-CoT explained: split multi-hop questions into follow-ups, plug in search, and know when reasoning models need it. Real output.Advanced · 8 minOct 18, 2026
  14. 54Self-Consistency and Least-to-Most Prompting: When They HelpSelf-consistency and least-to-most prompting explained: how voting and decomposition work, real examples, and when reasoning models make them unnecessary.Advanced · 9 minOct 18, 2026
[n.02/02]> go further

Topics in this category

  • LLM Mental Models19
  • Hallucinations10
  • How LLMs Work8
  • Evals and Testing7
  • Grounding and Citations6
  • RAG (Retrieval-Augmented Generation)6
  • Chain-of-Thought5
  • Structured Outputs5
  • Tool Calling5
  • Context Engineering4

Topic hubs

  • Testing and evals→
  • Cost control and rate limits→
  • Models and providers→
  • Agent reasoning patterns→
  • Guardrails and security→
  • Observability and debugging→

Other categories

  • AI Engineering71
  • LLM Security10

Search every guide.

The library lists all guides with filters for topic, level, category and reading time.

All guidesLearning paths