> ## Documentation Index
> Fetch the complete documentation index at: https://platform.perso.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Prompt

Prompts define how your AI Human interacts with users. They control the system instructions sent to the Large Language Model (LLM) that generates responses during conversations.

## **Overview**

Prompts are essential for customizing the personality, tone, and behavior of your AI Human. You can create multiple prompts for different use cases and select the appropriate one when creating sessions.

[<u>Set Prompts here →</u>](https://platform.perso.ai/perso-interactive/b2c/background-images/)\\

## **Listing Prompts**

Navigate to the Resources page and select the "Prompt" tab to view all prompts in your organization.

The list displays:

* **Prompt ID**: Unique identifier for the prompt
* **Name**: The name you assigned to the prompt
* **Created At**: When the prompt was created
* **Last Used At**: When the prompt was last used in a session
* **Action**: Delete button to remove the prompt

## **Viewing Prompt Details**

Click on a Prompt ID to view its details. From the detail page, you can:

* View the full system prompt
* Edit all prompt fields
* Delete the prompt

## **Creating Prompts**

To create a new prompt:

1. Click the **"Add New Prompt"** button from the Prompts list page
2. Fill in the form:

### **Name**

Enter a descriptive name for your prompt. This helps you identify and organize different prompts.

### **Description (Optional)**

Provide a brief description of what this prompt is used for. This is helpful for documentation and team collaboration.

### **System Prompt**

The system prompt is the core instruction sent to the LLM. This defines:

* The AI's personality and tone
* The scope of topics it should cover
* How it should respond to different situations
* Any specific guidelines or constraints

**Example:**

```text theme={null}
You are a friendly customer service representative for an e-commerce company. 
You should be helpful, professional, and concise. Always greet customers warmly 
and focus on solving their problems efficiently.
```

### **⚠️ Require Document**

This checkbox enables Retrieval-Augmented Generation (RAG) for the prompt.

**When enabled:**

* The system prompt **must** include a `{context}` placeholder
* The system will search your documents and replace `{context}` with relevant information
* This allows the AI to answer questions based on your uploaded documents

**Example with RAG:**

System Prompt:

```text theme={null}
You should answer questions regarding fruits using the following data: {context}
```

When a user asks "What is the price of apples?", the system will:

1. Search your documents for relevant information about apples
2. Replace `{context}` with the search results
3. Send the complete prompt to the LLM

Resulting prompt:

```text theme={null}
You should answer questions regarding fruits using the following data: 
[name]: apple [price]: 3 [description]: honey crisp
```

### **Intro Message (Optional)**

If provided, the AI Human will automatically deliver this message when a user connects to the session, even before they send any input.

**Use cases:**

* Greeting users
* Providing initial instructions
* Setting expectations for the conversation

**Example:**

```text theme={null}
Hello! I'm here to help you with any questions about our products. 
How can I assist you today?
```

## **Best Practices**

### **Writing Effective System Prompts**

1. **Be specific**: Clearly define the AI's role and responsibilities
2. **Set boundaries**: Specify what topics the AI should and shouldn't discuss
3. **Define tone**: Indicate whether the AI should be formal, casual, friendly, etc.
4. **Include examples**: Provide example interactions when helpful
5. **Use conditional logic**: Guide behavior for different scenarios

### **Using RAG Effectively**

1. **Always include** `{context}`: The placeholder is required when RAG is enabled
2. **Structure your prompt**: Place `{context}` where it makes sense in your instructions
3. **Set expectations**: Tell the AI how to use the context data
4. **Test thoroughly**: Verify that document search results are being used correctly

### **Managing Multiple Prompts**

* Create separate prompts for different use cases (customer service, sales, support, etc.)
* Use descriptive names to easily identify prompts
* Review "Last Used At" to identify unused prompts that can be archived

## **Using Prompts**

When creating a new session, you can specify a `prompt` parameter using the Prompt ID. The selected prompt will be used for all conversations in that session.

## **Deleting Prompts**

To delete a prompt:

1. Navigate to the Prompts list
2. Click the delete button (trash icon) in the Action column
3. Confirm the deletion

**Note**: Deleting a prompt will not affect existing sessions that were created with that prompt, but new sessions will not be able to use it.
