← Back to DocsRecipe

Prompt Engineering Basics

The quality of your output depends on the quality of your input. Learn the foundational techniques that turn vague requests into precise, useful results.

Be Specific

Vague prompts produce vague answers. Instead of “write a blog post,” specify the topic, audience, tone, length, and format. The more constraints you provide, the closer the output matches your intent.

Provide Context

Give the model background information. Who are you? What is the goal? What came before this request? Context anchors the response and prevents generic answers.

Use Examples

Show, don’t just tell. Include a sample input-output pair. Few-shot prompting dramatically improves consistency in style, structure, and formatting.

Assign a Role

Start with “You are a senior software engineer” or “Act as a financial analyst.” Role assignment sets the expertise level and perspective of the response.

Iterate

Prompt engineering is a conversation. If the first output isn’t right, refine your prompt. Add constraints, clarify ambiguity, or ask the model to explain its reasoning.

Quick Tip

Combine techniques for best results. A role + context + example + specific output format is far more powerful than any single technique alone.