Session Lifecycle
Every session moves through the same five stages, from log submission through report delivery and optional intervention. Understanding this flow helps you integrate Agent Therapy into your existing deployment and monitoring workflows.1
Submit Logs
You submit a
behavior_log — a structured array of the agent’s conversation turns — either through the dashboard’s log uploader or via the POST /v1/sessions API endpoint. You can submit a single conversation or batch multiple conversations into one session for aggregate analysis.2
Processing
Agent Therapy validates and ingests your log data. Turns are parsed, tool calls are resolved, and the session is queued for analysis. Processing typically completes within a few seconds for logs under 1 MB.
3
Analysis
The platform’s analysis engine evaluates your logs across all behavioral pattern dimensions, scores each of the four health dimensions, and generates recommendations. For large or complex logs, analysis may take up to 30 seconds.
4
Report Ready
Your session report is published and immediately accessible in the dashboard and via the API (
GET /v1/sessions/{session_id}). You receive a notification via your configured alert channel if a finding exceeds your severity threshold.5
Intervention Applied (Optional)
If the report surfaces issues that warrant correction, you can apply one or more interventions directly from the session report view. Interventions are linked to the session that surfaced them, creating a clear cause-and-effect audit trail.
What to Include in a Session
Sessions are built around abehavior_log — a JSON array where each element represents one turn in the agent’s conversation. Every object in the array must include a role, content, and timestamp. Tool-related turns should also include a tool_calls field.
Behavior Log Schema
Example Behavior Log
Session Results
Once analysis is complete, Agent Therapy returns a structured session report. The top-level fields are:health_score
A 0–100 integer representing the agent’s Health Score for this session, computed from the four behavioral dimensions.
findings
An array of detected behavioral patterns. Each finding identifies what was detected, where in the conversation it occurred, and how severe it is.
recommendations
An array of actionable suggestions for addressing the detected findings. Each recommendation maps to one or more intervention types.
summary
A plain-English overview of the session results, suitable for sharing with stakeholders who don’t need to parse the full technical report.
Session History
Every session you run is stored and fully browsable — nothing is ephemeral. In the dashboard, navigate to Agents → select your agent → Sessions to see a chronological list of all past sessions with their scores, finding counts, and statuses. Via the API, you can retrieve a paginated list of sessions:- Audit trail: Demonstrate to customers, regulators, or internal stakeholders that your agent’s behavior is actively monitored and that issues are addressed promptly.
- Regression tracking: Compare scores before and after a prompt change or model upgrade to validate that the change improved behavior.
- Trend analysis: Identify whether specific failure modes are increasing in frequency, even if individual session scores remain acceptable.
Session Limits
Session limits vary by plan. Limits apply to two dimensions:- Log size per session: The maximum size of the
behavior_logpayload in a single API request. - Sessions per month: The total number of sessions you can run within a billing period.
Check your current plan’s limits and usage at any time in Settings → Plan & Usage in the dashboard. If you’re approaching your session limit, you can upgrade your plan or purchase additional session credits without waiting for the billing cycle to reset.
413 Payload Too Large error. In that case, consider splitting a very long conversation into multiple sessions or upgrading to a plan with a higher log size limit.