Single logo
  • Courses
  • Blog
  • About
Join free on SkoolJoin free on Skool
  1. Blog
  2. /
  3. Learning paths
  4. /
  5. Prompt and Context Engineering

Learning path · 8 posts

Prompt and Context Engineering

Who it is for
Developers who call an LLM and want reliable, cheaper, testable prompts.
What you will achieve
Tune sampling, write explicit criteria, use few-shot examples, get typed output, cache prompts, version and test them, and decide what belongs in the context window of a long-running agent.
Prerequisites
Your first LLM API call
Start with step 1: Temperature, Top-p and Sampling

Curriculum

  1. 1
    Step 1: Temperature, Top-p and Sampling: Why the Same Prompt Gives a Different Answer

    A model scores every next word, softmax turns the scores into probabilities and one word is drawn. See what temperature and top-p do to that draw with six words, plain numpy and 1000 draws.

  2. 2
    Step 2: Explicit Criteria vs Vague Prompts: Turn Every Adjective Into a Check a Script Can Run

    Swap words like "better" and "professional" for criteria a script can mark pass or fail: 120 words, every number kept, no hedge words, three bullets. Then rewrite a vague meeting-notes prompt until all five rubric checks pass.

  3. 3
    Step 3: Few-Shot Prompting Done Right: How Many Examples, How Different, What Order, and the Leak That Lies

    Sort support tickets into billing, bug, feature or other by showing the model four worked examples: an easy case, a hard case, an edge case and a near miss. Then pick the count, the order and the shape, and keep the examples out of your test set.

  4. 4
    Step 4: Structured LLM Output with Pydantic: Describe the Shape Once, Check Every Reply

    An LLM replies with a string. Pydantic turns that string into a typed object or a clear error. Validate a User, generate its JSON Schema, then follow one customer e-mail through a Ticket model where the first reply says refund, fails the check, and the retry fits.

  5. 5
    Step 5: Prompt Caching: Keep the Start of Every Request Identical and Pay for the Long Part Once

    A shop help desk sends the same 1,373-token policy with every question. Keep that start byte-for-byte identical, mark it for caching, and the second call's input drops from $0.005608 to $0.000391. One timestamp at the top breaks it.

  6. 6
    Step 6: Prompt Versioning and Testing in a Repo: Prompt Files, a Registry, a Hash per Answer and Tests That Gate

    Treat prompts like code: one file per version, a registry.json that names the live one, a hash logged with every answer, a 12-ticket golden set (v1 0/12, v2 12/12) and 8 pytest tests that catch a careless label edit before review.

  7. 7
    Step 7: Context Engineering: What Belongs in the Context Window, Turn by Turn

    A support agent on turn twelve sends 1,679 tokens to the model, and the question is only 20 of them. Measure each part of the window, give it a budget, put it in the right order, and compact it to 1,089 tokens without losing the facts the next step needs.

  8. 8
    Step 8: Context Engineering for a Long-Running Agent: Clear, Compact, Take Notes, Prove It

    A support agent forgets the customer's name, order and contact choice after twenty turns and fails 0 of 4 checks. Measure the window, clear old tool output, compact old turns and keep a notes file, and the same chat passes 4 of 4 with 470 tokens instead of 2,945.

Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Single logo

Empowering Education, One Course at a Time

About
About usContact usFAQs
Legal
Terms of ServicePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.