A Session represents a single run of an AI agent as it attempts to complete a task. It captures the full trace of the agent’s behavior — from initial state to final outcome — and provides deep visibility into each decision, action, and outcome along the way.
A Session is a top-level unit of observability. It begins when an agent starts a task and ends when the task is either completed, failed, or interrupted.
Learn to create a session with our Quick Start guide or see detailed examplesWithin each Session UI in Lucidic or what we call workflow sandbox, you’ll find:
A timeline of Steps (agent states and transitions)
Fine-grained Events (e.g. LLM calls, API responses) inside each Step
A workflow graph visualizing the session’s trajectory
A GIF/video replay of the agent’s interaction (if available)
Evaluation scores, cost metrics, metadata, and more
Sessions are non-deterministic by nature. Re-running the same task may lead to different outcomes due to the agent’s autonomy and stochasticity.
A Session is composed of ordered Steps, each representing a unique state and action taken by the agent. Each Step contains multiple Events, representing granular atomic operations like LLM calls or API hits.
Copy
Ask AI
Session└── Step ├── Event ├── Event └── ...
Steps and Events are documented here → and here → respectively.
Passed in at runtime using the Python SDK. Useful for customized or domain-specific scoring.
Copy
Ask AI
lai.end_session( is_successful=True, session_eval=4.5, # Your custom score (numeric value, not string) session_eval_reason="Agent completed primary objectives but took longer than expected")