# How to add prompts from the prompt library to your apps & agents

### **1. Adding a prompt to an app** <a href="#id-1.-adding-a-prompt-to-an-app" id="id-1.-adding-a-prompt-to-an-app"></a>

This is part of the broader process of creating an app using a knowledge base. To understand the complete app creation flow, refer to the [app creation guide](https://docs.zbrain.ai/zbrain-documentation/zbrain-builder/app/how-to-create-a-new-app).

To add a prompt from the prompt library during app setup:

* Click on the ‘Apps’ tab in the ZBrain Builder interface.
* Select the ‘+ Create’ button and enter all the details of the app in the ‘App Details’ section. Click ‘Next’.
* Go to 'Configure Bot'.
* In the ‘System Instructions’ section, click ‘Library’.

<figure><img src="/files/Li6Yv2ey1oa6orpsiuWn" alt=""><figcaption></figcaption></figure>

* Select ‘Add from Prompt Library’, and choose the prompt template you want.

<figure><img src="/files/7qLNYvwd6g9ciMQoGriG" alt=""><figcaption></figcaption></figure>

* Optionally, check ‘Import Prompt Settings’ to carry over the prompt’s model, temperature, top‑p, max tokens, etc and then click ‘Use’.

<figure><img src="/files/7MhJAWGAaBBOFb8UXzlA" alt=""><figcaption></figcaption></figure>

This method reuses existing prompts, keeping consistency and saving setup time.

### **2. Adding a prompt to an agent** <a href="#id-2.-adding-a-prompt-to-an-agent" id="id-2.-adding-a-prompt-to-an-agent"></a>

This is one segment of the comprehensive agent creation process. To understand the entire workflow, please refer to [Creating custom AI agents | ZBrain Documentation](https://docs.zbrain.ai/zbrain-documentation/zbrain-builder/zbrain-ai-agents/creating-custom-ai-agents).

To use a prompt from the prompt library while defining an agent’s flow:

* From the ZBrain Builder, go to the ‘Agents’ tab and start creating a new agent.
* After filling out the required details, proceed to the 'Define Flow' step.

<figure><img src="/files/Il34nEXmsU7KYSLPEkZ7" alt=""><figcaption></figcaption></figure>

* Inside the visual flow builder, click on the ‘+’ button to add a new tool/action in the sequence.
* Search for ZBrain and select ‘Ask AI Model’ from the list of available actions.

<figure><img src="/files/tycf3OKhg8u5K5H87KuU" alt=""><figcaption></figcaption></figure>

* In the side panel that appears, configure the model, input variables, and other options as needed.
* Under the ‘Prompt Library’ dropdown, select the prompt template you want to use.

<figure><img src="/files/7eYwFEfKuPSTBkM39AdN" alt=""><figcaption></figcaption></figure>

This inserts a predefined prompt into your agent’s logic without writing it from scratch.

The rest of the steps for agent setup, like connecting outputs, configuring inputs, and managing access, remain the same.

### **Benefits of using the prompt library** <a href="#benefits-of-using-the-prompt-library" id="benefits-of-using-the-prompt-library"></a>

| Benefit            | Description                                                                  |
| ------------------ | ---------------------------------------------------------------------------- |
| Standardized reuse | Maintain consistency by using the same prompts in different apps and agents. |
| Reduces errors     | Using pre-tested prompts lowers the chances of logic or formatting issues.   |
| Faster setup       | Avoid rebuilding prompts, select and plug them in.                           |

***


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zbrain.ai/zbrain-documentation/zbrain-builder/prompts/how-to-add-prompts-from-the-prompt-library-to-your-apps-and-agents.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
