Cheatsheets

Quick-Reference Guides

One-page references for the AI workflows you run every day. Skim the points, apply them, move on.

Prompt Engineering Basics

The core moves that make outputs reliable.

  • Give a clear role, task, and expected output format.
  • State constraints and success criteria explicitly.
  • Provide a worked example (few-shot) for consistency.
  • Ask the model to ask clarifying questions when ambiguous.

Agent Loop Anatomy

What makes an agent an agent, not a chatbot.

  • Plan → act → observe → reflect, in a loop.
  • Expose tools with clear names, params, and docs.
  • Feed tool results back into context, not just text.
  • Cap iterations and add guardrails for safety and cost.

RAG in One Page

Grounding answers in your own documents.

  • Chunk documents into sensible, overlapping pieces.
  • Embed chunks and store them in a vector database.
  • Retrieve the top-k nearest chunks for each query.
  • Pass retrieved context to the model with citations.

MCP Mental Model

How the Model Context Protocol connects tools.

  • A host (your app/IDE) talks to MCP servers.
  • Servers expose tools, resources, and prompts.
  • The model calls tools via a single standard interface.
  • One server can serve many clients — reuse, not rewrite.

Choosing a Model

Matching the model to the job.

  • Small + fast for classification and extraction at scale.
  • Large + reasoning for planning, code, and complex analysis.
  • Local/open-weight when privacy or cost dominates.
  • Re-benchmark when models change — results shift often.

Output Formats That Behave

Getting structured, parseable results.

  • Ask for JSON with an explicit schema, not 'some JSON'.
  • Validate output and retry with the error on failure.
  • Use strict mode / structured outputs when available.
  • Prefer one field per concept to avoid nesting drift.

Put these into practice

Pair the guides with ready-to-use prompts and the right tools.