---
title: Create an example multi-turn specialized agent walkthrough
slug: agent-platform/docs/create-an-example-multi-turn-specialized-agent-walkthrough
docTags: 
createdAt: 2026-08-12T15:37:10.000Z
---

Specialized agents in Agent Platform are purpose-built AI agents you create that complete a single, well-defined task. Each agent can use targeted tools, adjustable reasoning, and defined inputs to finish its task accurately and efficiently. Specialized agents support two interaction modes: single-shot, where the agent runs once and returns a result, and multi-turn, where the agent stays active in [Mark chat](../../use-opal/opal-chat/access-and-explore-opal-chat.mdx) for iterative follow-up.

This document walks you through creating an example multi-turn specialized agent. Unlike a single-turn agent that processes one request and completes, a multi-turn agent maintains conversation context across multiple exchanges. This lets you have ongoing dialogue and answer follow-up questions within a single session. Use a multi-turn agent when you want users to review multiple items, ask clarifying questions, and build on previous findings all in a single session. This avoids triggering a separate request each time.

## Prerequisites

Before developing your specialized agent, ensure the following:

- You read and understand the content in the [Specialized agents fundamentals and best practices](docId\:bDeUnJYXOZjhodVf7vcxg) documentation.
- You have [Mark administrator](docId\:pe0pbUJveWrG8ewvZWDRE) access credentials.
- Mark is integrated with the relevant Optimizely applications and products required for your use case. See [Mark and AI features](docId:51wG_l34ATUNcLespgC-G) to confirm whether Mark is integrated.

## Real-world example: Compliance Advisory agent

Objective – Create a multi-turn specialized agent that engages in ongoing, conversational compliance reviews. In this scenario, the agent reviews website content against Financial Conduct Authority (FCA) financial promotion guidelines and maintains full conversation context across a session. Users can review multiple URLs in sequence, ask follow-up questions about findings, and request comparative analysis across sites. Unlike the single-turn [Content Review agent](docId\:JF1C3-9z8FNrPWkVneoUg), users drive this agent interactively through [Mark chat](docId\:dtNBEttEGVvkhNkwNypLM) rather than triggering a single automated execution.

## Build a specialized agent

The development process for the example Compliance Advisory agent follows this workflow: **Create > Configure > Build > Test > Refine > Deploy**. Compared to [the example single-turn agent](docId\:JF1C3-9z8FNrPWkVneoUg), this walkthrough includes two additional configuration steps. The **System Prompt** that defines the agent's persistent behavior, and the **Token Budget** controls how much conversation history the agent retains.

## Create your specialized agent

1. Go to [home.optimizely.com](https://home.optimizely.com).
2. Select your organization.
3. Click **Mark**.

   ![Screenshot of the Optimizely World Organization page where Mark is one of the quick link tiles](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/IJp9Lul9HZT1dGYaFbve4_mark-card-on-welcome-back-page0.png)
4. Click **Agents**.

   ![Screenshot of the Mark left menu where the Agents option displays](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/rq62wY7Qz3MLcZ5wzhi5d_mark-chat-reusables-agents-menu-item0.png)
5. Select the **Your Agents** tab.

   ![Screenshot of Agents where the Your Agents tab displays](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/6aS1CBibkuJv4Ya7nB1Y3_mark-chat-reusables-agents-your-agents-tab0.png)
6. Click **Add Agent > Specialized agent** to create a specialized agent.

## Configure your specialized agent

### Details section

You begin crafting your specialized agent in the **Details** section. This section contains basic information about your specialized agent. See the [Details section in the Specialized agents fundamentals and best practices documentation](docId\:bDeUnJYXOZjhodVf7vcxg) for details.

1. Enter the following information:
   - **Name** – *Compliance Advisory agent*
   - **Id** – *compliance-advisory-agent*
   - **Description** – *A conversational compliance advisor that reviews website content against FCA financial promotion guidelines. Maintains conversation context to enable iterative review, follow-up questions, and comparative analysis across multiple URLs in a single session.*
2. Leave **Active** on.
3. Toggle **Multi-turn** on. Enabling multi-turn lets the agent maintain conversation history and context across every exchange in a session.
4. Leave **Enabled in Chat** on. Users interact with this agent conversationally through Mark chat.

Your agent details should appear similar to the following:

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/KX_UbqmxcsQ-_9a7QQHz8_details-compliance-advisory-agent-details-form.png)

The **Id** serves as the identifier for @mentioning the agent and must not contain spaces. Ensure the **Id** displays as **Available**. If it does not, that means there is an agent already created with this Id. Enter a different Id instead.

## Build your specialized agent

### System Prompt section

The **System Prompt** defines your agent's persistent persona and standing instructions that apply across every turn in the conversation. Unlike the **Prompt Template**, which sets up the initial task, the **System Prompt** remains active throughout the entire session, shaping how your agent responds regardless of what the user asks.

Enter the following in the **System Prompt** field of your specialized agent.

System Prompt example

*You are a senior compliance advisor specializing in FCA financial promotion regulations. Your role is to help users review website content for compliance through ongoing conversation.*

*Always:*

- *Introduce yourself briefly at the start of each new conversation and invite the user to share a URL for review.*
- *Remember all URLs reviewed and findings discussed during this conversation. Reference prior context when answering follow-up questions.*
- *Offer comparative analysis when the user has reviewed multiple sites in the same session.*
- *Use a professional, clear, and empathetic tone. Explain compliance terms in plain language when introducing them.*
- *After each review, invite the user to ask follow-up questions or submit another URL.*

### Input section

The **Input** section is where you add directions your specialized agent should follow, variables it should prompt the user for, and tools it should use to accomplish its task. See the [Input section in the Specialized agents fundamentals and best practices documentation](docId\:bDeUnJYXOZjhodVf7vcxg) for details.

**Prompt template**

The prompt template provides the initial instruction set your agent follows at the start of each conversation. For multi-turn agents, structure the template to guide iterative interaction rather than a single, self-contained task.

Expand the following **Prompt Template example** and enter it in the **Prompt template** in your specialized agent.

Prompt template example

### ***C – Context***

- ***Your Role:** You are a senior compliance advisor with expertise in FCA financial promotion regulations. You conduct multi-turn compliance reviews — helping users assess one or more URLs through ongoing conversation.*
- ***Deliverable:** You provide structured compliance assessments for each URL reviewed and maintain awareness of all prior findings in this conversation to support comparative analysis.*
- ***Communication Style:** Clear, professional, and conversational. Acknowledge prior context where relevant. Invite follow-up questions after each review.*

### ***L – Logic***

- *When a URL is provided (via \[\[url]] or shared in the conversation), conduct a structured compliance review using the FCA-guidelines.pdf reference document.*
- *Each review must include: an Executive Summary with an overall compliance score, Issue Categorization using color coding (major issues in red, minor issues in amber, compliant areas in green with justification for all flagged items), and Report Sections in this order: Tone of Voice, Accessibility, Clarity, and Regulations.*
- *After each review, invite the user to ask follow-up questions or provide another URL.*
- *If the user asks to compare sites reviewed in this conversation, draw on your full conversation context to provide a clear comparative summary.*

### ***E – Examples***

- *When a user asks "How does this compare to the last site I reviewed?" — reference the findings from the previous review and provide a direct comparison of compliance scores and key issues.*
- *When a user asks "Can you explain why that was flagged?" — provide a plain-language explanation of the relevant FCA guideline and the specific flagged content.*

### ***A – Action***

- *If \[\[url]] is provided, begin the compliance review immediately. If no URL is provided, ask the user to share the URL they want reviewed.*
- *Conduct each review by comparing the web content at the URL against the FCA financial promotion guidelines in the attached FCA-guidelines.pdf document.*
- *After completing each review, ask: "Would you like to review another URL, ask a follow-up question about these findings, or request a comparison of all sites reviewed in this session?"*

### ***R – Result***

- *Output each compliance review directly in the chat interface in a structured, readable format.*
- *Use color-coded language for issue categorization: major issues (red), minor issues (amber), and compliant areas (green).*
- *When providing comparative analysis, present a clear summary of compliance scores and key findings across all reviewed URLs.*

**Variables**

This example references one variable, `url`, in the Prompt Template. Because this is a multi-turn agent, the URL variable is optional — users can provide it when invoking the agent or share it conversationally at any point in the session.

1. Click **Add Variable** and configure the following:
   - **Type** – *String*
   - **Accept multiple values**– off
   - **Name** – *url*
   - **Description** – *URL of the website to review for FCA financial promotion compliance. Can be provided at invocation or shared conversationally during the session.*
   - **Required?** – Unselected
2. Click **Save**.

**Tools**

This agent needs to browse web pages to review content. Select **Enable automatic tool prediction** in the **Tools** section to let Mark choose the most appropriate tools for each request automatically, including `browse_web`.

**Skills**

Skills are reusable instructions Mark can apply to your agent at runtime.

The Compliance Advisory Agent works against a single PDF reference (FCA-guidelines.pdf), so automatic skill selection is not required for this example. Leave both checkboxes unselected.

If you want the agent to also apply organization skills, for example, an internal "Regulatory tone of voice" skill, you have the following three options:

- To let Mark apply organization skills that match the conversation, select **Automatically select skills matching the prompt**.
- To let Mark apply organization skills that match the tools the agent uses, select **Automatically select skills matching the tools**.
- To insert a specific organization skill yourself, enter */* or *\{* in the **System Prompt** or **Prompt Template** and select **Choose skills** from the helper menu. The picker lists organization skills that have a shortcut. See [Create an organization skill](docId\:N3n_NnF8J0Ykujmp2Sg00).

Test the agent across several conversation turns before enabling **Automatically select skills matching the prompt** in production. Prompt-based automatic selection is sensitive to how your skill triggers are written, and a multi-turn agent compounds that risk because Mark re-evaluates skills as the conversation progresses.

**Files**

The Prompt Template references `FCA-guidelines.pdf`. Upload this file so your agent can compare web content against the FCA financial promotion guidelines.

1. Download [FCA-guidelines.pdf](https://api.archbee.com/api/presign/BrbvVORKJ5iIeSMZye5kI/y-1y1k1qguZKV-uGzF_Iy_fca-guidelines.pdf).
2. Click **Add file** in the **Files** section of the specialized agent **Setup**.
3. Locate and select the PDF file on your computer and click **Upload**.

The `FCA-guidelines.pdf` file was generated using Mark. It is optimized for use within this example agent walkthrough and may not be fully compatible or functional if used externally.

**Token budget**

Multi-turn agents accumulate conversation history with each exchange, which increases token usage over time. Setting an appropriate token budget ensures your agent maintains enough context to reference prior findings without truncating important conversation history.

For this example agent, select **Medium (25K – 75K tokens)**. This supports 15–30 turns with rich context — sufficient for a typical multi-URL review session with follow-up questions.

Use the following as a guide when configuring token budgets for your own agents:

| Budget     | Token range | Best for                                                                                                       |
| ---------- | ----------- | -------------------------------------------------------------------------------------------------------------- |
| **Low**    | 10K – 25K   | 5–10 turns. Simple, stateless queries. Lookup, calculation, or question-and-answer tasks with minimal context. |
| **Medium** | 25K – 75K   | 15–30 turns. Rich context. One or two knowledge bases. Multi-step reasoning across multiple URLs.              |
| **High**   | 75K – 200K  | 30+ turns. Full conversation history. Multiple documents. Deep, iterative refinement sessions.                 |

### Output section

The **Output** helps Mark know how you expect its output.

1. Expand the **Output** section.
2. Leave the **Data Type** drop-down list as **Text**.
3. Enter *A structured compliance assessment for the reviewed URL, including an executive summary with compliance score, color-coded issue categorization, and report sections covering tone of voice, accessibility, clarity, and regulations.* for the **Description**.

### Save your specialized agent

Click **Save**. A confirmation message displays. If it does not, fix the errors and click **Save** again.

## Configure quality evaluation (optional)

After saving the Compliance Advisory Agent, configure quality evaluation on the Quality tab to score conversations automatically. Because this agent runs in multi-turn mode, use conversation samples to provide reference conversations.

See [Quality tab overview](docId\:RyEJ8-_Fwgaw2WxYQKt1g) for configuration details.

## Test your specialized agent

After creating, configuring, and saving your specialized agent, use the **Test Run** option to verify that the agent maintains conversation context correctly across multiple exchanges.

Simulate the following multi-turn interaction in the **Test Run** panel:

1. Click **Test Run**.
2. Enter *www\.fidelity.com/mutual-funds/overview* for the **url**.
3. Click **Run** and review the output. The agent produces a structured compliance assessment for the Fidelity URL.
4. After the agent returns its findings, enter the following follow-up message: *Which specific FCA guideline is the prominence of risks issue tied to?*
5. Review the agent's response. It reference its prior findings and cite the specific FCA guideline, confirming that conversation context is maintained.
6. Enter: *Now review www\.chase.com and compare it to Fidelity.*
7. Review the agent's comparative analysis. It should assess the Chase URL and provide a side-by-side comparison with the Fidelity findings from earlier in the session.

See the [Test an agent section in the Manage agents](docId\:SSeNiblVMXwVvDR_lhtvI) documentation for information on testing your specialized agent.

## Refine your specialized agent

Adjust your specialized agent's **System Prompt**, **Prompt Template**, and **Inference Level** based on your test results to refine its behavior. For multi-turn agents, pay particular attention to whether the agent correctly references prior conversation context in its responses. See the [Refinement strategies section in the Specialized agent foundation](docId\:bDeUnJYXOZjhodVf7vcxg) documentation for additional refinement steps.

## Deploy your specialized agent

After any refinements, your specialized agent is ready to deploy. Confirm that **Enabled in Chat** is on — you left this on during the [Configure](docId\:TkZQvfputE2HtVDdknC3i) step. Users in your Mark instance can invoke this agent by entering *@compliance-advisory-agent* in Mark chat, optionally providing a URL to begin a review immediately or starting a conversation to kick off the session.

## Useful resources

For information on the agent ecosystem in Mark, review the following:

- [Skills overview](docId:1HTjxW2J-ZOkYEZMwnasU) – Develop reusable skills for contextual use by agents.
- [Tools overview](docId:-j4zNs-l3kIKD0n58bVPt) – Understand pre-built tools and custom tool development options.
- [Agent overview](docId\:w7MSVijPnuFqu4nXDo_bq) – Review agent capabilities and best practices.
- [Create a specialized agent](docId\:tZPJWDyE1GSB-epLsUh5S) – Review high-level guidance for creating an agent.

:::hint{type="info"}
**Note**

If you use Opti ID, administrators can turn off generative AI in the Opti ID Admin Center. See [Turn generative AI off across Optimizely applications](docId\:X5U0kKD2azV5cIdNqwGNj).
:::
