Loading

Troubleshoot Agentforce Agent Behavior Using Session Tracing Data Model

Publiceringsdatum: Jul 24, 2026
Beskrivning

Overview

The Session Tracing Data Model (STDM) captures telemetry for Agentforce sessions in Data 360, providing visibility into agent execution and runtime behavior. This guide helps administrators and developers use STDM to trace session execution, monitor variable updates, inspect user and agent interactions, investigate action failures, review LLM prompts and responses, identify recurring execution patterns, and discover opportunities to optimize prompts, actions, subagents, and instructions. It also introduces the core STDM objects, explains their relationships, and provides practical SQL query examples and troubleshooting workflows to help diagnose issues and improve Agentforce behavior.


Without observability
: debugging is guesswork, tuning is slow, quality is risky, cost spikes go unnoticed, and trust erodes. With Agent Session Tracing, you get clear, structured logs for every session and interaction — facts, not guesses.

When to Use This Guide

Use this guide if you experience issues such as:

  • Agent selects the wrong topic
  • Expected action isn’t executed
  • Variables aren’t populated correctly
  • Agent responses are inconsistent
  • Prompt Templates don’t behave as expected
  • Agent loops between topics
  • Unexpected conversation flow
  • Action execution errors
  • Performance issues (slow responses, long interaction times)

Setup & Prerequisites

Enable Session Tracing

  1. Navigate to Setup → Search “Agentforce Session Tracing”.
  2. Enable the following:
    • Einstein Generative AI
    • Einstein Trust Layer
    • Einstein Audit, Analytics, and Monitoring Setup
    • Agentforce Session Tracing (main toggle)

Reference: Enable Agentforce Session Tracing — Prerequisites, permissions, troubleshooting

SSOT Package Version

Minimum required: Version 1.130+

To check your version:

  1. Setup → Installed Packages.
  2. Search for “SSOT”.
  3. Verify the version is ≥ 1.130.

If the version is too old, DMOs won’t appear in the Query Editor even if DLOs are visible.

DLO to DMO Mapping

After enabling session tracing:

  1. DLOs (Data Lake Objects) are provisioned first and serve as the raw data storage layer.
  2. Map each DLO to a DMO (Data Model Object) to make the data queryable.
    • Example: Map the AiAgentSession DLO → ssot__AiAgentSession__dlm DMO.

If DMOs are not visible, check the SSOT version and the DLO mapping.

Accessing STDM Queries

Before You Begin

Before reviewing Session Trace data, verify that:

  • Session Tracing is enabled (see Setup & Prerequisites).
  • You have reproduced the issue.
  • You have the Session ID for the affected conversation.
  • The agent configuration has been saved and published.
  • Recent configuration changes have been deployed.

How to find a Session ID: Run Query 3 scoped to a recent time window to browse sessions and grab a Session ID. You can also find it from the Conversation record in the Salesforce UI, or by querying the Messages table (Query 7) filtered by a recent date.

Understanding the STDM

The Five Core Tables

All objects use the ssot__ prefix (Standard Object Type) and end with __dlm. These are part of the Standard Data Cloud Object Model installed with Data 360 SSOT.

TableDMO NamePurposeKey Use Cases
Sessionssot__AiAgentSession__dlmSession-level metadataFind all sessions, get initial variables, check session status
Participantssot__AiAgentSessionParticipant__dlmWho joined (contacts, leads, users, agents)Identify which agent/user was involved
Interactionssot__AiAgentInteraction__dlmIndividual turns/threads within a sessionGroup messages and steps by conversation turn
Messagessot__AiAgentInteractionMessage__dlmEach user/agent utteranceSee exact user input and agent responses
Stepssot__AiAgentInteractionStep__dlmActions taken (tool calls, Apex/Flow/LLM)Debug action failures, trace execution flow

STDM Object Relationships

Session (1)
├── Participants (N)        [1-to-many: one session, many participants]
└── Interactions (N)        [1-to-many: one session has many turns]
     ├── Messages (N)       [1-to-many: one interaction has many messages]
     └── Steps (N)          [1-to-many: one interaction has many steps]
            └── GenAIGeneration (via ssot__GenerationId__c)
                  └── GenAIGatewayRequest / Response (for LLM calls)


The STDM integrates seamlessly with the Einstein Audit and Feedback Data Model-the foundational model for all Generative Audit and Feedback use-cases across Salesforce. Steps link to Einstein Audit records via ssot__GenerationId__c and ssot__GenAiGatewayRequestId__c.

Step Types Reference

Step TypeWhat It MeansQuery Use Case
VARIABLE_UPDATE_STEPVariable was set/modifiedTrack variable flow
TOPIC_CLASSIFICATION_STEPLLM selected a topicSee which topics were considered
ACTION_EXECUTION_STEPAction (Flow/Apex/Prompt) was calledDebug action failures
LLM_REASONING_STEPLLM generated a responseCheck reasoning quality
TRANSITION_STEPAgent moved to a different topicTrack conversation flow

Quick Troubleshooting Guide

SymptomStart with
Wrong topic selectedQuery 5 (LLM prompts)
Action not executedQuery 1 + Query 4
Variable missingQuery 2
Incorrect agent responseQuery 5
Runtime errorsQuery 4
Conversation historyQuery 7
Agent looping between topicsQuery 11 (interaction count) + Query 1
Slow responses / latency issuesQuery 9 (step duration) + Query 10 (interaction duration / TTFR)

Common Troubleshooting Queries

The following queries help diagnose the most common Agentforce configuration and runtime issues. Each query includes:

  • Use case — when to use the query.
  • SQL query — an example you can run in the Data Cloud Query Editor.
  • What this shows — the information returned by the query.
  • Configuration insights — how to interpret the results and identify opportunities to improve your Agentforce configuration.

Note: In every session-scoped query below, replace <SESSION_ID> with the Session ID of the conversation you’re investigating.


Query 1 — Get Complete Session Execution Flow

Use case: Trace all execution steps for an Agentforce session in chronological order. This query provides a complete view of how the agent processed the conversation, including topic selection, action execution, variable updates, LLM reasoning, and any runtime errors.

SELECT
  ssot__Name__c,
  ssot__AiAgentInteractionStepType__c,
  ssot__InputValueText__c,
  ssot__OutputValueText__c,
  ssot__PreStepVariableText__c,
  ssot__PostStepVariableText__c,
  ssot__ErrorMessageText__c,
  ssot__StartTimestamp__c
FROM "ssot__AiAgentInteractionStep__dlm"
WHERE ssot__AiAgentInteractionId__c IN (
  SELECT ssot__Id__c
  FROM "ssot__AiAgentInteraction__dlm"
  WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
)
ORDER BY ssot__StartTimestamp__c ASC;

What this shows:

  • Every action/step executed (topic selection, action calls, LLM reasoning)
  • Inputs passed to each step
  • Outputs returned
  • Variable state before/after each step
  • Runtime or validation errors, if any
  • The complete execution timeline for the session

Configuration insights:

  • Which actions were called vs. skipped (check if expected actions fired)
  • Variable transformations (did action outputs populate expected variables?)
  • Error patterns (action input validation failures → check required input variable references)

Query 2 — Track Variable Updates Across a Session

Use case: Review how variables change throughout a session to diagnose missing, incorrect, or unexpected values.

SELECT
  ssot__PreStepVariableText__c,
  ssot__PostStepVariableText__c,
  ssot__StartTimestamp__c
FROM "ssot__AiAgentInteractionStep__dlm"
WHERE
  ssot__AiAgentInteractionStepType__c = 'VARIABLE_UPDATE_STEP'
  AND ssot__AiAgentInteractionId__c IN (
    SELECT ssot__Id__c
    FROM "ssot__AiAgentInteraction__dlm"
    WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
  )
ORDER BY ssot__StartTimestamp__c ASC;

What this shows:

  • Variable state at each update point
  • When variables were set/cleared
  • Variable flow through the session

Configuration insights:

  • Missing variables → check if the prior action’s output variable mapping is correct
  • Variables never set → the action may not have been called (topic selection issue)
  • Variables cleared unexpectedly → check topic transition logic

Query 3 — Get Initial Session Variables

Use case: Review the variables and metadata available when the Agentforce session begins (context variables).

SELECT
  ssot__VariableText__c,
  ssot__StartTimestamp__c,
  ssot__EndTimestamp__c,
  ssot__AiAgentSessionEndType__c
FROM "ssot__AiAgentSession__dlm"
WHERE ssot__Id__c LIKE '%<SESSION_ID>%';

What this shows:

  • Initial context (user profile, session state, pre-populated data)
  • Session duration
  • Session completion status

Configuration insights:

  • Check if required context variables exist (e.g., userIdaccountId)
  • Verify session-level data was passed correctly from end users

Query 4 — Find Failed Actions

Use case: Identify actions that failed during execution and review the associated error messages, inputs, and timestamps to determine the root cause.

SELECT
  ssot__Name__c,
  ssot__AiAgentInteractionStepType__c,
  ssot__InputValueText__c,
  ssot__ErrorMessageText__c,
  ssot__StartTimestamp__c
FROM "ssot__AiAgentInteractionStep__dlm"
WHERE
  ssot__ErrorMessageText__c IS NOT NULL
  AND ssot__ErrorMessageText__c <> 'NOT_SET'
  AND ssot__AiAgentInteractionId__c IN (
    SELECT ssot__Id__c
    FROM "ssot__AiAgentInteraction__dlm"
    WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
  )
ORDER BY ssot__StartTimestamp__c ASC;

What this shows:

  • Actions that failed during execution
  • Validation, Apex, Flow, or runtime error messages
  • Inputs provided to the failed action

Configuration insights:

  • Validation errors → check action input descriptions; add required input variable references
  • Missing input → check if a prior action populated the required variables
  • Repeated errors → improve instructions to collect required data before the action call

Query 5 — Review LLM Prompts and Responses (Einstein Audit)

Use case: Review the prompts sent to the LLM and the corresponding responses to understand how the model selected topics, chose actions, or generated responses.

SELECT
  gr."promptTemplateDevName__c",
  gr."prompt__c",
  gen."responseText__c",
  gr."timestamp__c"
FROM "GenAIGatewayRequest__dlm" gr
JOIN "GenAIGatewayResponse__dlm" gresp
  ON gr."gatewayRequestId__c" = gresp."generationRequestId__c"
JOIN "GenAIGeneration__dlm" gen
  ON gresp."generationResponseId__c" = gen."generationResponseId__c"
WHERE gr."sessionId__c" LIKE '%<SESSION_ID>%'
ORDER BY gr."timestamp__c" ASC
LIMIT 100;

Note: The GenAIGatewayRequest__dlm, GenAIGatewayResponse__dlm, and GenAIGeneration__dlm tables are part of the Einstein Audit and Feedback Data Model and use a different naming convention (no ssot__ prefix). These are Einstein Audit tables that join to STDM via ssot__GenerationId__c and ssot__GenAiGatewayRequestId__c on the Step object.

What this shows:

  • The Prompt Template used (e.g., Topic Classifier, Action Selector)
  • The complete prompt sent to the LLM
  • The generated response returned by the LLM (selected topic, chosen action, reasoning)
  • The time each LLM request occurred

Configuration insights:

  • Check if topic descriptions appeared in the prompt correctly
  • See which topics the LLM considered (classification reasoning)
  • Verify action descriptions are clear in the prompt context
  • Identify if the LLM misinterpreted instructions

Query 6 — Find All Sessions with a Specific Error Pattern

Use case: Identify recurring errors across multiple sessions to help detect common configuration issues or trends.

SELECT
  ints.ssot__AiAgentSessionId__c,
  COUNT(steps.ssot__Id__c) AS error_count,
  MAX(steps.ssot__ErrorMessageText__c) AS sample_error
FROM "ssot__AiAgentInteraction__dlm" ints
JOIN "ssot__AiAgentInteractionStep__dlm" steps
  ON ints.ssot__Id__c = steps.ssot__AiAgentInteractionId__c
WHERE
  steps.ssot__ErrorMessageText__c LIKE '%required field missing%'
  AND steps.ssot__StartTimestamp__c >= CURRENT_DATE - INTERVAL '7' DAY
GROUP BY ints.ssot__AiAgentSessionId__c
HAVING COUNT(steps.ssot__Id__c) > 0
ORDER BY error_count DESC
LIMIT 50;

What this shows:

  • Sessions affected by the specified error
  • Frequency of the error
  • A sample error message for each session

Configuration insights:

  • Widespread “required field missing” → add required input variable references to the action
  • Repeated validation errors → improve the action description to clarify expected inputs

Query 7 — Get User Messages and Agent Responses

Use case: Review the conversation history to understand how the user interacted with the agent and how the agent responded throughout the session.

SELECT
  msg.ssot__AiAgentInteractionMessageType__c,   -- 'Input' (user) or 'Output' (agent)
  msg.ssot__ContentText__c,
  msg.ssot__MessageSentTimestamp__c
FROM "ssot__AiAgentInteractionMessage__dlm" msg
WHERE msg.ssot__AiAgentInteractionId__c IN (
  SELECT ssot__Id__c
  FROM "ssot__AiAgentInteraction__dlm"
  WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
)
ORDER BY msg.ssot__MessageSentTimestamp__c ASC;

What this shows:

  • User messages
  • Agent responses
  • Message timestamps
  • The chronological flow of the conversation

Configuration insights:

  • Check if the agent asked for information it already had (instruction quality)
  • Verify the agent’s response tone matches global_instructions
  • Identify if the agent hallucinated (response not based on action output)

Query 8 — Find Sessions with a Specific Step Type

Use case: Identify when a specific topic or action was executed and understand how frequently it is used across sessions.

SELECT
  ints.ssot__AiAgentSessionId__c,
  steps.ssot__Name__c,
  steps.ssot__StartTimestamp__c
FROM "ssot__AiAgentInteraction__dlm" ints
JOIN "ssot__AiAgentInteractionStep__dlm" steps
  ON ints.ssot__Id__c = steps.ssot__AiAgentInteractionId__c
WHERE
  steps.ssot__Name__c = 'OrderTracking'
  AND steps.ssot__StartTimestamp__c >= CURRENT_DATE - INTERVAL '7' DAY
ORDER BY steps.ssot__StartTimestamp__c DESC
LIMIT 100;

What this shows:

  • Sessions where the specified topic or action was executed
  • When the topic or action was invoked
  • Usage frequency over the selected time period

Configuration insights:

  • Action never called → check if the topic description includes trigger phrases
  • Action called too often → check for overlap with other topics (add boundary clauses)

Query 9 — Step Duration (Performance Debugging)

Use case: Find which individual step is the bottleneck — useful for slow action, Apex, or LLM calls.

SELECT
  ssot__AiAgentInteractionId__c AS InteractionId,
  ssot__Id__c AS StepId,
  ssot__Name__c AS StepName,
  DATEDIFF('second', ssot__StartTimestamp__c, ssot__EndTimestamp__c) AS Duration_Seconds
FROM "ssot__AiAgentInteractionStep__dlm"
ORDER BY Duration_Seconds DESC
LIMIT 100;

Configuration insights:

  • Long-running steps → consider optimizing the Apex/Flow/RAG service behind the action
  • Consistently slow LLM_REASONING_STEP → review prompt length, reduce context size

Query 10 — Interaction/Turn Duration & Time-To-First-Response (TTFR)

Use case: Find how long each turn took and measure Time-To-First-Response (TTFR) — a vital metric because it can indicate systemic lags in underlying systems such as RAG.

SELECT
  ssot__Id__c AS InteractionId,
  ssot__AiAgentSessionId__c AS SessionId,
  DATEDIFF('second', ssot__StartTimestamp__c, ssot__EndTimestamp__c) AS Duration_Seconds
FROM "ssot__AiAgentInteraction__dlm"
ORDER BY Duration_Seconds DESC
LIMIT 100;

Query 11 — Interaction Count per Session (Loop Detection)

Use case: Find sessions with an unusually high number of turns — a strong signal the agent is looping between topics.

SELECT
  ssot__AiAgentSessionId__c AS SessionId,
  COUNT(*) AS InteractionCount
FROM ssot__AiAgentInteraction__dlm
GROUP BY ssot__AiAgentSessionId__c
ORDER BY InteractionCount DESC
LIMIT 50;

Configuration insights:

  • High interaction count → run Query 1 on the session, look for repeated TRANSITION_STEP or TOPIC_CLASSIFICATION_STEP entries
  • Looping → topic descriptions likely overlap, add “DO NOT use for…” boundary clauses

Query 12 — Who Joined the Session (Participants)

Use case: Confirm which agent and user were involved in a session. Useful when verifying the correct agent was invoked or when debugging multi-agent scenarios.

SELECT
  ssot__AiAgentSessionId__c AS SessionId,
  ssot__ParticipantId__c AS ParticipantId
FROM ssot__AiAgentSessionParticipant__dlm
WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
ORDER BY ssot__AiAgentSessionId__c;

Query 13 — End-to-End Join (All Five DMOs)

Use case: Full session dump joining all five core objects — use this when you need a complete picture of a specific session for export or deep analysis.

SELECT *
FROM
  ssot__AiAgentSession__dlm,
  ssot__AiAgentInteraction__dlm,
  ssot__AiAgentInteractionStep__dlm,
  ssot__AiAgentInteractionMessage__dlm,
  ssot__AiAgentSessionParticipant__dlm
WHERE
  ssot__AiAgentInteractionStep__dlm.ssot__AiAgentInteractionId__c = ssot__AiAgentInteraction__dlm.ssot__Id__c
  AND ssot__AiAgentInteraction__dlm.ssot__AiAgentSessionId__c = ssot__AiAgentSession__dlm.ssot__Id__c
  AND ssot__AiAgentInteractionMessage__dlm.ssot__AiAgentInteractionId__c = ssot__AiAgentInteraction__dlm.ssot__Id__c
  AND ssot__AiAgentSessionParticipant__dlm.ssot__AiAgentSessionId__c = ssot__AiAgentSession__dlm.ssot__Id__c
  AND ssot__AiAgentSession__dlm.ssot__Id__c = '<SESSION_ID>';

How to Interpret Your Results

The SQL queries in this guide provide detailed insight into Agentforce runtime behavior. Use the following table to help interpret common findings.

ObservationPossible Cause
Expected action is missing from the execution traceThe topic wasn’t selected, execution conditions weren’t met, or required inputs weren’t available.
Variables remain empty throughout executionAn output mapping may be incorrect, or a previous action didn’t execute successfully.
Validation or execution errors are presentRequired inputs are missing, or the action configuration should be reviewed.
Multiple topic transitions occurTopic descriptions or boundaries may overlap.
Unexpected Topic Classifier resultsTopic descriptions, trigger phrases, or boundary definitions may need refinement.
Prompt is missing expected contextRequired variables or Prompt Template configuration may be incomplete.
High interaction count in Query 11Agent is likely looping — check topic boundary definitions.
Long durations in Query 9/10Bottleneck in a specific step or RAG service — review action/prompt configuration.

 

Lösning

Recommended Workflow for Strengthening Your Agent Configuration

Work through the queries in this order to move from a high-level view to root cause.

Step 1 — Get the session overview (Query 3: initial variables, duration, status).

SELECT
  ssot__VariableText__c,
  ssot__StartTimestamp__c,
  ssot__EndTimestamp__c,
  ssot__AiAgentSessionEndType__c
FROM "ssot__AiAgentSession__dlm"
WHERE ssot__Id__c LIKE '%<SESSION_ID>%';

Step 2 — Get the full execution trace (Query 1).

SELECT
  ssot__Name__c,
  ssot__AiAgentInteractionStepType__c,
  ssot__InputValueText__c,
  ssot__OutputValueText__c,
  ssot__PreStepVariableText__c,
  ssot__PostStepVariableText__c,
  ssot__ErrorMessageText__c,
  ssot__StartTimestamp__c
FROM "ssot__AiAgentInteractionStep__dlm"
WHERE ssot__AiAgentInteractionId__c IN (
  SELECT ssot__Id__c
  FROM "ssot__AiAgentInteraction__dlm"
  WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
)
ORDER BY ssot__StartTimestamp__c ASC;

Step 3 — Check variable flow (Query 2: run if variables are missing or wrong).

SELECT
  ssot__PreStepVariableText__c,
  ssot__PostStepVariableText__c,
  ssot__StartTimestamp__c
FROM "ssot__AiAgentInteractionStep__dlm"
WHERE
  ssot__AiAgentInteractionStepType__c = 'VARIABLE_UPDATE_STEP'
  AND ssot__AiAgentInteractionId__c IN (
    SELECT ssot__Id__c
    FROM "ssot__AiAgentInteraction__dlm"
    WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
  )
ORDER BY ssot__StartTimestamp__c ASC;

Step 4 — Link to LLM prompts (Query 5: run if topic or action selection is wrong).

SELECT
  gr."promptTemplateDevName__c",
  gr."prompt__c",
  gen."responseText__c",
  gr."timestamp__c"
FROM "GenAIGatewayRequest__dlm" gr
JOIN "GenAIGatewayResponse__dlm" gresp
  ON gr."gatewayRequestId__c" = gresp."generationRequestId__c"
JOIN "GenAIGeneration__dlm" gen
  ON gresp."generationResponseId__c" = gen."generationResponseId__c"
WHERE gr."sessionId__c" LIKE '%<SESSION_ID>%'
ORDER BY gr."timestamp__c" ASC
LIMIT 100;

Common Issues : STDM Diagnosis

Issue: “Action not firing”

STDM Query:

SELECT ssot__Name__c, ssot__AiAgentInteractionStepType__c, ssot__ErrorMessageText__c
FROM "ssot__AiAgentInteractionStep__dlm" 
WHERE ssot__AiAgentInteractionId__c IN (
  SELECT ssot__Id__c FROM "ssot__AiAgentInteraction__dlm" 
  WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
)
ORDER BY ssot__StartTimestamp__c ASC;

What to Look For:

  • Is the action in the step list? If NO → Topic selection issue or required input variable references not met
  • Check ssot__ErrorMessageText__c for validation errors

Configuration Fix:

  • Add required input variable references to action
  • Ensure prior action maps outputs to required variables

Issue: “Wrong topic selected”

STDM Query:

SELECT gr."prompt__c", gen."responseText__c"
FROM "GenAIGatewayRequest__dlm" gr
JOIN "GenAIGatewayResponse__dlm" gresp
  ON gr."gatewayRequestId__c" = gresp."generationRequestId__c"
JOIN "GenAIGeneration__dlm" gen
  ON gresp."generationResponseId__c" = gen."generationResponseId__c"
WHERE 
  gr."promptTemplateDevName__c" = 'TopicClassifier'
  AND gr."sessionId__c" LIKE '%<SESSION_ID>%';

What to Look For:

  • Read prompt__c to see all topic descriptions sent to LLM
  • Read responseText__c to see which topic LLM selected and why

Configuration Fix:

  • Shorten topic descriptions (<200 words)
  • Add boundary clauses (“DO NOT use this topic for…”)
  • Remove overlapping topics

Issue: “Variable not populated”

STDM Query:

SELECT ssot__PreStepVariableText__c, ssot__PostStepVariableText__c
FROM "ssot__AiAgentInteractionStep__dlm" 
WHERE ssot__AiAgentInteractionStepType__c = 'VARIABLE_UPDATE_STEP'
  AND ssot__AiAgentInteractionId__c IN (
    SELECT ssot__Id__c FROM "ssot__AiAgentInteraction__dlm" 
    WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
  )
ORDER BY ssot__StartTimestamp__c ASC;

What to Look For:

  • Check if variable was ever set in ssot__PostStepVariableText__c
  • If never set → Prior action didn’t execute or output variable mapping is wrong

Configuration Fix:

  • Check action’s output variable mapping in config
  • Ensure variable names match exactly

Issue: “Agent is looping”

STDM Query:

Query 11 (interaction count) → then Query 1 on the flagged session

What to Look For:

  • InteractionCount significantly higher than expected
  • Repeated TRANSITION_STEP entries in Query 1 with no resolution

Configuration Fix:

  • Identify overlapping topic descriptions
  • Add boundary clauses (“DO NOT handle X in this topic”)
  • Clarify escalation path in agent instructions

Issue: “Agent response is slow”

STDM Query:

Query 9 (step duration) + Query 10 (TTFR)

What to Look For:

  • Which step has the longest Duration_Seconds?
  • Is TTFR (first interaction duration) consistently high?

Configuration Fix:

  • Long Apex step → optimize Apex logic or query
  • Long LLM step → reduce prompt length, simplify instructions
  • High TTFR → investigate data source latency

Analyze Session Trace Results with an LLM to Improve Your Agent Configuration

After collecting STDM query results, share them with an LLM to help analyze the execution flow and get configuration recommendations.

Depending on the issue, share:

  • Query 1 — full execution trace.
  • Query 5 — LLM prompts and responses (for topic or action selection issues).
  • Query 4 — error details (for failed actions).
  • Query 2 — variable flow (for missing or incorrectly populated variables).

An LLM can help you:

  • Analyze the end-to-end execution flow.
  • Explain why a topic or action was selected.
  • Identify missing or incorrectly populated variables.
  • Interpret validation and execution errors.
  • Recommend improvements to topic descriptions, agent instructions, prompt templates, and variable mappings.
  • Suggest configuration changes to improve future agent behavior.

Quick Reference

Common Queries

What You WantQueryKey Fields
All steps in a sessionQuery 1ssot__Name__cssot__InputValueText__cssot__OutputValueText__c
Variable changesQuery 2ssot__PreStepVariableText__cssot__PostStepVariableText__c
Recent sessions / find a Session IDQuery 3ssot__Id__cssot__VariableText__c
Failed actionsQuery 4ssot__ErrorMessageText__c
LLM promptsQuery 5prompt__cresponseText__c
Error patterns across sessionsQuery 6error_countsample_error
User/agent messagesQuery 7ssot__AiAgentInteractionMessageType__cssot__ContentText__c
Usage of a specific actionQuery 8ssot__Name__cssot__StartTimestamp__c
Step-level performanceQuery 9Duration_Seconds per step
Turn duration / TTFRQuery 10Duration_Seconds per interaction
Loop detectionQuery 11InteractionCount per session
Participant confirmationQuery 12ssot__ParticipantId__c
Full session dumpQuery 13All 5 DMOs joined

Tips

  • Always start with Query 1 (full execution trace) — it gives the complete picture.
  • Check errors first (Query 4) — the fastest path to root cause.
  • Link to LLM prompts (Query 5) when topic or action selection is wrong.
  • Use variable tracking (Query 2) for action input issues.
  • Aggregate across sessions (Query 6) to find patterns.
  • Use Query 9/10 for performance issues, Query 11 for looping.
Ytterligare resurser
Knowledge-artikelnummer

005389127

 
Laddar
Salesforce Help | Article