← Glossary

Prompt

A text input instruction passed to an AI model that defines the task to be performed

What is a Prompt?

A prompt (often described as an "instruction") is the input passed to an LLM (Large Language Model) that determines its response. In the context of building apps and automations, a prompt is not an ordinary question but a precise piece of code in natural language that programs the model's behavior.

The quality of the model's response is directly proportional to the quality of the prompt (the Garbage In, Garbage Out principle).

Anatomy of a professional prompt

In prompt engineering, an effective instruction usually consists of four key elements:

  1. Instruction (Persona): Defining the role the model should take on (e.g. "You are a Senior Python Developer").
  2. Context: Providing the necessary background information, input data or constraints.
  3. Task: A precise description of the action to be performed (e.g. "Analyze the code below and find logical errors").
  4. Output format: Defining what the response should look like. This is key when integrating with other systems (e.g. "Return the result only in JSON format").

Prompts in automations (Dynamic)

When building AI apps, static prompts are rarely used. Most often, templates are used, in which variables are swapped dynamically while the program runs. An example structure in LangChain or n8n:

"Analyze the content of the email: {{email_body}} and extract the meeting date from it in the YYYY-MM-DD format."

Advanced techniques

To get better results in complex tasks, optimization techniques are used:

  • Few-Shot Prompting: Giving the model a few examples (question-answer pairs) inside the prompt to teach it the expected pattern.
  • Chain of Thought (CoT): Forcing the model to "think out loud" (e.g. the instruction "Think step by step"), which significantly improves its logical reasoning abilities.