# Monitor

### **Overview** <a href="#overview" id="overview"></a>

The Monitor feature in ZBrain delivers continuous, end-to-end oversight of every deployed agent and application. It automatically captures each input and output, evaluates the output against a comprehensive set of metrics, and surfaces real-time performance trends, so you can detect issues early, correct them quickly, and maintain consistently high-quality AI interactions.

Monitor schedule evaluations at defined intervals, log both successes and failures, and present the results in an intuitive console. Built-in notifications keep you updated on whether the flow is successful or fails.

#### Metric categories <a href="#metric-categories" id="metric-categories"></a>

* **Non-LLM Metrics -** Relies on deterministic checks (health, exact match, similarity) without invoking an LLM.
  * **Health check** - Confirms the app/agent can return a valid response; halts further checks if an invalid response is received.
  * **Exact match**- Compares the app/agent agent response character-by-character with the expected output.
  * **F1 score:** Balances precision and recall to evaluate content overlap.
  * **Levenshtein similarity:** Measures similarity based on edit distance between two strings.
  * **ROUGE-L score:** Detects the longest common sequence between the response and reference text.

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FnWOACfjYIqD51BY1kX4M%2Fimage.png?alt=media&#x26;token=26a483f4-9e11-40b8-b1bc-6d7456e26445" alt=""><figcaption></figcaption></figure>

* **LLM-based -**&#x55;tilizes a language model to evaluate answers for relevance and factual accuracy.
  * **Response relevancy** - Measures how accurately the response answers the user’s query.
  * **Faithfulness** - Evaluates factual alignment with context to minimize hallucinations.

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FTh9gEa1nDNjjxPLSmECJ%2Fimage.png?alt=media&#x26;token=5e53376d-faf8-468d-85df-2e71929d142b" alt=""><figcaption></figcaption></figure>

* **Performance** - Measures the total time (in milliseconds) taken by the LLM to return a response after receiving a query. It provides the **Response Latency** metric. Using this metric, users can monitor and enforce execution time thresholds for AI Agents, Flows, or Apps.
  * Set thresholds in either seconds or minutes.
  * When a threshold is breached or satisfaction is achieved, the system triggers *Success* or *Failure* evaluations and sends relevant notifications.

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FJd2p9OEmqLNpXJ7Q4Xwp%2Fimage.png?alt=media&#x26;token=cbd4490e-cc12-40ae-a14c-496ac2407cfd" alt=""><figcaption></figcaption></figure>

* **LLM-as-a-judge -** Have an LLM emulate human reviewers on traits like creativity, clarity, and helpfulness.
  * **Creativity:** Rates originality in response generation.
  * **Helpfulness:** Evaluates how effectively the response assists in resolving the user’s query.
  * **Clarity:** Measures how clearly the message is conveyed.

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FUC2F70Eu4de8hGtVjEml%2Fimage.png?alt=media&#x26;token=62278118-a207-4374-8dd1-178fbc24a4b7" alt=""><figcaption></figcaption></figure>

### **Key capabilities of Monitor**  <a href="#key-capabilities-of-monitor" id="key-capabilities-of-monitor"></a>

* **Automated evaluation**: Assess responses using LLM-based and non-LLM-based metrics.
* **Performance tracking**: Track success/failure trends.
* **Query-level monitoring**: Configure evaluations at the individual query level within a session.
* **Agent and app support**: Monitor both AI apps and AI agents.
* **Input flexibility**: Monitor responses for .txt, PDF, image, and other file types.
* **Notification alerts**: Enable real-time notifications for event status updates when an event succeeds or fails.

### **Monitor interface navigation** <a href="#monitor-interface-navigation" id="monitor-interface-navigation"></a>

The monitor module consists of four main sections, accessible from the left navigation panel:

* **Events**: View and manage all configured monitoring events
* **Monitor logs**: Review detailed execution results and metrics
* **Event settings**: Configure evaluation metrics and parameters
* **User management:** Configure role-based user permissions

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FoweRs4bYsoqEEnCoR52x%2Fimage.png?alt=media&#x26;token=377b7f6e-8803-48e5-9cd2-bbd540786f25" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FINFf8VaJfA1Uus6IM78l%2Fimage.png?alt=media&#x26;token=1d5acff1-f9ba-4cc0-aec3-2b5d4e501cfb" alt=""><figcaption></figcaption></figure>

Together, these capabilities provide a single dashboard for validating fixes, identifying quality drift, and ensuring that every user interaction meets your organization’s standards.

#### Accessing Monitor documentation <a href="#accessing-monitor-documentation" id="accessing-monitor-documentation"></a>

ZBrain Builder includes a context-aware documentation panel within the Monitor module.

* Click the '?' icon in the top-right corner of the Monitor interface.

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FVmjwQd8noAtLWSdIZ2mK%2Fimage.png?alt=media&#x26;token=b9f6b27f-a65a-43d7-a748-48393d04c287" alt=""><figcaption></figcaption></figure>

* When clicked, it opens a side panel that displays documentation specifically tailored to the Monitor module, all without requiring you to navigate away from your current screen.

<figure><img src="https://3781630280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbuSicczDKTyHzwzicar%2Fuploads%2FPUJxoxHC0FImXjtaIAs4%2Fimage.png?alt=media&#x26;token=7e9068a3-7ed8-48c0-af73-c7fbbf22bda2" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zbrain.ai/zbrain-documentation/zbrain-builder/monitor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
