PromptisePromptise
PlatformSoonEnterprise
DocsGitHub
Talk to usGet started
Promptise - AI Framework LogoPromptise

The full-stack framework for agentic systems. Build with the framework. Run it on the platform. Launch it with our engineers.

pip install promptise

[01] Product

  • Framework
  • Platform (coming soon)
  • Enterprise
  • How it works
  • Contact

[02] Framework

  • The Agent
  • The Interface
  • The Harness

[03] Resources

  • Documentation
  • GitHub
  • Why Promptise
  • Use cases
  • Roadmap
  • Guides
  • Learning Paths
  • Questions

[04] Company

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

© 2026 Promptise by Manser Ventures. All rights reserved.

hello@promptise.com
← 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.

54
guides
19
Beginner
21
Intermediate
14
Advanced
6 h
of reading

Featured · start here

What Is Prompt Engineering? A Beginner's Guide with Examples

What 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 minRead the guide →

53 guides

Beginner18

  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 minPrompt EngineeringBeginner · 4 minPrompt Engineering→
  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 minPrompt EngineeringBeginner · 5 minPrompt Engineering→
  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 minPrompt EngineeringBeginner · 5 minPrompt Engineering→
  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 minPrompt EngineeringBeginner · 7 minPrompt Engineering→
  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 minPrompt EngineeringBeginner · 7 minPrompt Engineering→
  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 minPrompt EngineeringBeginner · 6 minPrompt Engineering→
  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 minPrompt EngineeringBeginner · 6 minPrompt Engineering→
  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 minPrompt EngineeringBeginner · 8 minPrompt Engineering→
  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 minAI at workBeginner · 7 minAI at work→
  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 minPrompt EngineeringBeginner · 7 minPrompt Engineering→
  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 minPrompt EngineeringBeginner · 8 minPrompt Engineering→
  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 minTesting and evalsBeginner · 7 minTesting and evals→
  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 minPrompt EngineeringBeginner · 7 minPrompt Engineering→
  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 minPrompt EngineeringBeginner · 7 minPrompt Engineering→
  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 minPrompt EngineeringBeginner · 6 minPrompt Engineering→
  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 minPrompt EngineeringBeginner · 6 minPrompt Engineering→
  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 minPrompt EngineeringBeginner · 8 minPrompt Engineering→
  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 minPrompt EngineeringBeginner · 6 minPrompt Engineering→

Intermediate21

  1. 19Can 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 minPrompt EngineeringIntermediate · 5 minPrompt Engineering→
  2. 20Does 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 minPrompt EngineeringIntermediate · 5 minPrompt Engineering→
  3. 21How 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 minPrompt EngineeringIntermediate · 5 minPrompt Engineering→
  4. 22Why 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 minGuardrails and securityIntermediate · 5 minGuardrails and security→
  5. 23Why 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 minPrompt EngineeringIntermediate · 5 minPrompt Engineering→
  6. 24How 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 minPrompt EngineeringIntermediate · 4 minPrompt Engineering→
  7. 25Prompts 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 minTesting and evalsIntermediate · 5 minTesting and evals→
  8. 26Prompts 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 minTesting and evalsIntermediate · 4 minTesting and evals→
  9. 27LLM 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 minTesting and evalsIntermediate · 5 minTesting and evals→
  10. 28Why 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 minPrompt EngineeringIntermediate · 5 minPrompt Engineering→
  11. 29How 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 minPrompt EngineeringIntermediate · 4 minPrompt Engineering→
  12. 30Why 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 minPrompt EngineeringIntermediate · 5 minPrompt Engineering→
  13. 31AI 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 minTesting and evalsIntermediate · 4 minTesting and evals→
  14. 32Are 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 minObservability and debuggingIntermediate · 5 minObservability and debugging→
  15. 33LLMs 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 minPrompt EngineeringIntermediate · 4 minPrompt Engineering→
  16. 34Why 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 minPrompt EngineeringIntermediate · 5 minPrompt Engineering→
  17. 35ReAct 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 minAgent reasoning patternsIntermediate · 8 minAgent reasoning patterns→
  18. 36Long-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 minPrompt EngineeringIntermediate · 8 minPrompt Engineering→
  19. 37Long-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 minPrompt EngineeringIntermediate · 8 minPrompt Engineering→
  20. 38What 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 minPrompt EngineeringIntermediate · 7 minPrompt Engineering→
  21. 39LLM 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 minModels and providersIntermediate · 7 minModels and providers→

Advanced14

  1. 40Active 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 minPrompt EngineeringAdvanced · 8 minPrompt Engineering→
  2. 41Automatic 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 minTesting and evalsAdvanced · 9 minTesting and evals→
  3. 42Prompt 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 minPrompt EngineeringAdvanced · 8 minPrompt Engineering→
  4. 43Chain-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 minPrompt EngineeringAdvanced · 9 minPrompt Engineering→
  5. 44Program-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 minPrompt EngineeringAdvanced · 8 minPrompt Engineering→
  6. 45Prompt 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 minCost control and rate limitsAdvanced · 9 minCost control and rate limits→
  7. 46Directional Stimulus Prompting: How Hints Improve OutputDirectional stimulus prompting adds a per-input hint, such as keywords, so the AI's response keeps what matters. How it works, plus a prompt-only build.Advanced · 7 minPrompt EngineeringAdvanced · 7 minPrompt Engineering→
  8. 47Skeleton-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 minPrompt EngineeringAdvanced · 7 minPrompt Engineering→
  9. 48Semantic 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 minPrompt EngineeringAdvanced · 8 minPrompt Engineering→
  10. 49LLM 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 minTesting and evalsAdvanced · 7 minTesting and evals→
  11. 50LLM 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 minPrompt EngineeringAdvanced · 8 minPrompt Engineering→
  12. 51Tree 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 minPrompt EngineeringAdvanced · 9 minPrompt Engineering→
  13. 52Self-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 minPrompt EngineeringAdvanced · 8 minPrompt Engineering→
  14. 53Self-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 minPrompt EngineeringAdvanced · 9 minPrompt Engineering→

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→
  • AI at work→
  • Models and providers→
  • Agent reasoning patterns→
  • Guardrails and security→

Other categories

  • AI Engineering147
  • AI at Work18
  • AI Leadership12
  • LLM Security10
  • Enterprise AI8

Search every guide.

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

All guidesLearning paths