> For the complete documentation index, see [llms.txt](https://docs.blockbrain.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blockbrain.ai/for-users/prompt-writing-guide/mistral-models-prompt-guide.md).

# Mistral Models Prompt Guide

Mistral responds to precise and role-based prompting.

**Table of Contents**

1. [Give the Model a Clear Purpose](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-1-give-the-model-a-clear-purpose)
2. [Structure Prompts Clearly](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-2-structure-prompts-clearly)
3. [Use Formatting](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-3-use-formatting)
4. [Add examples when Accuracy or Format Matters](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-4-add-examples-when-accuracy-or-format-matters)
5. [Don't Overuse Reasoning](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-5-dont-overuse-reasoning)
6. [Avoid Subjective Words](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-6-avoid-subjective-words)
7. [Avoid Self Count of Words or Characters](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-7-avoid-self-count-of-words-or-characters)
8. [Use Worded Scales over Numeric Scales](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-8-use-worded-scales-over-numeric-scales)
9. [Prompt Templates](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-9-prompt-templates)

***

### 1. Give the Model a Clear Purpose

Mistral recommends defining a clear purpose early, often through a simple role-and-task setup like: **“You are a \<role>, your task is to \<task>.”**

**Less Effective**

```
Analyze this customer feedback.
```

**More Effective**

```
You are a customer insights analyst. 
Your task is to review this customer feedback and identify
the top 3 recurring complaints.
```

*Tip: Lead with role + task before adding detailed instructions.*

***

### 2. Structure Prompts Clearly

Mistral explicitly recommends organizing prompts hierarchically with clear sections and subsections.

A good structure often includes:

* Context
* Task
* Instructions or steps
* Constraints
* Output format

**Unclear Prompt**

```
Review this text and tell me what matters.
```

**Clear Prompt**

```
Context: Internal Q2 review for non-technical executives
Task: Summarize the document
Instructions:

Identify the 3 most important insights

Remove technical jargon

Note any major risks or opportunities
Constraints: Keep under 200 words
Output Format: 3 bullets only
```

***

### 3. Use Formatting

Formatting is a core prompting tool. It's best to use structures such as markdown and/or XML-style tags because they are readable, parsable, and familiar to models.

**Recommended formats:**

* Markdown headings
* Bullets and numbered steps
* XML-style sections like `<context>`, `<task>`, `<constraints>`

**Example**

```
<context>
This will be used in a board presentation.
</context>

<task>
Summarize the report for executives.
</task>

<constraints>
- Use plain language
- Keep under 120 words
- Output only bullet points
</constraints>
```

*Tip: The more complex the task, the more important formatting becomes.*

***

### 4. Add examples when Accuracy or Format Matters

Use example prompting, especially few-shot prompting, when you want better accuracy or tighter control over output format.

**This is especially useful for:**

* classification
* extraction
* tagging
* JSON outputs
* repeated formatting tasks

```
# Task
Detect the language of the input text.

# Examples
Input: Hello, how are you?
Output: {"language_iso": "en"}

Input: Bonjour, comment allez-vous?
Output: {"language_iso": "fr"}
```

**Tip:** If output structure matters, show the model at least one example of the exact format you want.

***

### 5. Avoid Subjective Words

Words like “too long,” “interesting,” “better,” “some,” or “a few” are vague. Mistral recommends replacing them with objective measures.

**Instead of:** Make it shorter\
**Use:** Keep it under 120 words

***

### 6. Avoid Self Count of Words or Characters

Mistral advises against relying on the model to calculate thresholds itself. If length matters operationally, pass the count in as data instead.

***

### 7. Avoid Contradictions

As the system prompt gets longer, slight contradictions may occur. If the instructions require complex conditions, use a decision tree format.

```
# How to update database records:
- If the data does not include new information:
  - Ignore this data.
- Otherwise, if the data directly contradicts the existing record:
  - Delete the existing record and create a new one.
```

***

### 8. Use Worded Scales over Numeric Scales

For evaluations, Mistral recommends labels like Very Low, Low, Neutral, Good, Very Good instead of a raw 1–5 scale.

***

### 9. Prompt Templates

#### General Task Template

```
System:
You are a [role]. Your task is to [goal].

User:
## Context
[Background and audience]

## Task
[Exactly what you want done]

## Instructions
1. [Step one]
2. [Step two]
3. [Step three]

## Constraints
- [Tone]
- [Length]
- [What to avoid]

## Output Format
[Bullets, table, JSON, paragraph, etc.]
```

#### Few Shot Template

```
System:
You are a [role]. Follow the examples exactly.

User:
## Task
Classify each input into one category.

## Categories
- Positive
- Neutral
- Negative

## Examples
Input: "This product is amazing."
Output: Positive

Input: "It arrived yesterday."
Output: Neutral

Input: "It broke after one use."
Output: Negative

## New Input
[Insert text here]

## Output Format
Return only the category.
```

#### Structured Output Template

```
System:
You are an extraction assistant.

User:
## Task
Extract the key details from the text.

## Fields
- company
- product
- launch_date
- summary

## Constraints
- Return valid JSON only
- Use null if a field is missing
- Do not add extra keys
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.blockbrain.ai/for-users/prompt-writing-guide/mistral-models-prompt-guide.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
