LoopContext.Session Property

Definition

Gets the AgentSession used for the loop.

public Microsoft.Agents.AI.AgentSession Session { get; }
member this.Session : Microsoft.Agents.AI.AgentSession
Public ReadOnly Property Session As AgentSession

Property Value

Remarks

When the caller does not provide a session, LoopAgent creates one up front. By default the same session is reused across every iteration so that conversation continuity is preserved and the original request is not replayed. When FreshContextPerIteration is enabled, LoopAgent resets the session before each re-invocation: a loop-owned session is created anew, while a caller-supplied session is restored from a snapshot taken at the start of the run by deserializing a fresh clone.

Applies to