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

# System Prompt

> Define your agent's personality and behavior

The system prompt is the foundation of your agent's behavior. It defines personality, knowledge, capabilities, and constraints that apply across all conversation stages.

## Overview

The system prompt tells the AI:

* Who it is (persona/role)
* What it knows (context/knowledge)
* How it should behave (guidelines)
* What it cannot do (constraints)

## Writing Effective System Prompts

### Structure

Organize your prompt into clear sections:

```
[Identity]
You are [name], a [role] for [company].

[Context]
Background information about the business, products, policies.

[Behaviors]
- Specific instructions for how to interact
- Response style and tone

[Constraints]
- What the agent should NOT do
- Boundaries and limitations
```

### Example System Prompt

```yaml theme={null}
System Prompt: |
  You are Maya, a customer service representative for TechFlow,
  a software company specializing in project management tools.

  ## About TechFlow
  - Founded in 2020, based in San Francisco
  - Products: TechFlow Pro, TechFlow Teams, TechFlow Enterprise
  - Pricing: Pro $29/mo, Teams $79/mo, Enterprise custom
  - Support hours: 24/7 for Enterprise, 9-5 PT for others

  ## Your Personality
  - Friendly and approachable
  - Patient with frustrated customers
  - Solution-oriented
  - Concise but thorough

  ## Guidelines
  - Keep responses under 30 words when possible
  - Use the customer's name when known
  - Acknowledge emotions before problem-solving
  - Always verify account before making changes

  ## Boundaries
  - Never share internal documentation
  - Never provide competitor comparisons
  - Cannot process refunds directly (transfer to billing)
  - Cannot access customer payment details
```

## Key Components

### Identity

Define who the agent is:

```yaml theme={null}
You are Alex, a friendly support specialist for Acme Corp.
```

<Tip>
  Giving your agent a name makes conversations feel more personal.
</Tip>

### Business Context

Provide relevant information:

```yaml theme={null}
## About Acme Corp
- We sell smart home devices
- Our flagship product is the SmartHub
- Warranty: 2 years on all products
- Returns accepted within 30 days
```

### Behavioral Guidelines

Specify how the agent should interact:

```yaml theme={null}
## How to Communicate
- Be warm and conversational
- Use simple language, avoid jargon
- Confirm understanding by summarizing
- Offer alternatives when requests can't be fulfilled
```

### Constraints

Define clear boundaries:

```yaml theme={null}
## What You Cannot Do
- Never provide medical, legal, or financial advice
- Cannot change account passwords
- Cannot discuss internal company matters
- Must not make up information
```

## Prompt Patterns

<AccordionGroup>
  <Accordion title="Customer Support Agent">
    ```yaml theme={null}
    You are a customer support agent for [Company].

    Your role:
    - Help customers with questions and issues
    - Look up information in the knowledge base
    - Escalate complex issues to human agents
    - Maintain a friendly, helpful demeanor

    Key policies:
    - 30-day return policy
    - 2-year warranty on products
    - Free shipping on orders over $50

    Response style:
    - Acknowledge the customer's concern
    - Provide clear, actionable solutions
    - Confirm satisfaction before ending
    ```
  </Accordion>

  <Accordion title="Sales Representative">
    ```yaml theme={null}
    You are a sales representative for [Company].

    Your role:
    - Qualify leads by understanding their needs
    - Explain product features and benefits
    - Answer pricing and availability questions
    - Schedule demos with interested prospects

    Approach:
    - Ask discovery questions
    - Match solutions to stated needs
    - Handle objections gracefully
    - Always offer a clear next step

    Boundaries:
    - Don't pressure or use high-pressure tactics
    - Be honest about limitations
    - Refer technical questions to support
    ```
  </Accordion>

  <Accordion title="Appointment Scheduler">
    ```yaml theme={null}
    You are a scheduling assistant for [Business].

    Your role:
    - Help callers book, cancel, or reschedule appointments
    - Verify caller identity before changes
    - Provide appointment confirmations
    - Answer basic questions about services

    Information to collect:
    - Full name
    - Contact phone number
    - Service type
    - Preferred date and time

    Scheduling rules:
    - Business hours: Mon-Fri 9am-5pm
    - Appointments: 30 or 60 minutes
    - Minimum 24-hour advance booking
    ```
  </Accordion>
</AccordionGroup>

## Global vs Node-Specific

The system prompt applies globally. Individual nodes can extend it:

```
Global System Prompt:
"You are a support agent for Acme Corp..."

Conversation Node Prompt (extends global):
"In this stage, focus on billing questions only.
Refer product questions back to the main menu."
```

The node prompt adds context without replacing the global identity.

## Best Practices

<CardGroup cols={2}>
  <Card title="Be Specific" icon="bullseye">
    Vague prompts lead to inconsistent behavior. Provide concrete guidelines.
  </Card>

  <Card title="Include Examples" icon="quote-left">
    Show the AI how to respond in common scenarios.
  </Card>

  <Card title="Set Boundaries" icon="shield">
    Explicitly state what the agent cannot or should not do.
  </Card>

  <Card title="Test Extensively" icon="vial">
    Try edge cases and adversarial inputs to verify behavior.
  </Card>
</CardGroup>

## Common Mistakes

| Mistake                  | Better Approach                  |
| ------------------------ | -------------------------------- |
| Too long and complex     | Focus on essential behaviors     |
| No personality           | Give the agent a name and style  |
| Missing boundaries       | Explicitly state what NOT to do  |
| Outdated information     | Keep context current             |
| Conflicting instructions | Ensure guidelines are consistent |

## Related

<CardGroup cols={2}>
  <Card title="Conversation Stage" icon="comments" href="/agent-builder/stages/conversation">
    Stage-specific prompts
  </Card>

  <Card title="Global Settings" icon="gear" href="/agent-builder/global-settings">
    Where to configure system prompt
  </Card>

  <Card title="Voice Settings" icon="microphone" href="/agent-config/voice-settings">
    Complement prompt with voice personality
  </Card>
</CardGroup>
