Skip to content

Concepts

Agent is the core runtime object. You construct it with an ISessionService and then configure:

  • Model
  • SystemPrompt
  • Tools
  • UseStreaming
  • Thinking
  • WorkingDirectory
  • MaxIterations
  • AutoCompaction
  • ContextBuilder
  • ToolTimeout
  • SubAgents and Presets

A Session stores runtime history across turns. Session services provide the persistence strategy:

  • InMemorySessionService for local development and tests
  • JsonFileSessionService for file-backed persistence
  • SQL storage when the platform is hosted through the server stack

SessionHelpers adds convenient operations such as Fork, Rewind, ResumeAt, RemoveFailedTools, and CreateCheckpoint.

AgentCircuits is event-driven. You do not only receive final text. The runtime emits typed events for:

  • text
  • tool use
  • tool results
  • thinking
  • images
  • metrics
  • final result metadata

Those same event types are used in the hosted runtime and UI layers.

Tools extend the agent beyond model-only text generation. You can:

  • use built-in tools from BuiltInTools
  • register [Tool] methods with [ToolParam]
  • build tools fluently with Tool.Create(...).WithHandler(...).Build()
  • load external tool inventories through MCP

Hooks let you intercept model and tool activity for cross-cutting concerns like approvals, logging, policy enforcement, or metrics.

Providers turn a model ID into a live ILanguageModel. The current packages cover Anthropic, OpenAI, Gemini, Bedrock, Ollama, and Grok.

Context builders determine how session history is turned back into model input. Memory tools add file-backed, cross-session knowledge that the agent can read and update over time.