# Collaboration Agent

The Collaboration Agent is a key component designed to manage and initiate human involvement when an automated solution cannot resolve a case. It is used as a **handoff** agent, which means that a task from another agent is handed over to the Collaboration Agent, when additional non-automatic collaboration is required.

## Purpose

The primary purpose of the Collaboration Agent is to set up and manage human collaboration. Its goal is to create the right environment for humans and the Emporix Support Agent bot to work together on resolving issues.

{% hint style="danger" %}
The agent is automatically created when either the Complaint Agent or the Anti-Fraud Agent is installed. Its workflow involves strict, predefined steps, meaning customization is not available. If collaboration is needed for other types of cases, you must create a custom agent to handle the initialization.
{% endhint %}

{% hint style="info" %}
Currently, the only supported collaboration tool is Slack, but the agent is designed to be extendable to other tools in the future.
{% endhint %}

## Key benefits

The benefits of having the Collaboration Agent installed within another agent stem directly from the automated, structured workflow it executes to initialize a focused discussion space.

| Benefit                               | Description                                                                                                                                                                                                    |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Focused collaboration environment** | As the agent takes care to arrange a dedicated collaboration tool and communication channel for the specific case, this process ensures that all relevant context can be shared in a focused discussion space. |
| **Targeted participant alignment**    | The agent ensures that the right people are involved immediately to engage in solving the issue.                                                                                                               |
| **Instant context**                   | The agent passes on the context in the dedicated collaboration channel so that all the involved participants are immediately aligned on the situation at the early stage of working on a case.                 |

## How it works

The Collaboration Agent is solely triggered by a Complaint Agent or an Anti-Fraud Agent when human interaction is required. This agent is not configurable.

### Workflow

The Collaboration Agent executes the following workflow steps:

{% stepper %}
{% step %}
**Select collaboration tool**

Based on the tool specified in the Complaint Agent or Anti-Fraud Agent, the agent chooses the collaboration tool (currently limited to Slack).
{% endstep %}

{% step %}
**Create collaboration channel**

The agent creates a new Slack channel dedicated to the specific case.
{% endstep %}

{% step %}
**Identify participants**

The agent identifies the right people to be involved immediately. For example, when summoned by the Complaint Agent, it executes steps to identify participants, such as checking the order related to a complaint, retrieving associated company details, and using the **Contact Info** mixin on the Company entity to find relevant contacts.
{% endstep %}

{% step %}
**Invite participants**

It then matches company contact emails with Slack user emails and invites the matched users into the new Slack channel.
{% endstep %}

{% step %}
**Post context message**

Upon creation, the agent posts an initial message to the Slack channel. This message includes the full context of the case (for example, the customer complaint details) and recommended next actions. This step ensures participants are immediately aligned on the situation.
{% endstep %}

{% step %}
**Create Support Agent Context instance**

The agent is responsible for creating a Support Agent Context custom entity. This entity stores all essential details of the collaboration, including the tool used (currently - Slack), the Channel ID, the invited participants, the case context, and the recommended action.
{% endstep %}

{% step %}
**Hand over task to the Support Agent**

After this crucial setup phase is complete, the Support Agent takes over, facilitating the ongoing collaboration inside Slack.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
All Agents operations are tracked in the **AI Logs** view. You can check the details of the requests, jobs, and sessions for monitoring and evaluation purposes. For more information, see the [AI Logs](https://developer.emporix.io/agentic-commerce-intelligence/agentic-intelligence/logs).
{% endhint %}
