> For the complete documentation index, see [llms.txt](https://docs.aisera.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aisera.com/aisera-platform/ai-workbench-optimize-conversations/ai-lens.md).

# AI Lens

<figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FNCQPN1V60luNGiXYt2TC%2Fperm_note.png?alt=media&amp;token=65f4eded-e7f9-44a1-a058-bc6dfb3c91e3" alt=""><figcaption></figcaption></figure>

## Simulation with AI Lens

Aisera AI Lens is a tool that allows Administrators to simulate their conversational bot with a webchat channel.\
\
**NOTE:** If you are a user with a custom role, make sure your role has at least the following permissions, which are required to view conversations with AI Lens:

* `intent` – **Read**
* `channels` – **Read**
* `AiseraGPT` – **Read**

### Getting Started <a href="#getting-started-pre-reqs-general-intro" id="getting-started-pre-reqs-general-intro"></a>

* Webchat channel is the default channel associated with the bot
* Select correct bot
* Login with a user

### Conversation Window <a href="#conversation-window" id="conversation-window"></a>

AI Lens lets you simulate the interaction with your bot. The simulated input **Requests** are not captured within the **Request Details** page. AI Lens is similar to runtime analysis.&#x20;

<figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FEW4A9n7vRzbP1woDbIM3%2Fai_lens3.png?alt=media&amp;token=88d4fd25-72c3-4c8a-8192-e69d03f27913" alt="" width="563"><figcaption></figcaption></figure>

**To use AI Lens:**

1. Choose **AI Lens** in your Aisera Admin UI.
2. Select your bot from the pull-down list at the top of the **AI Lens** window. You will see a bot interface on the AI Lens window.
3. Add a **Request**. (AI Lens requests will not be recorded in Aisera analytics.)

<figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FUIrSdjuoA66RznGsK38D%2Fai_lens_request.gif?alt=media&amp;token=5fa2f3ed-c557-4b25-ad26-cfd28cc4d5ad" alt=""><figcaption></figcaption></figure>

4. After you add a **Request**, you will see the bot functions on the right side of your window.

<figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2Fg6JUdiMYnsoKw9aX9Xhx%2Fai_lens2.png?alt=media&amp;token=66ed129c-d342-49bb-bdf0-eb12c08ca01d" alt=""><figcaption><p>Bot Functions Show Up on the Right Side</p></figcaption></figure>

### Debug Workflows and Hyperflows Using AI Lens <a href="#h_01jvdp4syxhjhbrgnempxzmq0w" id="h_01jvdp4syxhjhbrgnempxzmq0w"></a>

You can use AI Lens to see the debug information for your bot’s workflows and hyperflows while the bot is running.

**To see the debug information for your bot workflow or hyperflow:**

1. Perform Steps 1-4 in the section above.
2. Choose the **Show More** link to see the **flowDebugInfo** and **flowDebugInfo2** methods as they are running.&#x20;

<figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2F4iFAX3r2dRvaNqm2tSAj%2Fshow_more.gif?alt=media&amp;token=4d8ca8b9-3155-423b-9273-1de542840717" alt=""><figcaption></figcaption></figure>

The **flowDebugInfo** and **flowDebugInfo2** methods are the logs created while your workflow or hyperflow runs.

<figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FIb7uqnVSNgoNswvahQhj%2Fflow_debug.gif?alt=media&amp;token=6b6d1c27-aed5-47fb-8895-0e93faf16f50" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
You can also test Workflows and Hyperflows using the [**Test the Node**](/aisera-platform/what-can-my-bot-do/ai-automation-optimize-flow/ai-workflow-studio/testing-workflows.md#pdf-page-bwlrvkqhijiqw0zetekc-best-practices) button on the **AI** **Automation > AI Workflow Studio window.**
{% endhint %}

### Fulfillment Source Per Application/Bot Version

When you run the AI Lens simulation, you are seeing the logs from the conversation server. The AiseraGen AI platform has two different conversation services - the first one (sometimes called the Conversation Server) was for the 1.0 version applications/bot, and the second (sometimes called the ConvAI Server) is an LLM conversation service (that automatically runs a RAG index is for 2.0 application/bots).

#### The Conversation Server for 1.0 Applications/Bots

If you are simulating/testing a **1.0 Version** application/bot, the **Fulfillment Source** field in AI Lens will contain one of the options that you chose as a source when you created the application/bot.

When the conversation 1.0 application/bot is running, the conversation server tries a couple of the fulfillment engines to answer the user Request, and the AI Lens will display the engine where the answer was found.&#x20;

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FoEYwqS99XhOSpfn32yEF%2Ffulfillment_source.gif?alt=media&amp;token=eef34d70-88da-45ae-a738-0aa4c318b0e5" alt="" width="375"><figcaption></figcaption></figure></div>

#### The Conversation Server for 2.0 Applications/Bots

If you are simulating/testing a **2.0 Version** application/bot, the **Fulfillment Source** field in AI Lens will display **`ReasoningEngine`**.

<figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FZIUoDM5H9gK5eBENq0ze%2Fai_lens_2.0.gif?alt=media&amp;token=ef3928e9-12e8-4fd9-9438-945a09df318f" alt=""><figcaption></figcaption></figure>

When 2.0 applications/bots are running, the conversation server will only use the Reasoning Engine from the rag service to do the routing.

### AI Lens with Copilot Applications

Applications/bots that are using the Copilot channel default to Copilot mode in AI Lens. Applications without a Copilot channel correctly default to Webchat mode.

<img src="https://docs.aisera.com/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FiZkLJr3EjXkd2tHYiQJP%2Fblobs%2FKmnuopYd9soCsY3hB5xT%2FUnknown%2520image&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=ea3a116f&#x26;sv=2" alt="" height="436" width="748">

<br>
