Class MonitoredExecution

java.lang.Object
dev.langchain4j.agentic.observability.MonitoredExecution

public class MonitoredExecution extends Object
Represents a monitored execution of an agentic system, tracking the top-level agent invocation and any other nested invocations, along with all the invocation currently in progress and any errors that occur during execution.

The execution stays ongoing while the agentic system is suspended, for instance waiting for a human: the invocations in progress at that moment, the root agent and the workflows containing the suspended step, are marked as suspended and continue when their agents are invoked again to resume the system, so their duration spans the suspension.

  • Method Details

    • ongoingInvocations

      public Collection<AgentInvocation> ongoingInvocations()
    • done

      public boolean done()
    • suspended

      public boolean suspended()
      Returns true while the agentic system is suspended, for instance waiting for a human, and this execution waits to be resumed by a new invocation of its root agent.
    • hasError

      public boolean hasError()
    • error

      public AgentInvocationError error()
    • topLevelInvocations

      public AgentInvocation topLevelInvocations()
    • memoryId

      public Object memoryId()
      Returns the memory ID that identifies the session this execution belongs to.
    • agenticScope

      public AgenticScope agenticScope()
    • toString

      public String toString()
      Overrides:
      toString in class Object