The discipline of designing LLM inputs so outputs are accurate, structured, and repeatable. Start with best-practices, then read the deep-dives by topic.

Start here

  • best-practices: The seven strategies that converge across Palantir Foundry AIP, OpenAI, Microsoft Foundry, and Google Vertex AI. Read this first.
  • glossary: Comprehensive prompt-engineering glossary in question form (PAA-eligible). Every term grouped by category and linked to the deep-dive.

Patterns

How to structure a prompt for production use.

  • prompt-templates: Reusable template shapes with placeholders for instruction, primary content, examples, and constraints.
  • output-constraints: Specify length, format, schema, and exclusions so the output is parseable.
  • prompt-chaining: Multi-step prompt sequences when one prompt would overload the model.
  • reasoning-model-prompting: When and how to prompt reasoning-tuned models (Claude thinking, o-series) differently from chat models.

Production hardening

What to do before a prompt ships to users.

  • prompt-evals: Build an eval set, regression-test prompts on every change, ship only when the threshold passes.
  • prompt-injection-defense: Detect and mitigate prompt injection from user input, retrieved documents, and tool output.
  • prompt-caching-strategies: Structure prompts so cacheable prefixes are stable across requests, maximizing cache hit rate.

Deep-dives moved into this category

These were originally in ai-agents/ and now live here. Cross-category complements stay in ai-agents/.

  • structured-output: JSON mode and tool-use prompts for parseable output.
  • rag: Retrieval-augmented generation patterns.
  • mcp-servers: Model Context Protocol for tool wiring.

Glossary anchors

Atomic definitions for the prompt-engineering vocabulary.