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

# AI Agent

> Hand off control to a conversational AI Agent

The **AI Agent** node transfers the conversation from the structured IVR flow to a conversational AI Agent powered by a language model. After the agent conversation completes, control returns to the flow.

## Behavior

* Invokes the specified AI Agent by ID
* The agent handles the conversation autonomously (using its own prompt, tools, and knowledge base)
* When the agent conversation ends, the flow resumes via one of three events
* Captures the full conversation transcript as an output variable

## Configuration

| Parameter | Type   | Default     | Description                                                                             |
| --------- | ------ | ----------- | --------------------------------------------------------------------------------------- |
| `agentId` | string | `"default"` | ID of the AI Agent to invoke. Must match an agent configured in your Oration workspace. |

## Output handles

| Handle       | Description                                                         |
| ------------ | ------------------------------------------------------------------- |
| **Complete** | Agent conversation finished normally                                |
| **Transfer** | Agent requested a transfer (e.g., caller asked to speak to a human) |
| **Error**    | Agent encountered an error                                          |

## Output variables

| Variable     | Type  | Description                                                                            |
| ------------ | ----- | -------------------------------------------------------------------------------------- |
| `transcript` | array | Array of transcript entries, each containing `timestamp`, `message`, and `messageType` |

## Use cases

<AccordionGroup>
  <Accordion title="Hybrid IVR + AI">
    IVR Menu for department selection → AI Agent for the actual conversation. On `AGENT.TRANSFER`, route to a Transfer node for human escalation.
  </Accordion>

  <Accordion title="Pre-qualified conversations">
    Collect account number via Collect Digits, verify via API Call, then hand off to an AI Agent with the caller's context in variables.
  </Accordion>

  <Accordion title="Post-conversation flow">
    After the AI Agent completes, use the transcript output variable in a Transform node to extract key data, then send an SMS summary.
  </Accordion>
</AccordionGroup>
