# Source: https://docs.asapp.com/generativeagent/human-in-the-loop.md

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

# Human in the Loop Agent

> Learn how GenerativeAgent works with human agents to handle complex cases requiring expert guidance or approval.

Human-in-the-loop is a first-of-its kind capability that allows a human agent to guide GenerativeAgent in assisting a customer. GenerativeAgent may request human help in situations where it lacks the necessary API access, knowledge sources, or requires human approval to complete an action.

GenerativeAgent raises a ticket requesting specific help through your existing digital support tool. Available agents within your organization are part of dedicated human-in-the-loop queues where they receive and respond to tickets from GenerativeAgent, thereby resolving the customer issue.

The Human-in-the-loop Agents (HILA) within your organization wait in a queue and receive direction to specific scenarios where they take on the action of helping in a customer's issue and give back the conversation to GenerativeAgent. HILAs can also transfer the conversation to a Live Agent so they take over the task from GenerativeAgent.

## When should GenerativeAgent consult a human

You can invoke the Human-in-the-loop capability in the task instructions for GenerativeAgent. You can specify scenarios or actions that GenerativeAgent cannot perform automatically and require human intervention for information or confirmation. This is similar to actions a human agent cannot complete without supervisor approval.

Recommended scenarios for human assistance include:

* Insufficient permissions: When GenerativeAgent should not act on its own without HILA approval.
* No API to call: Whenever there is no API to call to retrieve specific customer information.
* No Knowledge Base information: Whenever the question or issue provided by the customer has no content in the Knowledge Base source that GenerativeAgent can use.

## HILAs

The primary function of the human-in-the-loop is to support and unblock GenerativeAgent. These supervisors handle tasks requiring approvals or a deep understanding of the issues. Tier 1 agents can address simpler queries. When accepting a ticket from GenerativeAgent in your digital support tool, agents access an embedded Human-in-the-loop UI.

The actions HILAs perform include:

* Ticket assignments
* Response edits/decisions
* Unlock GenerativeAgent
* Escalation to live agents

Human-in-the-loop agents assist GenerativeAgent without directly interacting with customers, differing from live agents.

The key benefit is that a single agent can manage multiple customer conversations simultaneously without engaging in calls or chats.

If the Human-in-the-loop agent determines that a live agent would better serve the customer, they can use the Transfer option in the UI to hand off the conversation from GenerativeAgent to a live agent.

**When does GenerativeAgent transfer to a live agent?**

We recommend the following scenarios for transferring a conversation to a live agent:

* A human-in-the-loop instructs GenerativeAgent to do so
* There are no Human-in-the-loop agents available. The system manages this automatically and does not require explicit instructions.
* The customer explicitly requests it (if configured).

## Agent UI

**Enabling human-in-the-loop capability**

Human-in-the-loop agents operate from the existing Agent Desk. To enable the Human-in-the-loop UI and task functions in GenerativeAgent, please contact your Implementation Manager.

The Human-in-the-loop agent UI is the primary application where agents can interact with GenerativeAgent. Through this interface, they can:

* Respond to GenerativeAgent
* Transfer conversations to live agents
* View the interaction thread history
* Access relevant customer information and summarized conversation context

This section provides an overview of important features available:

* **Transfer**: Allows the agent to transfer the conversation from GenerativeAgent to a live agent.
* **Ticket Assignment Timer**: Tracks the time elapsed since the system assigned the ticket to the agent.
* **Prompt**: Indicates the specific assistance GenerativeAgent needs to unblock the customer. This is generated by GenerativeAgent itself.
* **Response**: The Human-in-the-loop agent can respond to GenerativeAgent through an open text field or structured options, depending on the configuration.
* **Send**: After selecting a response, the agent can click 'Send' to submit the response and close the ticket simultaneously.
* **Context**: Provides a summarized context of the conversation between GenerativeAgent and the customer.
* **Transcript**: Displays the complete customer interaction thread prior to GenerativeAgent raising the ticket.
* **Customer**: Shows the customer's details, including company and specific account information for authenticated customers.

<Frame caption="Human-in-the-loop Agent UI">
  <img width="300" src="https://mintcdn.com/asapp/5vfIXwfnKhACH2a_/images/generativeagent/hila-ui.png?fit=max&auto=format&n=5vfIXwfnKhACH2a_&q=85&s=20e45a26612b05a4f36146b6ab1d4ca9" data-og-width="896" data-og-height="1438" data-path="images/generativeagent/hila-ui.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/asapp/5vfIXwfnKhACH2a_/images/generativeagent/hila-ui.png?w=280&fit=max&auto=format&n=5vfIXwfnKhACH2a_&q=85&s=78e73f6ed94a3f74818275ed303bf080 280w, https://mintcdn.com/asapp/5vfIXwfnKhACH2a_/images/generativeagent/hila-ui.png?w=560&fit=max&auto=format&n=5vfIXwfnKhACH2a_&q=85&s=c4dc189a5c7473a403b27adb9b2eb3ba 560w, https://mintcdn.com/asapp/5vfIXwfnKhACH2a_/images/generativeagent/hila-ui.png?w=840&fit=max&auto=format&n=5vfIXwfnKhACH2a_&q=85&s=9bc09cdb388bfa370a2d36f39d0bbe2d 840w, https://mintcdn.com/asapp/5vfIXwfnKhACH2a_/images/generativeagent/hila-ui.png?w=1100&fit=max&auto=format&n=5vfIXwfnKhACH2a_&q=85&s=7ac97c33eff7d45444ab1bb5586f773a 1100w, https://mintcdn.com/asapp/5vfIXwfnKhACH2a_/images/generativeagent/hila-ui.png?w=1650&fit=max&auto=format&n=5vfIXwfnKhACH2a_&q=85&s=c82fd67bde7dd35fe333d6a6b6f4602f 1650w, https://mintcdn.com/asapp/5vfIXwfnKhACH2a_/images/generativeagent/hila-ui.png?w=2500&fit=max&auto=format&n=5vfIXwfnKhACH2a_&q=85&s=358bf25a61a0464d238444289592092a 2500w" />
</Frame>

## Next Steps

After setting up Human-in-the-Loop, you are ready to speed up customer replies and solve their inquiries.

You may find one of the following sections helpful in advancing your integration:

<CardGroup>
  <Card title="Connect your APIs" href="/generativeagent/configuring/connect-apis" />

  <Card title="Safety and Troubleshooting" href="/generativeagent/configuring/safety-and-troubleshooting" />

  <Card title="Go Live" href="/generativeagent/go-live" />
</CardGroup>