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

# Set up an AI agent

> Create your first Ravenna AI agent, give it rules, knowledge, and tools, test it safely in Testing Mode, then deploy it to a channel.

export const ArcadeEmbed = ({code, title = 'Demo', aspect = 56.25}) => {
  const arcadeIframeRef = useRef(null);
  useEffect(() => {
    function onArcadeIframeMessage(e) {
      if (e.origin !== 'https://demo.arcade.software' || !e.isTrusted) return;
      const arcadeIframe = arcadeIframeRef.current;
      if (!arcadeIframe || !arcadeIframe.contentWindow) return;
      if (e.data.event === 'arcade-init') {
        arcadeIframe.contentWindow.postMessage({
          event: 'register-popout-handler'
        }, '*');
      }
      if (e.data.event === 'arcade-popout-open') {
        arcadeIframe.style['position'] = 'fixed';
        arcadeIframe.style['z-index'] = '9999999';
      }
      if (e.data.event === 'arcade-popout-close') {
        arcadeIframe.style['position'] = 'absolute';
        arcadeIframe.style['z-index'] = 'auto';
      }
    }
    window.addEventListener('message', onArcadeIframeMessage);
    const arcadeIframe = arcadeIframeRef.current;
    if (arcadeIframe && arcadeIframe.contentWindow) {
      arcadeIframe.contentWindow.postMessage({
        event: 'register-popout-handler'
      }, '*');
    }
    return () => {
      if (arcadeIframe && arcadeIframe.contentWindow) {
        arcadeIframe.contentWindow.postMessage({
          event: 'unregister-popout-handler'
        }, '*');
      }
      window.removeEventListener('message', onArcadeIframeMessage);
    };
  }, []);
  const embedUrl = `https://demo.arcade.software/${code}?embed&embed_mobile=tab&embed_desktop=inline`;
  return <div style={{
    position: 'relative',
    paddingBottom: `calc(${aspect}% + 41px)`,
    height: 0,
    width: '100%'
  }}>
      <iframe ref={arcadeIframeRef} src={embedUrl} title={title} frameBorder="0" loading="lazy" allowFullScreen allow="clipboard-write" style={{
    position: 'absolute',
    top: 0,
    left: 0,
    width: '100%',
    height: '100%',
    colorScheme: 'light'
  }} />
    </div>;
};

An agent is the thing employees actually talk to. It answers from your knowledge, fills in forms, runs tools, and escalates to a human when it cannot finish the job. Everything you built earlier in this track is what the agent draws on.

**Time:** about 30 minutes, including testing.

<Tabs>
  <Tab title="Interactive walkthrough">
    <ArcadeEmbed code="qyRk8fL8W5QxNrS1C9Ih" title="Creating an AI agent" aspect={62.55} />
  </Tab>

  <Tab title="Step-by-step">
    <Steps>
      <Step title="Open Agents">
        Click **Agents** in the left sidebar.

        <Frame>
          ![The Agents section in the left sidebar](https://d1kzozfjh72w00.cloudfront.net/documentation/screenshots/guides/getting-started/ai-agents/1.png)
        </Frame>
      </Step>

      <Step title="Create the agent">
        Click **New**.

        <Frame>
          ![The Agents list with a New button](https://d1kzozfjh72w00.cloudfront.net/documentation/screenshots/guides/getting-started/ai-agents/2.png)
        </Frame>

        Give it a name and a description that says what it handles.

        <Frame>
          ![The new agent dialog with name and description fields](https://d1kzozfjh72w00.cloudfront.net/documentation/screenshots/guides/getting-started/ai-agents/3.png)
        </Frame>

        <Tip>
          Name it something your employees will address in Slack. Teams that give the agent a real name get more traffic than teams that call it "IT Bot".
        </Tip>
      </Step>

      <Step title="Upload an avatar">
        <Frame>
          ![The avatar upload and crop dialog](https://d1kzozfjh72w00.cloudfront.net/documentation/screenshots/guides/getting-started/ai-agents/4.png)
        </Frame>

        Images must be PNG, GIF, or WebP for Slack compatibility, under 1MB, and are resized to 512x512.
      </Step>

      <Step title="Add your first rules">
        <Frame>
          ![The Rules section of an agent with a rule being written](https://d1kzozfjh72w00.cloudfront.net/documentation/screenshots/guides/getting-started/ai-agents/5.png)
        </Frame>

        A rule is a natural language instruction that teaches the agent one capability. Use `@` to reference the forms, knowledge folders, categories, and tools you set up earlier.

        Start with two or three, not twenty. For the IT desk built in this track:

        <Prompt description="When someone reports being locked out of MFA, create a ticket with @MFA reset and set @Category - Account issues. If they say they are fully locked out of every device, set priority to High.">
          When someone reports being locked out of MFA, create a ticket with @MFA reset
          and set @Category - Account issues. If they say they are fully locked out of
          every device, set priority to High.
        </Prompt>

        <Prompt description="For questions about laptop setup, VPN, or software licences, search @IT runbooks and answer directly. Cite the article you used.">
          For questions about laptop setup, VPN, or software licences, search
          @IT runbooks and answer directly. Cite the article you used.
        </Prompt>

        <Callout icon="link" color="#6B7280">Learn more about [writing rules](/documentation/automate/agents/configure#rules), and read [writing agent rules](/guides/best-practices/writing-agent-rules) for what belongs in a rule versus the custom prompt</Callout>
      </Step>

      <Step title="Write escalation instructions">
        Escalation is what happens when the agent cannot finish. Left alone, it escalates only after knowledge and tools come up empty, creates a ticket, and tells the requester a human is taking over.

        Override that when your team has its own handoff. Escalation instructions accept the same `@` mentions as rules, so you can name the form, category, and status the escalated ticket should carry, which is how a workflow picks the ticket up afterwards.

        <Prompt description="Before escalating, check @IT runbooks one more time. If still unresolved, create a ticket with @General support and tell the requester that a specialist will follow up within one business day.">
          Before escalating, check @IT runbooks one more time. If still unresolved,
          create a ticket with @General support and tell the requester that a
          specialist will follow up within one business day.
        </Prompt>

        <Callout icon="link" color="#6B7280">Learn more about [escalation instructions](/documentation/automate/agents/configure#escalation-instructions)</Callout>
      </Step>

      <Step title="Connect knowledge">
        Select the knowledge folders this agent may search. Agents only reach knowledge you grant them, and the folder's own channel scoping applies on top.

        <Callout icon="link" color="#6B7280">Learn more about [scoping knowledge](/documentation/automate/knowledge/overview#scoping-knowledge)</Callout>
      </Step>

      <Step title="Add tools, and decide what needs approval">
        Tools are what turn the agent from an answering machine into a resolver: looking a user up, resetting a password, adding someone to a group.

        Every tool in a rule carries an **execution policy**, set per rule rather than globally:

        * **Auto-execute** for read-only lookups.
        * **Requires confirmation** for write actions where a "Should I proceed?" prompt is enough. This is the default for creates, updates, and deletes.
        * **Requires approval** for anything high impact. The agent buffers the call, opens an approval round, and only runs the tool once the round clears. Approvers default to workspace admins, or you can point it at an approval template.

        Keep the lookup on auto-execute and gate the change. That combination is what makes an agent safe to leave running.

        <Callout icon="link" color="#6B7280">Learn more about [tool execution policies](/documentation/automate/agents/configure#tool-execution-policies)</Callout>

        If a tool is a Foundry function that takes an API key, pin that input to a Vault credential under **Input settings**. The agent never sees the value, only a reference is stored, and the rule will not save while a secret input is unpinned.

        <Callout icon="link" color="#6B7280">Learn more about [tool input settings](/documentation/automate/agents/configure#tool-input-settings)</Callout>
      </Step>

      <Step title="Set personality and Slack behavior">
        <Frame>
          ![Agent personality settings for tone, length, and emoji use](https://d1kzozfjh72w00.cloudfront.net/documentation/screenshots/guides/getting-started/ai-agents/6.png)
        </Frame>

        Tone, response length, and emoji use are structured settings, so use them rather than describing tone in a custom prompt. A custom prompt silently overrides all three.

        Two settings worth deciding now:

        * **Auto-respond** lets the agent answer tickets that arrive by email or from Jira, Linear, and GitHub, with an optional delay so context can land first.
        * **Conversational form filling** collects short forms one question at a time in chat instead of showing a form. It applies to forms at or under the field threshold, three by default, and never to private forms.

        <Callout icon="link" color="#6B7280">Learn more about [personality](/documentation/automate/agents/customize#personality), [auto-respond](/documentation/automate/agents/customize#auto-respond), and [conversational form filling](/documentation/automate/agents/customize#conversational-form-filling)</Callout>
      </Step>

      <Step title="Test it before deploying">
        Use the chat panel on the agent page. A yellow **Testing Mode** banner confirms the session is sandboxed: the agent matches rules, calls tools, and picks responses for real, but nothing is written and nothing posts to Slack or Teams.

        Expand the **Debug** disclosure under each response to see which rules matched, which tools ran and with what inputs, and how the agent classified its own answer. That is how you find out a rule is not firing, rather than guessing from a bad reply in production.

        <Callout icon="link" color="#6B7280">Learn more about [Testing Mode](/documentation/automate/agents/deploy-monitor#testing-mode)</Callout>
      </Step>

      <Step title="Deploy to a channel">
        <Frame>
          ![The Connections section listing channels the agent is deployed to](https://d1kzozfjh72w00.cloudfront.net/documentation/screenshots/guides/getting-started/ai-agents/7.png)
        </Frame>

        In **Connections**, add the channel you set up earlier. One agent per channel, and you can add or remove channels at any time.

        <Callout icon="link" color="#6B7280">Learn more about [deploying agents](/documentation/automate/agents/deploy-monitor#connections)</Callout>
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Agents and workflows do different jobs

An agent handles the conversation. A workflow handles the deterministic sequence. They do not call each other directly: the agent creates or updates a ticket, and the ticket's state is what a workflow triggers on. That is why escalation instructions let you set a form, category, and status. Those are the handoff.

<Callout icon="link" color="#6B7280">Learn more about [agents compared with workflows](/documentation/automate/agents/overview#agents-vs-workflows)</Callout>

## What to watch in week one

Open **Chat logs** on the agent page. Every conversation is recorded with the result the agent assigned itself, the requester, the channel, and any thumbs up or down.

* A high **Missing Knowledge** rate means the gap is in your documentation, not the agent.
* A high escalation rate on questions you know are documented usually means a rule is missing or too narrow.
* Frequent requests for more information often means a form is asking for things the agent could have inferred.

<Callout icon="link" color="#6B7280">Learn more about [chat logs and debugging patterns](/documentation/automate/agents/deploy-monitor#chat-logs)</Callout>

## Next

Everything is built. Now open it up.

<Card title="Go live" icon="arrow-right" href="/guides/day-one/go-live">
  Run the pre-launch checks, announce it to your team, and know what to look at on day two.
</Card>


## Related topics

- [Set up knowledge](/guides/day-one/set-up-knowledge.md)
- [Writing agent rules](/guides/best-practices/writing-agent-rules.md)
- [Copilot](/documentation/automate/copilot/overview.md)
- [Day one](/guides/day-one/overview.md)
- [AI assistant](/integrations/microsoft-teams/ai-assistant.md)
