Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/concepts/pipelines/nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ You can configure:
- [Tools](../tools/index.md) for additional actions
- [Collections](../collections/index.md) for indexed collections to base responses on your documents (RAG), or media collections to send files to participants.
For indexed collections, the **Generate Citations** setting controls whether answers [show source links](../collections/indexed_collections/citations.md).
- A **Message Tag** to [tag every reply from the node](../../how-to/tag_node_output.md)
- [Metadata filters](../../how-to/filter_collection_search_by_metadata.md) to limit an indexed collection search to rows with matching metadata
- [Custom Actions](../llm_custom_action.md) to connect to external systems and retrieve information or complete tasks

Expand All @@ -66,6 +67,7 @@ You write a template that mixes fixed text with placeholders.
At runtime, the node fills in the placeholders using information about the current message, the participant, and the pipeline state.

Use this node to reformat a previous node's output, build a prompt for a downstream LLM node, or compose a personalized message.
It has a **Message Tag** field to [tag the messages it produces](../../how-to/tag_node_output.md).

See the [Render a Template and Send an Email Node](../../tech-hub/template_and_email_nodes.md#render-a-template-node) reference for the full variable list and template syntax.

Expand Down Expand Up @@ -112,6 +114,7 @@ Execute custom Python code for logic, data processing, or external API calls.
- **[Attachments](../../tech-hub/python_node.md#attachments)** — access files uploaded by the participant and read their contents (text, PDF, DOCX, XLSX, and others — see [supported file types](../../tech-hub/python_node.md#supported-file-types)).
- **[HTTP client](../../tech-hub/external-api-calls/http_client.md)** — make secure HTTP requests to external APIs using the built-in `http` global.
- **[Debugging](../../tech-hub/python_node.md#debugging-with-print)** — use `print()` to capture diagnostic output, visible in the trace detail view.
- **[Message Tag](../../how-to/tag_node_output.md)** — a field that tags every message the node produces.

See the [Python Node](../../tech-hub/python_node.md) page for full documentation.

Expand Down
81 changes: 41 additions & 40 deletions docs/concepts/tags.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
# Tags

Tags are labels applied to chats and messages to categorize and organize interactions.
For instance, tags can be used to mark messages that require follow-up or to segment participants based on their interactions.

Create tags from **Manage Tags** in the team sidebar.
The link appears only if you have permission to add tags.

![Manage Tags section showing options to create and edit tags](../assets/images/tags_manage.png)

To add a tag, use the **Add new** button and enter a name.
A tag name can be at most 100 characters long.

## Types Of Tags

There are three types of tags.

### System tags
These are tags generated by the system, such as those used in [multi-prompt architectures](../how-to/workflow_cookbook.md#split-a-chatbot-into-multiple-smaller-chatbots) to differentiate between parent and child chatbots.

### Session tags
These tags are added to [sessions](sessions.md), either manually, by pipeline nodes, or automatically by [tag rules](evaluations/tag_rules.md).
Tagged sessions can be found with the **Tags** filter on the [sessions list](sessions.md#tags-on-the-sessions-list).

### Message tags
These tags are added to specific messages within a participant session, either manually, by pipeline nodes, or automatically by [tag rules](evaluations/tag_rules.md).
Pipeline nodes add message tags in these ways:

- The **Message Tag** field adds a tag to the node's output message.
Many nodes have this field, such as the LLM, Render a Template, and Python nodes.
Check a node's settings to see whether it has one.
- A router's **Tag Output Message** setting tags the router's output message.
See [Route Tagging](../how-to/routers/index.md#route-tagging-tracing-observability).
- The Python node's `add_message_tag` function adds tags from code.

## Tags in a Session
Tags are labels you attach to messages and sessions.
They help you find the conversations and replies that matter without reading every chat.

## What you can do with tags

- **Review the replies on one topic.**
Set the [node](pipelines/nodes.md) that writes your clinic referrals to tag its replies `clinic-referral`.
Then read the tagged replies together to check the advice is safe and clear.
See [Tag a Node's Output Messages](../how-to/tag_node_output.md).
- **See which path a router chose.**
Tag each route of a [router](pipelines/router_nodes.md), then find the messages that fell back to the default route.
See [Tag a Router's Route](../how-to/routers/tag_router_routes.md).
- **Flag a message or conversation yourself.**
Mark a complaint, or a session that needs a person to follow up.
See [Create and Manage Tags](../how-to/manage_tags.md#how-do-i-tag-a-message-or-session-by-hand).
- **Let an evaluation flag problems for you.**
A tag rule can add a tag to the sessions or messages that score badly, so you review only those.
See [Tag Rules](evaluations/tag_rules.md).
- **Tag with your own rules (advanced).**
A [Python node](pipelines/nodes.md#python-node) can add tags from code.

After you tag, use the **Tags** filter on the sessions list to see only the conversations you want.
See [Tags on the Sessions List](sessions.md#tags-on-the-sessions-list).

## Message tags and session tags

A message tag labels one message, either a participant's message or the chatbot's reply.
A session tag labels a whole conversation, such as its outcome or topic.
Use a message tag when you want to find a specific message, and a session tag when you want to describe the conversation.

## Tags in a session

Open a session to see its tags and the tags on each message.
Session tags appear in the **Tags** bar at the top.
Session tags appear in the **Tags** tile of the session summary at the top.
Message tags appear beside each message's timestamp.
Hover over a tag to see who added it, for example "Added by Participant".
To add tags to a message, click the pencil icon (:fontawesome-solid-pencil:) beside its tags.

To find sessions by tag, see [Tags on the Sessions List](sessions.md#tags-on-the-sessions-list).

![Tags viewed for sessions and messages in Open Chat Studio](../assets/images/tags_screenshot.png)

## System tags

OCS adds some tags itself, called system tags.
For example, each chatbot reply carries a version tag such as `v3`, or `v3-unreleased` for an unpublished version.
Router [route tags](../how-to/routers/tag_router_routes.md) are system tags too.
System tags appear in a different color, and you cannot select, edit or delete them yourself.

## See also

- [Sessions](sessions.md)
- [Tag Rules](evaluations/tag_rules.md)
- [Python Node utility functions](../tech-hub/python_node.md#utility-functions)
- [Create and Manage Tags](../how-to/manage_tags.md)
Comment thread
lisa-tarbo marked this conversation as resolved.
Resolved
- [Python node utility functions](../tech-hub/python_node.md#utility-functions) `add_message_tag` and `add_session_tag`
53 changes: 53 additions & 0 deletions docs/how-to/manage_tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Create and Manage Tags

This guide shows you how to create tags, rename or delete them, and add them to a message or session by hand.
For background on what tags are for, see [Tags](../concepts/tags.md).

## Prerequisites

- The **Super Admin** role, if you want to create, rename or delete tags.
The **Manage Tags** link appears in the team sidebar only for this role.
See [User Groups](../concepts/team/groups.md) for what each role can do.
- A [session](../concepts/sessions.md) with messages, if you want to tag by hand.

## How do I create a tag?

1. Select **Manage Tags** in the team sidebar.
2. Click **Add new**.
3. Enter a name of up to 100 characters.
4. Click **Create**.

Tag names must be unique within your team.

![Manage Tags section showing options to create and edit tags](../assets/images/tags_manage.png)

## How do I rename or delete a tag?

On the **Manage Tags** page, find the tag's row.
Click the pencil icon (:fontawesome-solid-pencil:) to rename the tag or the trash can icon (:fontawesome-solid-trash:) to delete it.
System tags have neither action, because OCS manages them.

Deleting a tag removes it from every message and session that carries it.
OCS blocks the deletion if an evaluator's [tag rule](../concepts/evaluations/tag_rules.md) uses the tag.
Remove the tag from the rule first.

## How do I tag a message or session by hand?

1. Open a session from **All Sessions**.
2. To tag a message, hover over it and click the pencil icon (:fontawesome-solid-pencil:) beside its tags.
To tag the whole session, click **Add tag** in the **Tags** tile of the session summary.
3. Select one or more tags from the list.
To create a new tag here, type its name.
Only a **Super Admin** can create a tag here.
Other roles can select existing tags, and **Chat Viewer** cannot change tags.
4. Click outside the list to close it.
Each tag is saved as soon as you select it.

The tags appear on the message or in the session summary.
See [Tags in a session](../concepts/tags.md#tags-in-a-session).

## See also
Comment thread
lisa-tarbo marked this conversation as resolved.
Resolved

- [Tags](../concepts/tags.md)
- [Tag a Node's Output Messages](tag_node_output.md)
- [Chat Sessions](../concepts/sessions.md#tags-on-the-sessions-list)
35 changes: 15 additions & 20 deletions docs/how-to/routers/index.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,34 @@
# Configuration for Router Nodes

This page covers the configuration steps that apply to all router node types. For a conceptual overview of how routers work, see [Router Nodes in Pipelines](../../concepts/pipelines/router_nodes.md).
This page covers the configuration steps that apply to all router node types.
For a conceptual overview of how routers work, see [Router Nodes in Pipelines](../../concepts/pipelines/router_nodes.md).

Both LLM Routers (intent-based) and Static Routers (data-based) share the same core configuration pattern for directing conversation flow. You find these settings in the Advanced Settings of the node.
Both LLM Routers (intent-based) and Static Routers (data-based) share the same core configuration pattern for directing conversation flow.
You find these settings in the Advanced Settings of the node.

For router-specific configuration, see:

1. [LLM Router Configuration](llm_router.md)
2. [Static Router Configuration](static_router.md)

## The Default Output
Every router needs a "safety net" so the conversation never reaches a dead end. This is called the Default Output.

Every router needs a fallback output so the conversation always continues.
This is called the Default Output.

- The Indicator: The default output is marked with a blue asterisk (*) in the node configuration.
- The Logic: If the router cannot find a match for your configured outputs, or if a technical error occurs — including when an LLM Router's model returns no classification at all — the message is automatically directed to the downstream node connected to this Default Output.
- The Logic: If the router cannot find a match for your configured outputs, or if a technical error occurs, the message goes to the Default Output.
The message is automatically directed to the downstream node connected to it.
This includes when an LLM Router's model returns no classification at all.
- Customization: You can change the Default Output by clicking the blue * next to a different output keyword in your output list.

<a id="route-tagging-observability"></a>

## Route Tagging & Tracing (Observability)
To understand how participants move through your chatbot, you can enable Output Message Tagging. This is useful for debugging and analyzing routing performance.

- [Tagging](../../concepts/tags.md): Toggle the **Tag Output Message** flag within the Router node settings. Tags longer than 100 characters are cut to 100 characters when saved.
- [Tracing](../../concepts/tracing.md): Configure this for path-level analysis for debugging.

### Tag naming convention
To keep [system tags](../../concepts/tags.md#system-tags) organized, OCS follows this naming convention:

```text
<node_name>:<route_name>
```
To understand how participants move through your chatbot, you can enable Output Message Tagging.
This is useful for debugging and analyzing routing performance.

Example: If you have a Router node named `support_triage` and it selects the output keyword `BILLING`, the resulting tag is:
`support_triage:BILLING`

If the router falls back to its [Default Output](#the-default-output) — because nothing matched, or an error occurred — OCS appends `:default` to the tag, making the full form `<node_name>:<route_name>:default`. For example, `support_triage:GENERAL:default`. This makes fallback routes easy to filter for separately when reviewing tags.

Ensure your `node_name` is descriptive (for example, `intent_classifier`) so tags are easy to interpret.
- [Tagging](tag_router_routes.md): Toggle the **Tag Output Message** flag within the Router node settings.
The guide covers the tag naming rules, including the `:default` suffix.
- [Tracing](../../concepts/tracing.md): Configure this for path-level analysis for debugging.
2 changes: 1 addition & 1 deletion docs/how-to/routers/llm_router.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ You can choose a cheaper model if the complexity of classification of the messag

## Route Tagging

See [Route Tagging details](index.md#route-tagging-observability)
See [Tag a Router's Route](tag_router_routes.md).
2 changes: 1 addition & 1 deletion docs/how-to/routers/static_router.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ To ensure technical consistency, OCS handles keywords with the following rules:

## Route Tagging

See [Route Tagging details](index.md#route-tagging-observability)
See [Tag a Router's Route](tag_router_routes.md).
55 changes: 55 additions & 0 deletions docs/how-to/routers/tag_router_routes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Tag a Router's Route

This guide shows you how to tag a router's output message with the route it chose.
Route tags help you review how participants move through your chatbot.
This applies to both the **LLM Router** and **Static Router** nodes.

For background on message tags, see [Tags](../../concepts/tags.md#message-tags-and-session-tags).

For example, a router named `health_triage` sends questions about symptoms down a `CLINIC` route.
With tagging on, each of those messages carries the tag `health_triage:CLINIC`.

## Prerequisites

- A chatbot with a [router node](../../concepts/pipelines/router_nodes.md).

## How do I turn on route tagging?

1. Open your chatbot and view the **Pipeline** workflow.
2. Click the node edit button (or the **Advanced** link) to open the router node's settings.
3. In the **Advanced Settings**, turn on **Tag Output Message**.
It is in the same place for the **LLM Router** and the **Static Router**.
4. Close the settings dialog to save your changes.
Comment thread
lisa-tarbo marked this conversation as resolved.
Resolved
5. [Create and publish a version](../../tutorials/versioning_steps.md) of your chatbot.

## What is the name of a route tag?

OCS builds the tag name as `<node_name>:<route_name>`.
For the router above, a message routed to `CLINIC` gets `health_triage:CLINIC`.
Use a descriptive node name, such as `symptom_router`, because the node name is part of every tag.
Comment thread
lisa-tarbo marked this conversation as resolved.
Resolved

Comment thread
lisa-tarbo marked this conversation as resolved.
Resolved
If the router falls back to its [Default Output](index.md#the-default-output), OCS adds `:default` to the end.
For example, if the Default Output is `GENERAL`, the tag is `health_triage:GENERAL:default`.
This makes fallback routes easy to filter for when you review tags.

Tags longer than 100 characters are cut to 100 characters when saved.
Route tags are [system tags](../../concepts/tags.md#system-tags), so you cannot edit or delete them in **Manage Tags**.

## Expected outcome

Open a session after the router handles a message.
The router's output message carries the route tag.
To list sessions with the tag, see [Tags on the Sessions List](../../concepts/sessions.md#tags-on-the-sessions-list).

## Common issues

- **A router tag is missing.**
Check that **Tag Output Message** is turned on for that router.
- **Filtering by `:default` misses some fallback messages.**
A long node or route name can push the tag past 100 characters, and the cut removes `:default`.
Shorten the node or route names so the full tag fits.

## See also

- [Router Nodes](index.md)
- [Tags](../../concepts/tags.md)
56 changes: 56 additions & 0 deletions docs/how-to/tag_node_output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Tag a Node's Output Messages

Many nodes have a **Message Tag** field.
This guide shows you how to use it to make a node automatically tag every message it produces with a [message tag](../concepts/tags.md#message-tags-and-session-tags).

Use it when you want to find the messages a node produces, without tagging each by hand.
The tag applies to every message the node produces, so it works best on a node with a single purpose.
For example, an LLM node only advises participants to visit the clinic and explains how to book.
Tag its replies `clinic-referral`.
Every message with that tag is a referral, so you can review them together to check that the advice is safe and clear.
To tag a single message yourself, see [Create and Manage Tags](manage_tags.md#how-do-i-tag-a-message-or-session-by-hand).

## Prerequisites

- A chatbot with an [LLM node](../concepts/pipelines/nodes.md#llm-node), a [Render a Template node](../concepts/pipelines/nodes.md#render-a-template-node) or a [Python node](../concepts/pipelines/nodes.md#python-node).
- A published version of the chatbot and a channel to chat through, such as a [public link](channels/deploy_public_link_channel.md#add-a-public-link).

## How do I add a tag to a node's output?

The **Message Tag** field tags only the output of the node that has it.
These steps use the LLM node.
The field works the same way on the Render a Template and Python nodes, so the steps apply to them too.

1. Open your chatbot and view the **Pipeline** workflow.
2. Click the node edit button (or the **Advanced** link) to open its settings.
3. Find the **Message Tag** field and enter `clinic-referral`.
If the tag does not exist yet, OCS creates it for you.
4. Close the settings dialog to save your changes.
5. [Create and publish a version](../tutorials/versioning_steps.md) of your chatbot.

To tag only some of a Python node's messages, or to tag a session, use the node's code instead.
See [Python node utility functions](../tech-hub/python_node.md#utility-functions) for `add_message_tag` and `add_session_tag`.

## How do I see the tag on the chatbot's reply?

1. Open the chatbot through your channel and send a test message.
For example: `I have had a cough for two weeks. Should I see someone?`
2. Select **All Sessions** in the left menu and find the participant who sent your test message.
3. Click the view icon on the session to open the **Session Transcript**.
4. Find the chatbot's reply.

## Expected outcome

The tag `clinic-referral` appears on the chatbot's reply.
Your own message does not have the tag, because only the node's reply is tagged.

## Common issues

- **The tag is missing from the reply.**
Check that you saved the node settings and published a new version, and that you chatted with the published version.

## See also

- [Tags](../concepts/tags.md)
- [Create and Manage Tags](manage_tags.md)
- [Tag a Router's Route](routers/tag_router_routes.md)
2 changes: 1 addition & 1 deletion docs/tutorials/configure_llm_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ See [Prompt variables](../concepts/prompt_variables.md) for the full list of sup

## Step 5: Add a message tag (optional)

A [message tag](../concepts/tags.md#message-tags) labels the reply this node sends, so you can find and review those messages later.
A [message tag](../concepts/tags.md#message-tags-and-session-tags) labels the reply this node sends, so you can find and review those messages later.
For example, tag the replies of a node that handles billing questions with `billing`.

1. In the LLM node settings, find the **Message Tag** field.
Expand Down
Loading