Skip to main content

Overview

The simplest use of an Agent - a straightforward Q&A without tools. The agent uses the LLM directly to answer questions. This demonstrates the core agent loop: receiving a message, processing it through the LLM, and returning a response. Key concepts:
  • AgentBuilder: Constructs configured agent instances
  • AgentState: Immutable state container for messages and metadata
  • AgentLoop::execute(): Executes the agent loop until completion
  • UseGuards: Adds step/token/time safety limits
  • AgentEventConsoleObserver: Provides visibility into agent execution stages

Example