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

# Build Your First Agent

> A complete walkthrough to create, test, and deploy your first AI agent

This tutorial walks you through building a production-ready AI agent — from connecting knowledge to monitoring live conversations. Plan about 30 minutes.

If you have not completed the [Quickstart](../quickstart) yet, start there. This tutorial picks up where the quickstart leaves off and covers prompt engineering, tools, testing, and monitoring in depth.

## Prerequisites

* A working AGO agent from the [Quickstart](../quickstart) (knowledge source connected, agent created, permissions set)
* Admin or staff permissions

***

<Steps>
  <Step title="Plan Your Agent's Scope">
    Before refining your agent, define clear boundaries:

    | Decision       | Example                                      |
    | -------------- | -------------------------------------------- |
    | **Scope**      | Answer product questions for customers       |
    | **Tone**       | Professional, friendly, concise              |
    | **Escalation** | Create a ticket when the agent cannot help   |
    | **Boundaries** | No account modifications, no billing changes |

    <Tip>A focused agent performs much better than one that tries to handle everything. Start narrow, then expand.</Tip>
  </Step>

  <Step title="Check Knowledge Quality">
    Good answers depend on good source content.

    1. In the admin sidebar, click **Knowledge**, then select **Quality**
    2. Review the quality scores for your documents
    3. Fix any flagged issues (missing titles, thin content, outdated information)

    Spend time here — knowledge quality directly affects response accuracy.

    For details, see [Knowledge Quality](../features/knowledge-quality).
  </Step>

  <Step title="Write a System Prompt">
    A good prompt is the single biggest lever for agent quality. Open your agent in the agent builder and go to the **Prompt** section.

    **Example prompt:**

    ```markdown theme={null}
    You are a friendly support assistant for ACME Corp.

    ## Your role
    - Answer product questions using the knowledge base
    - Guide users through common workflows
    - Create a support ticket when you cannot resolve an issue

    ## Rules
    - Always cite your sources when answering from documentation
    - If you are unsure, say so — do not make up answers
    - Keep responses concise (2-3 paragraphs maximum)
    - Use a professional but approachable tone

    ## Escalation
    Create a ticket when:
    - The user explicitly asks for human help
    - The issue requires account-level access
    - You have tried troubleshooting but cannot resolve the problem
    ```

    For writing techniques, see [Prompt Engineering](./prompt-engineering).
  </Step>

  <Step title="Add Tools">
    Tools let your agent take actions beyond answering questions.

    1. In the agent builder, go to **Tools**
    2. Enable the **Ticketing** tool for human escalation
    3. Optionally enable:
       * **HTTP Request** — fetch data from external APIs
       * **Send Email** — send notifications
       * **Parameterized Search** — advanced knowledge retrieval

    For each tool, write a clear description of when the agent should use it. The agent relies on this description to decide.

    See [Tools](../features/tools) for all available options.
  </Step>

  <Step title="Test with Simulation">
    Before deploying to real users, validate your agent with automated tests.

    1. In the admin sidebar, click **AI Studio**, then select **Agent Lab**
    2. Create a test dataset with sample questions and expected behaviors
    3. Run the simulation
    4. Review results — check for accuracy, tone, and correct tool usage
    5. Fix issues in your prompt or knowledge, then re-run

    <Tip>Include edge cases — off-topic questions, adversarial inputs, and questions the agent should escalate.</Tip>

    See [Simulation Testing](../features/simulation-testing) for the full testing workflow.
  </Step>

  <Step title="Deploy">
    Choose how your users will interact with the agent:

    | Channel    | Documentation                                                  |
    | ---------- | -------------------------------------------------------------- |
    | **Widget** | [Widget Configuration](../features/widget-configuration-admin) |
    | **Slack**  | [Slack Integration](../data-connector/slack-integration)       |
    | **API**    | [API Reference](../api/public-api-v1)                          |
    | **SDK**    | [SDK Integration](../features/sdk-integration)                 |
  </Step>

  <Step title="Monitor and Improve">
    Your agent is live — now keep it performing well.

    1. **Enable the Thread Evaluator** — automatically scores every conversation for resolution quality. See [Thread Evaluator](../features/thread-evaluator).
    2. **Review the Performance Dashboard** — track resolution rates, satisfaction, and trends. See [Performance Dashboard](../features/performance-dashboard).
    3. **Browse Conversations** — spot issues by reading real interactions. See [Conversations List](../features/conversations-list).
    4. **Act on Feedback** — use satisfaction data to identify improvement areas. See [Feedback Analytics](../features/feedback-analytics).

    Set up a review cadence:

    | Frequency | Action                                           |
    | --------- | ------------------------------------------------ |
    | Daily     | Check for flagged conversations                  |
    | Weekly    | Review performance dashboard and CX score trends |
    | Monthly   | Audit knowledge quality and update content       |
  </Step>
</Steps>

## Checklist

* [ ] Agent scope and boundaries defined
* [ ] Knowledge quality reviewed and issues fixed
* [ ] System prompt written with clear rules and escalation criteria
* [ ] Ticketing tool enabled for escalation
* [ ] Simulation tests passing
* [ ] Deployed to at least one channel
* [ ] Thread evaluator enabled

***

## What's Next

* [Prompt Engineering](./prompt-engineering) — advanced prompt writing techniques
* [Agent Best Practices](./agent-best-practices) — design patterns and common pitfalls
* [Router Agent](../agent/router) — delegate to specialist agents
* [Set Up Your Knowledge Base](./knowledge-setup-tutorial) — deep dive into knowledge management
