Skip to main content

Tagging and Triaging

Let's say we want to tag every conversation in our community Slack workspace with their relevant group label:

  • support — Technical support questions and troubleshooting
  • sales — Questions about products, pricing, or purchasing
  • billing — Billing, invoicing, or payment-related inquiries
  • feedback — Product feedback, feature requests, or complaints

We also want to triage the priority of each feedback conversation with: "low", "medium", "high".

from runllm import Agent, Event, SlackListener
from runllm.decorators import entrypoint

@entrypoint(
listeners=[SlackListener(team_id="T123456")]
)
def tag_and_triage_wf(agent: Agent, event: Event):
convo = event.conversation

# This automatically tags the conversation with any of the tags that fit.
# As more user messages come in, more tags can be applied.
applied_tags = agent.tag(
convo,
options={
"support": "Technical support questions and troubleshooting",
"sales": "Questions about products, pricing, or purchasing",
"billing": "Billing, invoicing, or payment-related inquiries",
"feedback": "Product feedback, feature requests, or complaints"
}
)
print(f"Tags applied: {applied_tags}")

# All tags are automatically saved on convo.tags.
if convo.tags:
agent.categorize(
convo,
categories={
"low": "Minor suggestions or general comments that don't require follow-up",
"medium": "Feedback that could improve product quality or user experience and may warrant review",
"high": "Critical bugs, urgent complaints, or issues affecting customer retention"
},
default="low",

# This automatically pins one of the categories to the conversation
# as a tag. This means a conversation can never accidentally get tagged
# with multiple prioritizes, even as we reevaluate the category.
apply_as_tags=True
)
tip

After these tags are applied, you will be able to view, search, filter, and aggregate them in the RunLLM dashboard.