> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/en/build/agent/add-system-prompt.md).

# Add a System Prompt to an AI Assistant

Once you have written your system instructions, add them in the MaiAgent AI agent settings:

## Add System Instructions <a href="#add-system-prompt" id="add-system-prompt"></a>

### 1. Open the AI agent settings <a href="#step-1-navigate-to-ai-agent-settings" id="step-1-navigate-to-ai-agent-settings"></a>

In the left menu, select <mark style="color:blue;">AI Features</mark> > <mark style="color:blue;">AI Agents</mark>. Find the AI agent you want to configure, then click the <mark style="color:blue;">Edit</mark> icon in its <mark style="color:blue;">Actions</mark> column.

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-4d2b79176a41568cb0cd9e0dc9e201b5671a6a6a%2Fai-agent-list-edit-button.png?alt=media" alt="AI agent list with the Edit icon highlighted in the Actions column"><figcaption><p>Click the Edit icon in the Actions column to open the AI agent settings</p></figcaption></figure>

### 2. Switch to the answer mode settings <a href="#step-2-switch-to-answer-mode-settings" id="step-2-switch-to-answer-mode-settings"></a>

Under the <mark style="color:blue;">Settings</mark> tab, select <mark style="color:blue;">Answer Mode Settings</mark> from the menu on the left.

Set <mark style="color:blue;">Answer Mode</mark> to <mark style="color:blue;">RAG Q\&A</mark> or <mark style="color:blue;">Agent Mode</mark>, or expand <mark style="color:blue;">Other Modes</mark> and select <mark style="color:blue;">Hybrid</mark>:

{% hint style="warning" %}
System instructions are unavailable in <mark style="color:blue;">Template</mark> mode (under <mark style="color:blue;">Other Modes</mark>).
{% endhint %}

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-b814b654848f855a4cfe488c9517e7388c11cb3a%2Fai-agent-reply-mode-settings.png?alt=media" alt="Answer Mode Settings on the Settings tab, showing RAG Q&#x26;A, Agent Mode, and Other Modes"><figcaption><p>Select an answer mode in Answer Mode Settings</p></figcaption></figure>

### 3. Enter text in the system instructions section <a href="#step-3-enter-text-in-system-prompt-section" id="step-3-enter-text-in-system-prompt-section"></a>

On the same page, enter your instructions in the <mark style="color:blue;">System Instructions</mark> section below. Then click <mark style="color:blue;">Save</mark> in the bottom right.

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-f56ca83283c5e1689fde5ff2f3808aa9ac70d906%2Fai-agent-instructions-field.png?alt=media" alt="System Instructions section with usage tips, quick prompt insertion, and a text box"><figcaption><p>Enter text in the System Instructions section</p></figcaption></figure>

Your AI agent will now act according to the system instructions you defined.


---

# 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.maiagent.ai/maiagent-user-guide/en/build/agent/add-system-prompt.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.
