Debug Console in KM
Watch the tutorial
Debug Console in KM
The Debug Console in the KM dashboard lets you simulate user interactions, capture responses from the KM agent in the virtual assistant, and debug queries in detail. It shows:
- Which user received which response from the KM agent.
- Why the AI pipeline produced that response, through the metadata attached to it.
How to Navigate to Debug Console
Open Debug Console from the KM side menu.

Users with the Knowledge Management Tester role don't need to navigate: KM opens directly on the Debug Console for them.
Not shown in the Master segmentIf your bot uses segments, the Debug Console isn't shown while the Master segment is selected. Switch to a specific segment to use it.
Who Can Access Debug Console
The Debug Console is available to all three Knowledge Management roles:
| Role | Access |
|---|---|
| Knowledge Management Admin | Full access. Can open sources, articles and audience details from the results. |
| Knowledge Management Agent | Full access. Opening an article from the results follows the Agent's usual content access. |
| Knowledge Management Tester | Debug Console only. Can run queries and see all response metadata, but sources are view-only: source links and audience names aren't clickable, and View article isn't available. |
See User Roles in KM for everything each role can do.
The Debug Console can show content across audiencesYou can run a query as any bot user, or as the dummy user, which bypasses audience filtering. Responses and source sections can therefore include content the person running the test wouldn't normally see. Give the Tester role only to people who are allowed to see that content.
How to Use Debug Console

- Select a Bot User: Choose the bot user to run your query as. Bot users you've tested as before appear in your list. You can also choose the dummy user, which bypasses audience filtering.
- Enter and Execute Your Query: Type your query into the text box and click the search button.
- Review the Response and Metadata: The console displays the generated response along with detailed metadata that helps diagnose why a particular response was produced. The section below explains each metadata element.
Note: For a better understanding of debug logs, see Lifecycle of user query in Leena KM.
Metadata Explanations
- Intent: This is the predicted FAQ. "Default fallback" means that no intent was predicted for the given user query.
- Query Language: This is the language in which the user asked the query.
- Query Translation: For queries submitted in languages other than English, this field displays the translated version in English.
- LLM Response: This field is divided into subfields that display metadata related to the LLM's response.
- Final LLM Response: This is the final response given by the LLM.
- Final Response Sources: These are the source articles displayed alongside the LLM response, providing context and supporting information to the bot user. This includes the article ID, article title, a preview of the article with the section the response came from highlighted, the article audience and the article type.
- Selecting a source opens a preview of the document. It doesn't open the article in the KM editor.
- For Excel or CSV sources, only the file name is shown; the content can't be previewed.
- For Testers, sources are view-only.
- Query for Search: This is the user query which is sent to the LLM.
- Search Types Enabled: Leena AI supports the following search types: document search, website search, and csv search. This field denotes which search type is enabled for the bot.
- Chosen Search Type: The LLM selects a search type that serves as the basis for constructing the final user response.
- Time Taken: This denotes the time taken by different search pipelines to give the response. This is in "seconds".
- Note: After all search pipelines give their responses, a different LLM selects which response is more accurate for the given user query.
- Document Search Debug: This field is divided into subfields that display metadata related to the document search.
- Query Debug: This displays the user query, the query used for document search, and the query sent to the LLM.
- Translation Debug: This can be used for non-english user queries to check how the user query is translated to English.
- Search sections passed to LLM: The document search pipeline extracts the most relevant sections from articles that address the user's query. These sections are then provided to the LLM, which crafts a user-friendly response based on the extracted data. Click a section to see its details. Admins and Agents can also open the source article from there.
- Personalised Response Debug: This section outlines the personalization feature available for bots. Personalization involves generating tailored responses from an article based on user-specific parameters.
- For example, in a leave policy where leave entitlements vary by employee band, if a user asks, "What is my leave allotment?" the system determines the user’s grade and provides the corresponding response from the article.
- LLM Response for Query: This denotes the response framed by the search pipeline.
- Structured CSV Search Debug --> tables passed to generate SQL query: This denotes the tables which are sent to the LLM to generate a SQL query.
- Structured CSV Search Debug --> Generated SQL query: This denotes the SQL query generated by the LLM based on the "user query".
- Structured CSV Search Debug --> Fetched SQL query results: This denotes the results fetched from SQL tables for the user query.
- Structured CSV Search Debug --> LLM response for query: The SQL results are passed to the LLM to generate the final response.
- Unstructured CSV Search Debug --> Tables passed to LLM: This denotes the tables directly passed to the LLM to generate a response for the user query. No SQL was generated as these were unstructured tables.
- Website Search Debug: This field is divided into subfields that display metadata related to the website search:
- Website page header
- Website page sectional content
- Website page url
How Long Will Debug Logs Be Stored?
The Debug Console keeps the full query history of every dashboard user who uses it. Each person's history is private to them: you see only the queries you ran and the bot users you tested as, for the selected bot and segment.
Updated about 1 month ago
