Teneo Query Language

Teneo Query Language (TQL) allows you to analyze the conversational logs generated by your published bot. You can think of it as a tool similar to SQL in that it helps you to examine, analyze and understand huge amounts of data. TQL offers a versatile syntax to extract information about how users interacted with your system. With TQL you can:

  • see what users are saying to your bot
  • troubleshoot and improve conversations
  • generate important KPIs such as amount of traffic, safetynet occurrences, etc.
  • locate particular constelations of events, e.g. a variable changing while a particular flow was active
  • and much more...

Users with a technical background will feel more at home using TQL, as the queries can become quite detailed at times, and their purpose not immediately obvious. With this guide we hope to make even non-technical users proficient in understanding the syntax and implementing their own custom queries.

This diagram illustrates how Teneo, a dashboard, or any other client application interacts with a log data source contained in the Inquire backend.

TQL Concept

Data hierarchy

In order to understand Teneo Query Language, it is important to understand the organization of data in the session logs. In summary, we have a collection of sessions, in which each session is a collection of transactions. Transactions in turn are collections of events during the transaction, which describe the path the user input took through the solution until the response was returned. The basic element we can query is called an attribute or property. To use an analogy, properties "live" somewhere in the data and to find one you have to use its address which tells TQL exactly where to find it. Properties can be specifically located in sessions, transactions or events.

This table shows the main concepts behind the data hierarchy:

Concept Description Access prefix
Property The basic queryable elements in the data -
Session A collection of transactions documenting a user's interactions with the system s.
Transaction A collection of events starting with a request (user input) and ending with the bot's response t.
Event A record of the entire path through the solution leading to a response e.

Query syntax

The Teneo Query Language, TQL, provides a versatile set of possibilties to explore your data. At first glance, a typical query might appear overwhelming, because of the special syntax and the amount of notation used. But don't worry. Once you know how to read a query, it will start to become second nature.

Let's take a commonly used query as a starting point and break it down into its indivudal parts:

la s.id, t.e.userInput, t.e2.answerText:  t.e.userInput != "" limit 30

The result of the query is to list 30 input+output pairs, along with the ID of the session they belong to: TQL query result

Please visit the pages under Query Syntax to discover more detailed information about the various parts of this query, as well as additional possibilities in formulating your own queries.

How to's

In the how to pages we show you useful kinds of queries that you can run using TQL. These are the kinds of queries that nearly every project will need at some time or another. The use cases we cover include how to

Here are some quick steps to guide you to the log data source where you can write you queries. We also show this in one of our videos under analyze log data.

  1. Open your published solution, navigate to Optimization and select the tab Log Data: navigate to log data tab

  2. Under Manage Source select the option Open open lds

  3. Now you are viewing the LDS and can write your queries or run pre-defined queries, etc. lds view

  4. If you want to examine details of a specific session, click the button labeled New Session Viewer Tab.

Was this page helpful?